OFFSET
0,5
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..10945
FORMULA
a(A000045(k)) = 1 for any k > 0.
EXAMPLE
a(0) = 0 by definition.
a(1) = 1 by definition.
a(2) = a(2-F(2)) + a(2-F(3)) = a(1) + a(0) = 1 + 0 = 1.
a(3) = a(3-F(3)) + a(3-F(4)) = a(1) + a(0) = 1 + 0 = 1.
a(4) = a(4-F(3)) + a(4-F(4)) = a(2) + a(1) = 1 + 1 = 2.
a(5) = a(5-F(4)) + a(5-F(5)) = a(2) + a(0) = 1 + 0 = 1.
a(6) = a(6-F(4)) + a(6-F(5)) = a(3) + a(1) = 1 + 1 = 2.
a(7) = a(7-F(4)) + a(7-F(5)) = a(4) + a(2) = 2 + 1 = 3.
a(8) = a(8-F(5)) + a(8-F(6)) = a(3) + a(0) = 1 + 0 = 1.
PROG
(PARI) { e=2; for (n=1, #a=vector(81), print1 (a[n]=if (n==1, 0, n==2, 1, if (n>fibonacci(e+2), e++); a[n-fibonacci(e)]+a[n-fibonacci(e+1)]), ", ")) }
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Apr 11 2022
STATUS
approved