login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(0) = 0, a(1) = 1, a(n) = (sum of digits of a(n-1)) + a(n-2).
5

%I #20 Jun 18 2018 03:41:33

%S 0,1,1,2,3,5,8,13,12,16,19,26,27,35,35,43,42,49,55,59,69,74,80,82,90,

%T 91,100,92,111,95,125,103,129,115,136,125,144,134,152,142,159,157,172,

%U 167,186,182,197,199,216,208,226,218,237,230,242,238,255,250,262,260,270

%N a(0) = 0, a(1) = 1, a(n) = (sum of digits of a(n-1)) + a(n-2).

%H Harry J. Smith, <a href="/A065076/b065076.txt">Table of n, a(n) for n = 0..1000</a>

%e a(8) = 12 because a(7) = 13, a(6) = 8 and 4 = 1+3 and 12 = 4 + 8.

%t 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} ]

%t Transpose[NestList[{Last[#],Total[IntegerDigits[Last[#]]]+First[#]}&, {0,1}, 60]][[1]] (* _Harvey P. Dale_, Dec 07 2011 *)

%o (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)

%o (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

%o (Haskell)

%o a065076 n = a065076_list !! n

%o a065076_list = 0 : 1 : zipWith (+)

%o a065076_list (map a007953 $ tail a065076_list)

%o -- _Reinhard Zumkeller_, Nov 13 2014

%Y Cf. A007953 and A007612.

%Y Cf. A030132.

%K nonn,base,easy

%O 0,4

%A _Bodo Zinser_, Nov 09 2001

%E More terms from Larry Reeves (larryr(AT)acm.org) and _Robert G. Wilson v_, Nov 13 2001