OFFSET
0,4
COMMENTS
This sequence is a variant of the Fibonacci sequence (A000045) with variable steps.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..8191
Rémy Sigrist, Logarithmic scatterplot of the first 2^17 terms
FORMULA
a(2*n) = a(n).
EXAMPLE
a(0) = 0 by definition.
a(1) = 1 by definition.
a(2) = a(2-2^0) + a(2-2^1) = a(1) + a(0) = 1 + 0 = 1.
a(3) = a(3-2^0) + a(3-2^1) = a(2) + a(1) = 1 + 1 = 2.
a(4) = a(4-2^1) + a(4-2^2) = a(2) + a(0) = 1 + 0 = 1.
a(5) = a(5-2^1) + a(5-2^2) = a(3) + a(1) = 2 + 1 = 3.
a(6) = a(6-2^1) + a(6-2^2) = a(4) + a(2) = 1 + 1 = 2.
a(7) = a(7-2^1) + a(7-2^2) = a(5) + a(3) = 3 + 2 = 5.
a(8) = a(8-2^2) + a(8-2^3) = a(4) + a(0) = 1 + 0 = 1.
PROG
(PARI) { for (n=1, #a=vector(75), print1 (a[n]=if (n==1, 0, n==2, 1, e=#binary(n-1)-2; a[n-2^e]+a[n-2^(e+1)]), ", ")) }
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Apr 11 2022
STATUS
approved