OFFSET
0,4
LINKS
Harry J. Smith, Table of n, a(n) for n = 0..1000
MAPLE
a[0]:=0:a[1]:=1:a[2]:=1:for n from 3 to 100 do d:=a[n-1]:s:=0:while d>0 do c:=d mod 10:s:=s+c:d:=(d-c)/10 od:e:=a[n-2]:t:=0:while e>0 do c:=e mod 10:t:=t+c:e:=(e-c)/10 od:a[n]:=a[n-1]+t od: seq(a[n], n=0..56); # Zerinvary Lajos, Mar 19 2009
MATHEMATICA
a[0] = 0; a[1] = 1; a[n_] := a[n] = Apply[ Plus, IntegerDigits[ a[n - 2] ]] + a[n - 1]; Table[ a[n], {n, 0, 100} ]
PROG
(PARI) SumD(x)= { local(s=0); while (x>9, s+=x-10*(x\10); x\=10); return(s + x) } { for (n=0, 1000, if (n>1, a=SumD(a2) + a1; a2=a1; a1=a, if (n, a=a1=1, a=a2=0)); write("b065124.txt", n, " ", a) ) } \\ Harry J. Smith, Oct 10 2009
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Robert G. Wilson v, Nov 13 2001
STATUS
approved