Collatz Problem by aaa

main=readLn>>=f
f 1=p 1
f n|odd n=p n>>f(n*3+1)
f n=p n>>f(n`div`2)
p=print

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

download

return to the top page