happy number by potato

for x in range(2000):\x0d
 n=`x`\x0d
 while n!=4 and n>1:\x0d
  n=sum(int(i)**2 for i in str(n))\x0d
  if n==1:\x0d
   print x\x0d

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

download

return to the top page