login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Expansion of 1/(1 + 2*x - x^2 + x^3).
3

%I #31 Sep 08 2022 08:45:08

%S 1,-2,5,-13,33,-84,214,-545,1388,-3535,9003,-22929,58396,-148724,

%T 378773,-964666,2456829,-6257097,15935689,-40585304,103363394,

%U -263247781,670444260,-1707499695,4348691431,-11075326817,28206844760,-71837707768,182957587113,-465959726754

%N Expansion of 1/(1 + 2*x - x^2 + x^3).

%H G. C. Greubel, <a href="/A077986/b077986.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (-2,1,-1).

%F a(n) = (-1)^n * A077939(n). - _Joerg Arndt_, Sep 30 2012

%F 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

%p 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

%t 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 *)

%t 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 *)

%o (PARI) Vec(1/(1+2*x-x^2+x^3)+O(x^30)) \\ _Charles R Greathouse IV_, Sep 26 2012

%o (Magma) R<x>:=PowerSeriesRing(Integers(), 30); Coefficients(R!( 1/(1+2*x-x^2+x^3) )); // _G. C. Greubel_, Jun 25 2019

%o (Sage)

%o def A077986_list(prec):

%o P.<x> = PowerSeriesRing(ZZ, prec)

%o return ( 1/(1+2*x-x^2+x^3) ).list()

%o A077986_list(30) # _G. C. Greubel_, Jun 25 2019

%o (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

%Y Cf. A077939.

%K sign,easy

%O 0,2

%A _N. J. A. Sloane_, Nov 17 2002