for i=1to 2e3j=i 1k=k+mod(j,10)^2:j=int(j/10):if j<7j=k+j^2:k=0 if j>6goto 1 if j=1?i next