A131294 a(n)=ds_3(a(n-1))+ds_3(a(n-2)), a(0)=0, a(1)=1; where ds_3=digital sum base 3.
0, 1, 1, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3
Offset: 0
Examples
a(5)=3, since a(3)=2, ds_3(2)=2, a(4)=3=10(base 3), ds_3(3)=1 and so a(5)=2+1.
Links
Crossrefs
Programs
-
Mathematica
nxt[{a_,b_}]:={b,Total[IntegerDigits[a,3]]+Total[IntegerDigits[b,3]]}; Transpose[NestList[nxt,{0,1},100]][[1]] (* Harvey P. Dale, Aug 02 2016 *)
Formula
Extensions
Incorrect comment removed by Michel Marcus, Apr 29 2018
Comments