OFFSET
0,4
LINKS
Harry J. Smith, Table of n, a(n) for n = 0..1000
EXAMPLE
a(8) = 12 because a(7) = 13, a(6) = 8 and 4 = 1+3 and 12 = 4 + 8.
MATHEMATICA
a[0] = 0; a[1] = 1; a[n_] := a[n] = Apply[ Plus, IntegerDigits[ a[n - 1] ]] + a[n - 2]; Table[ a[n], {n, 0, 100} ]
Transpose[NestList[{Last[#], Total[IntegerDigits[Last[#]]]+First[#]}&, {0, 1}, 60]][[1]] (* Harvey P. Dale, Dec 07 2011 *)
PROG
(PARI): digitsum(n) = local(v, d); v=[]; while(n>0, d=divrem(n, 10); n=d[1]; v= concat(v, d[2])); sum(j=1, matsize(v)[2], v[j]) a065076(m)=local(a, j, v, w); w=1; print1(w, ", "); v=1; print1(v, ", "); for(j=3, m, a=digitsum(v)+w; print1(a, ", "); w=v; v=a) a065076(65)
(PARI) SumD(x)= { local(s); s=0; while (x>9, s+=x-10*(x\10); x\=10); return(s + x) } { for (n=0, 1000, if (n>1, a=SumD(a1) + a2; a2=a1; a1=a, if (n, a=a1=1, a=a2=0)); write("b065076.txt", n, " ", a) ) } \\ Harry J. Smith, Oct 06 2009
(Haskell)
a065076 n = a065076_list !! n
a065076_list = 0 : 1 : zipWith (+)
a065076_list (map a007953 $ tail a065076_list)
-- Reinhard Zumkeller, Nov 13 2014
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Bodo Zinser, Nov 09 2001
EXTENSIONS
More terms from Larry Reeves (larryr(AT)acm.org) and Robert G. Wilson v, Nov 13 2001
STATUS
approved