OFFSET
0,3
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,1,-2,1).
FORMULA
G.f.: (1-x)^(-1)/(1-x^2+x^3).
a(n) = a(n-1) + a(n-2) - 2*a(n-3) + a(n-4) with a(0)=1, a(1)=1, a(2)=2, a(3)=1. - Harvey P. Dale, Mar 26 2012
a(n) = (-1)^n * Sum_{k=0..floor(n/2)} binomial(k-1,n-2*k). - Seiichi Manyama, Aug 14 2024
MATHEMATICA
CoefficientList[Series[(1-x)^(-1)/(1-x^2+x^3), {x, 0, 60}], x] (* or *) LinearRecurrence[{1, 1, -2, 1}, {1, 1, 2, 1}, 60] (* Harvey P. Dale, Mar 26 2012 *)
PROG
(PARI) Vec((1-x)^(-1)/(1-x^2+x^3)+O(x^99)) \\ Charles R Greathouse IV, Sep 27 2012
(PARI) a(n) = (-1)^n*sum(k=0, n\2, binomial(k-1, n-2*k)); \\ Seiichi Manyama, Aug 14 2024
CROSSREFS
KEYWORD
sign,easy
AUTHOR
N. J. A. Sloane, Nov 17 2002
STATUS
approved