Collatz Problem by konn

main=readLn>>=mapM print.c;c 1=[1];c n=n:c([n`div`2,3*n+1]!!(n`mod`2))

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page