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-2*x^3).
2

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

%S 1,-2,3,-2,-3,14,-29,38,-19,-58,211,-402,477,-130,-1021,3126,-5491,

%T 5814,115,-17026,45565,-73874,68131,28742,-273363,654246,-977645,

%U 754318,777501,-4264610,9260355,-12701098,7612621,15996566,-65007949,129244574,-161488067,63715662,292545891

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

%H G. C. Greubel, <a href="/A077989/b077989.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,2).

%F a(n) = (-1)^n * A077942(n). - _G. C. Greubel_, Jun 26 2019

%F a(n) = (-1)^n*Sum_{k=0..(n+1)/2} binomial(n+1-k,2k+1)*(-2)^k, n>=0. - _Taras Goy_, Apr 15 2020

%t LinearRecurrence[{-2,-1,2}, {1,-2,3}, 40] (* or *) CoefficientList[Series[1/(1+2*x+x^2-2*x^3), {x,0,40}], x] (* _G. C. Greubel_, Jun 26 2019 *)

%o (PARI) my(x='x+O('x^40)); Vec(1/(1+2*x+x^2-2*x^3)) \\ _G. C. Greubel_, Jun 26 2019

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

%o (Sage) (1/(1+2*x+x^2-2*x^3)).series(x, 40).coefficients(x, sparse=False) # _G. C. Greubel_, Jun 26 2019

%o (GAP) a:=[1,-2,3];; for n in [4..40] do a[n]:=-2*a[n-1]-a[n-2]+2*a[n-3]; od; a; # _G. C. Greubel_, Jun 26 2019

%Y Cf. A077942.

%K sign,easy

%O 0,2

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