login
A077990
Expansion of 1/(1+2*x+x^2-x^3).
4
1, -2, 3, -3, 1, 4, -12, 21, -26, 19, 9, -63, 136, -200, 201, -66, -269, 805, -1407, 1740, -1268, -611, 4230, -9117, 13393, -13439, 4368, 18096, -53999, 94270, -116445, 84621, 41473, -284012, 611172, -896859, 898534, -289037, -1217319, 3622209, -6316136, 7792744, -5647143, -2814594
OFFSET
0,2
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
Cf. A077941.
Sequence in context: A323942 A323944 A077941 * A085667 A220114 A334362
KEYWORD
sign,easy
AUTHOR
N. J. A. Sloane, Nov 17 2002
STATUS
approved