OFFSET
0,4
COMMENTS
A transform of A000045 under the mapping g(x) -> (1/(1+x^3)) * g(x/(1+x^3)).
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,-2,1,0,-1).
FORMULA
G.f.: x/(1 - x - x^2 + 2*x^3 - x^4 + x^6).
a(n) = a(n-1) + a(n-2) - 2*a(n-3) + a(n-4) - a(n-6).
a(n) = Sum_{k=0..floor(n/3)} binomial(n-2*k, k)*(-1)^k*Fibonacci(n-3*k).
MATHEMATICA
LinearRecurrence[{1, 1, -2, 1, 0, -1}, {0, 1, 1, 2, 1, 2}, 65] (* G. C. Greubel, Aug 03 2023 *)
PROG
(Magma) I:=[0, 1, 1, 2, 1, 2]; [n le 6 select I[n] else Self(n-1) +Self(n-2) -2*Self(n-3) +Self(n-4) -Self(n-6): n in [1..65]]; // G. C. Greubel, Aug 03 2023
(SageMath)
@CachedFunction
def a(n): # a = A099505
if (n<6): return (0, 1, 1, 2, 1, 2)[n]
else: return a(n-1) +a(n-2) -2*a(n-3) +a(n-4) -a(n-6)
[a(n) for n in range(71)] # G. C. Greubel, Aug 03 2023
CROSSREFS
KEYWORD
easy,sign
AUTHOR
Paul Barry, Oct 20 2004
STATUS
approved