OFFSET
1,2
COMMENTS
This sequence is believed to be infinite.
EXAMPLE
181 is in this sequence because 181 - (1+8+1)^2 = 81. Then 81 - (8+1)^2 = 0.
PROG
(PARI)
a(n)=k=n; c=1; v=List(); listput(v, k); while(c, if(k>=0, k-=sumdigits(k)^2; c+=1; if(k==2||k==3||k==0||k==6||k==9, return(k)); if(vecsearch(Vec(v), k), return(sumdigits(abs(k)))); listput(v, k)); if(k<0, k+=sumdigits(-k)^2; c+=1; if(k==2||k==3||k==0||k==6||k==9, return(k)); if(vecsearch(Vec(v), k), return(sumdigits(abs(k)))); listput(v, k)); c+=1)
for(n=1, 10^4, if(a(n)==0, print1(n, ", ")))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Derek Orr, Jul 24 2017
STATUS
approved