OFFSET
1,1
COMMENTS
a(1) = 123 a(2) = 1 + 2 + 3 = 6 a(3) = (1 + 2 + 3) + 6 = 12 a(4) = (1 + 2 + 3) + 6 + (1 + 2) = 15 a(5) = (1 + 2 + 3) + 6 + (1 + 2) + (1 + 5) = 21 a(6) = (1 + 2 + 3) + 6 + (1 + 2) + (1 + 5) + (2 + 1) = 24 a(7) = (1 + 2 + 3) + 6 + (1 + 2) + (1 + 5) + (2 + 1) + (2 + 4) = 30 ...
Essentially the same as A016052. - R. J. Mathar, Jun 18 2008
LINKS
James C. McMahon, Table of n, a(n) for n = 1..10000
Sergio Silva, Teste Numerico.
FORMULA
a(n) = a(n-1) + sum of digits of a(n-1), a(1) = 123
MATHEMATICA
s={123}; sum=0; Do[sum=sum+Total[IntegerDigits[s[[-1]]]]; AppendTo[s, sum], {n, 54}]; s (* James C. McMahon, Nov 16 2024 *)
PROG
(PARI) s=0; a=123; print1(a, ", "); for(n=1, 100, dig=eval(Vec(Str(a))); s=s+sum(i=1, length(dig), dig[i]); print1(s, ", "); a=s)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Herman Jamke (hermanjamke(AT)fastmail.fm), Oct 02 2006
STATUS
approved