login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

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

%I #29 Sep 08 2022 08:45:28

%S 0,1,1,6,19,73,264,973,3565,13086,48007,176149,646296,2371321,8700553,

%T 31923030,117128107,429752305,1576795176,5785386229,21227039605,

%U 77883687150,285761407807,1048481205661,3846960466104,14114802199681,51788325586033

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

%D Chang and Sederberg, Over and Over Again, MAA, 1997, Chapter 30

%H Colin Barker, <a href="/A123950/b123950.txt">Table of n, a(n) for n = 1..1000</a>

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

%F a(n) = 3*a(n-1) + 3*a(n-2) - 2*a(n-3).

%F a(n) = A100191(n-2) for n > 2. - _Georg Fischer_, Oct 21 2018

%p seq(coeff(series(x^2*(1-2*x)/(1-3*x-3*x^2+2*x^3),x,n+1), x, n), n = 1 .. 30); # _Muniru A Asiru_, Oct 21 2018

%t M = {{0,0,1}, {0,2,-2}, {1,-2,1}}; v[1] = {0,0,1}; v[n_]:=v[n]=M.v[n-1]; Table[v[n][[1]], {n, 30}]

%t CoefficientList[Series[x^2*(1-2*x)/(1-3*x-3*x^2+2*x^3), {x, 0, 30}], x] (* _G. C. Greubel_, Aug 05 2019 *)

%o (PARI) concat(0, Vec(-x^2*(2*x-1)/(2*x^3-3*x^2-3*x+1)+O(x^130))) \\ _Colin Barker_, Feb 10 2015

%o (PARI) a(n)=([0,1,0; 0,0,1; -2,3,3]^(n-1)*[0;1;1])[1,1] \\ _Charles R Greathouse IV_, Jun 24 2015

%o (GAP) a:=[0,1,1];; for n in [4..30] do a[n]:=3*a[n-1]+3*a[n-2]-2*a[n-3]; od; a; # _Muniru A Asiru_, Oct 21 2018

%o (Magma) R<x>:=PowerSeriesRing(Integers(), 30); [0] cat Coefficients(R!( x^2*(1-2*x)/(1-3*x-3*x^2+2*x^3) )); // _G. C. Greubel_, Aug 05 2019

%o (Sage) a=(x^2*(1-2*x)/(1-3*x-3*x^2+2*x^3)).series(x, 30).coefficients(x, sparse=False); a[1:] # _G. C. Greubel_, Aug 05 2019

%Y Cf. A100191.

%K nonn,easy,less

%O 1,4

%A _Roger L. Bagula_ and _Gary W. Adamson_, Oct 26 2006

%E Definition replaced with the generating function by the Assoc. Eds. of the OEIS, Mar 28 2010