happy number by rolf

for i in range(1,2001):
 j=i
 while i not in[1,4]:s=0;exec's+=(i%10)**2;i/=10;'*4;i=s 
 if i<2:print j

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

download

return to the top page