happy number by 51b

define(f,`ifelse($1,2001,,ifelse(g($1),1,$1
)`f(incr($1))')')define(g,`ifelse(eval($1<7),1,$1,`g(eval(h($1%10)+h($1/10%10)+h($1/100%10)+$1/1000))')')define(h,$1*($1))f(1)

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

download

return to the top page