OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (-2, -1, 1).
FORMULA
From Paul Barry, May 10 2005: (Start)
G.f.: 1/((1+x)^2-x^3).
a(n) = Sum_{k=0..n+4} (-1)^(n-k-1)*C(n+3, k)*Sum_{j=0..floor(k/3)} C(k-2j, j). (End)
a(n) = (-1)^n * A077941(n). - G. C. Greubel, Jun 26 2019
MAPLE
A077990 := proc(n)
option remember ;
if n <=2 then
(-1)^n*(n+1) ;
else
-2*procname(n-1)-procname(n-2)+procname(n-3) ;
end if;
end proc:
seq(A077990(n), n=0..20) ; # R. J. Mathar, Feb 25 2024
MATHEMATICA
CoefficientList[Series[1/(1+2x+x^2-x^3), {x, 0, 50}], x] (* or *) LinearRecurrence[ {-2, -1, 1}, {1, -2, 3}, 50] (* Harvey P. Dale, Aug 10 2016 *)
PROG
(PARI) Vec(1/(1+2*x+x^2-x^3)+O(x^50)) \\ Charles R Greathouse IV, Sep 26 2012
(Magma) R<x>:=PowerSeriesRing(Integers(), 50); Coefficients(R!( 1/(1+2*x+x^2-x^3)) )); // G. C. Greubel, Jun 26 2019
(Sage) (1/(1+2*x+x^2-x^3)).series(x, 50).coefficients(x, sparse=False) # G. C. Greubel, Jun 26 2019
(GAP) a:=[1, -2, 3];; for n in [4..50] do a[n]:=-2*a[n-1]-a[n-2]+a[n-3]; od; a; # G. C. Greubel, Jun 26 2019
CROSSREFS
KEYWORD
sign,easy
AUTHOR
N. J. A. Sloane, Nov 17 2002
STATUS
approved