login
A077986
Expansion of 1/(1 + 2*x - x^2 + x^3).
3
1, -2, 5, -13, 33, -84, 214, -545, 1388, -3535, 9003, -22929, 58396, -148724, 378773, -964666, 2456829, -6257097, 15935689, -40585304, 103363394, -263247781, 670444260, -1707499695, 4348691431, -11075326817, 28206844760, -71837707768, 182957587113, -465959726754
OFFSET
0,2
FORMULA
a(n) = (-1)^n * A077939(n). - Joerg Arndt, Sep 30 2012
a(n) = -2*a(n-1) + a(n-2) - a(n-3), with a(0)=1, a(1)=-2, a(2)=5. - Harvey P. Dale, Feb 14 2014
MAPLE
m:=30; S:=series(1/(1+2*x-x^2+x^3), x, m+1): seq(coeff(S, x, j), j=0..m); # G. C. Greubel, Feb 26 2020
MATHEMATICA
CoefficientList[Series[1/(1+2x-x^2+x^3), {x, 0, 30}], x] (* or *) LinearRecurrence[ {-2, 1, -1}, {1, -2, 5}, 30] (* Harvey P. Dale, Feb 14 2014 *)
b[n_]:= b[n]= If[n<3, n, 2*b[n-1] +b[n-2] +b[n-3]]; Table[(-1)^n*b[n+1], {n, 0, 30}] (* Rigoberto Florez, Jan 23 2020 *)
PROG
(PARI) Vec(1/(1+2*x-x^2+x^3)+O(x^30)) \\ Charles R Greathouse IV, Sep 26 2012
(Magma) R<x>:=PowerSeriesRing(Integers(), 30); Coefficients(R!( 1/(1+2*x-x^2+x^3) )); // G. C. Greubel, Jun 25 2019
(Sage)
def A077986_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return ( 1/(1+2*x-x^2+x^3) ).list()
A077986_list(30) # G. C. Greubel, Jun 25 2019
(GAP) a:=[1, -2, 5];; for n in [4..30] do a[n]:=-2*a[n-1]+a[n-2]-a[n-3]; od; a; # G. C. Greubel, Jun 25 2019
CROSSREFS
Cf. A077939.
Sequence in context: A120925 A086588 A077939 * A007020 A080888 A052988
KEYWORD
sign,easy
AUTHOR
N. J. A. Sloane, Nov 17 2002
STATUS
approved