A099505 A transform of the Fibonacci numbers.
0, 1, 1, 2, 1, 2, 0, 1, -3, -2, -8, -5, -12, -4, -11, 6, -1, 28, 16, 56, 26, 72, 3, 51, -80, -19, -224, -104, -373, -99, -408, 154, -205, 770, 222, 1655, 540, 2367, 24, 2196, -2196, 664, -6440, -1555, -11543, -1750, -14427, 4690, -11340, 22009, -1595, 49534, 7008, 77051, -5264, 85296, -65467, 57874
Offset: 0
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).
Programs
-
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
-
Mathematica
LinearRecurrence[{1,1,-2,1,0,-1}, {0,1,1,2,1,2}, 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
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).
Comments