OFFSET
0,3
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
MAPLE
P:=proc(n) local a, i, k, w, x; a:=0; print(a); for i from 1 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; x:=0; k:=a; while k>0 do x:=x+k-(trunc(k/10)*10); k:=trunc(k/10); od; a:=w+x; print(a); od; end: P(101);
MATHEMATICA
nxt[{n_, a_}]:={n+1, Total[IntegerDigits[a]]+Total[IntegerDigits[n+1]]}; NestList[nxt, {0, 0}, 80][[All, 2]] (* Harvey P. Dale, Feb 02 2017 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paolo P. Lava and Giorgio Balzarotti, May 20 2008
STATUS
approved