login
A139762
a(n)=Sum_digits_of_a(n-1)+Sum_digits_of(n).
1
0, 1, 3, 6, 10, 6, 12, 10, 9, 18, 10, 3, 6, 10, 6, 12, 10, 9, 18, 19, 12, 6, 10, 6, 12, 10, 9, 18, 19, 21, 6, 10, 6, 12, 10, 9, 18, 19, 21, 15, 10, 6, 12, 10, 9, 18, 19, 21, 15, 19, 15, 12, 10, 9, 18, 19, 21, 15, 19, 24, 12, 10, 9, 18, 19, 21, 15, 19, 24, 21, 10, 9, 18, 19, 21, 15, 19
OFFSET
0,3
LINKS
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
Sequence in context: A333531 A082184 A080817 * A055262 A353199 A138797
KEYWORD
easy,nonn
AUTHOR
STATUS
approved