for n=1,2e3 do s=n while s>6 do t=s..''s=0 for c in t:gfind'.'do s=s+c^2 end end s=s>1 or print(n)end