A071995 a(1) = 1, a(2) = 0, a(n) = a(floor(n/3)) + a(n - floor(n/3)).
1, 0, 1, 2, 3, 2, 3, 2, 3, 4, 3, 4, 5, 6, 7, 6, 7, 6, 7, 8, 9, 10, 9, 8, 9, 8, 9, 10, 11, 12, 13, 14, 13, 12, 11, 12, 13, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 20, 19, 18, 19, 18, 19, 18, 19, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 29, 30, 29, 28, 27, 26, 27, 28, 27, 26
Offset: 1
Links
- Gheorghe Coserea, Table of n, a(n) for n = 1..10000
- David Moews, Asymptotic behavior of Rauzy's sequence
- Jeffrey Shallit, Ten Problems I Can't Solve (1.1 MB ps)
Programs
-
Mathematica
a[1]=1; a[2]=0; a[n_] := a[n]=a[Floor[n/3]]+a[n-Floor[n/3]]; Table[a[n], {n, 1, 80}]
-
PARI
n = 33; v = vector(n); v[1] = 'x; v[2] = 'y; for(i = 3, n, v[i] = v[floor(i/3)] + v[i - floor(i/3)]); apply(e -> polcoeff(e, 1, v[1]), v) \\ Gheorghe Coserea, Aug 22 2015
Extensions
Edited by Robert G. Wilson v, Jun 23 2002
Comments