OFFSET
1,2
COMMENTS
Conjecture: all terms are divisible by 9. - Harvey P. Dale, Mar 28 2019
EXAMPLE
n=315 --> 3+1+5=9 --> 315+9=324 --> 3+2+4=9.
n=873 --> 8+7+3=18 --> 873+18=891 --> 8+9+1=18.
MAPLE
P:=proc(n) local a, i, k, w; for i from 0 by 1 to n do w:=0; k:=i; while k>0 do w:=w+k-(trunc(k/10)*10); k:=trunc(k/10); od; a:=w; k:=i+w; w:=0; while k>0 do w:=w+k-(trunc(k/10)*10); k:=trunc(k/10); od; if a=w then print(i); fi; od; end: P(1000);
MATHEMATICA
Select[Range[0, 700], Total[IntegerDigits[#]]==Total[IntegerDigits[#+ Total[ IntegerDigits[ #]]]]&] (* Harvey P. Dale, Mar 28 2019 *)
PROG
(PARI) isok(n) = my(sn = sumdigits(n)); sn == sumdigits(n+sn); \\ Michel Marcus, May 10 2019
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Paolo P. Lava and Giorgio Balzarotti, Jul 09 2007
STATUS
approved