jq is useful to slice, filter, map and transform structured json data.
brew install jq
| num = 27 | |
| steps = 0 | |
| # while steps < 30: # use this while logic to show that it continuously loops 4,2,1. The number 30 can be changed to any arbitrary number | |
| while num != 1: | |
| if num % 2 != 0: | |
| num = num * 3 + 1 | |
| else: | |
| num = num / 2 | |
| print(num) | |
| steps += 1 |
| #!/usr/bin/env | |
| # Python Docs https://docs.python.org/3/library/secrets.html | |
| import secrets | |
| secrets.token_hex(5).upper() # The number of actual character returned will be double the number in token_hex(n) |