login
Expansion of (1 - x + x^2)^2 / (1 - x)^3 in powers of x.
2

%I #20 Sep 08 2022 08:46:07

%S 1,1,3,5,8,12,17,23,30,38,47,57,68,80,93,107,122,138,155,173,192,212,

%T 233,255,278,302,327,353,380,408,437,467,498,530,563,597,632,668,705,

%U 743,782,822,863,905,948,992,1037,1083,1130,1178,1227,1277,1328,1380

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

%C Essentially the same as A152948, A133263 and A089071. - _R. J. Mathar_, Mar 30 2014

%H G. C. Greubel, <a href="/A238531/b238531.txt">Table of n, a(n) for n = 0..2500</a>

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

%F Euler transform of length 6 sequence [1, 2, 2, 0, 0, -2].

%F Binomial transform of [1, 0, 2, -2, 3, -4, 5, -6, ...].

%F a(n) = p(-1) where p(x) is the unique degree-n polynomial such that p(k) = a(k) for k = 0, 1, ..., n.

%F G.f.: (1 - x + x^2)^2 / (1 - x)^3.

%F a(n) = a(1 - n) for all n in Z.

%F a(n + 1) = A133263(n) if n>=0. a(n) = (n^2 - n) / 2 + 2 unless n=0 or n=1.

%F (1 + x^2 + x^3 + x^4 + ...)*(1 + x + 2x^2 + 3x^3 + 4x^4 + ...) = (1 + x + 3x^2 + 5x^3 + 8x^4 + 12x^5 + ...). - _Gary W. Adamson_, Jul 27 2010

%e G.f. = 1 + x + 3*x^2 + 5*x^3 + 8*x^4 + 12*x^5 + 17*x^6 + 23*x^7 + 30*x^8 + ...

%t a[ n_] := (n^2 - n) / 2 + If[ n == 0 || n == 1, 1, 2];

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

%o (PARI) {a(n) = (n^2 - n) / 2 + 2 - (n==0) - (n==1)};

%o (PARI) {a(n) = if( n<0, n = 1-n); polcoeff( (1 - x + x^2)^2 / (1 - x)^3 + x * O(x^n), n)};

%o (Magma) m:=50; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((1-x+x^2)^2/(1-x)^3)); // _G. C. Greubel_, Aug 07 2018

%Y Cf. A133263.

%K nonn,easy

%O 0,3

%A _Michael Somos_, Feb 28 2014