OFFSET
0,2
COMMENTS
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,1,-1,-1).
FORMULA
a(n) = F(n-3) + F(n) - A010872(n+1).
a(n+3) = a(n) + 4*F(n).
G.f.: (2*x^4+3*x^2-3*x+1)/( (x-1)*(x^2+x-1)*(1+x+x^2) ). [Charles R Greathouse IV, Jun 04 2013]
EXAMPLE
a(2)=-2+1+3=2, a(3)=2-2+1=1, a(4)=1+2-1=2, a(5)=2+1+3=6.
a(0)=F(-3)+F(n)-1=2+0-1=1, a(1)=-1+1-2=-2, a(2)=1+1-0=2.
a(3)=1+4*0=1, a(4)=-2+4*1=2, a(5)=2+4*1=6, a(6)=1+4*2=9.
MATHEMATICA
CoefficientList[Series[(2 x^4 + 3 x^2 - 3 x + 1) / (x^5 + x^4 - x^3 - x^2 - x + 1), {x, 0, 40}], x] (* Vincenzo Librandi, Jun 05 2013 *)
LinearRecurrence[{1, 1, 1, -1, -1}, {1, -2, 2, 1, 2}, 40] (* Hugo Pfoertner, Feb 12 2024 *)
PROG
(PARI) Vec((2*x^4+3*x^2-3*x+1)/(x^5+x^4-x^3-x^2-x+1)+O(x^99)) \\ Charles R Greathouse IV, Jun 04 2013
(Magma) I:=[1, -2, 2, 1, 2]; [n le 5 select I[n] else Self(n-1)+Self(n-2)+Self(n-3)-Self(n-4)-Self(n-5): n in [1..40]]; // Vincenzo Librandi, Jun 05 2013
CROSSREFS
KEYWORD
sign,easy,less
AUTHOR
Paul Curtz, Jun 04 2013
EXTENSIONS
a(23) corrected by Charles R Greathouse IV, Jun 04 2013
More terms from Bruno Berselli, Jun 04 2013
STATUS
approved