A077983 Expansion of 1/(1 + 2*x - 2*x^2 + x^3).
1, -2, 6, -17, 48, -136, 385, -1090, 3086, -8737, 24736, -70032, 198273, -561346, 1589270, -4499505, 12738896, -36066072, 102109441, -289089922, 818464798, -2317218881, 6560457280, -18573817120, 52585767681, -148879626882, 421504606246, -1193354233937, 3378597307248
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (-2,2,-1).
Programs
-
GAP
a:=[1,-2,6];; for n in [4..30] do a[n]:=-2*a[n-1]+2*a[n-2]-a[n-3]; od; a; # G. C. Greubel, Jun 25 2019
-
Magma
R
:=PowerSeriesRing(Integers(), 30); Coefficients(R!( 1/(1+2*x-2*x^2+x^3) )); // G. C. Greubel, Jun 25 2019 -
Mathematica
LinearRecurrence[{-2,2,-1}, {1,-2,6}, 30] (* or *) CoefficientList[ Series[1/(1+2*x-2*x^2+x^3), {x,0,30}], x] (* G. C. Greubel, Jun 25 2019 *)
-
PARI
my(x='x+O('x^30)); Vec(1/(1+2*x-2*x^2+x^3)) \\ G. C. Greubel, Jun 25 2019
-
Sage
(1/(1+2*x-2*x^2+x^3)).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Jun 25 2019
Formula
a(n) = (-1)^n * A077936(n). - Ivan Neretin, Jul 05 2015
a(n) = -2*a(n-1) + 2*a(n-2) - a(n-3) with a(0) = 1, a(1) = -2, a(2) = 6. - Taras Goy, Aug 04 2017