Description
My friend Lothar has been looking into hailstones recently.
Attachments
https://imaginaryctf.org/f/b91Fa#Encryption.py
Writeup
Count the Collatz steps (as in, the number of steps needed using the Collatz conjecture to reach 1) of the numbers, and use decimal to text to revert it.
ct = [94, 322, 145, 71, 514, 167, 27, 124, 125, 447, 146, 257, 121, 233, 147, 214, 54, 55, 95, 82, 142, 671, 1259, 864, 164, 83, 215, 73, 342]
def collatz(n):
if n == 1:
return 0
if n%2 == 0:
return collatz(n//2) + 1
return collatz(3*n + 1) + 1
flag = ''
for i in ct:
flag += chr(collatz(i))
print(flag)```
Flag
ictf{Collatz_Stepping_Stones}