4 ms·
lol totally Did this in Haskell, and since all the lower numbers are known, started searching at 2^361 To end the recursion I just have it print -1 when it re
by D7x7w9pHnT 5y ago
lol totally
Did this in Haskell, and since all the lower numbers are known, started searching at 2^361
To end the recursion I just have it print -1 when it reaches 1
f :: Integer -> Integer
f n
| n == 1 = -1
| even n = f (n `div` 2)
| odd n = f (3*n + 1)
main = print $ map f [2^361..]