%I #26 Sep 08 2022 08:44:59
%S 1,3,9,28,87,271,844,2629,8189,25508,79455,247495,770924,2401357,
%T 7480005,23299524,72575863,226067103,704178124,2193449749,6832393165,
%U 21282272996,66292312655,206494424631,643211040556,2003542920989
%N Expansion of (1-x)*(1+x)/(1-3*x-x^2+2*x^3).
%H Harvey P. Dale, <a href="/A052939/b052939.txt">Table of n, a(n) for n = 0..1000</a>
%H INRIA Algorithms Project, <a href="http://ecs.inria.fr/services/structure?nbr=930">Encyclopedia of Combinatorial Structures 930</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (3,1,-2).
%F G.f.: (1-x^2)/(1-3*x-x^2+2*x^3).
%F a(n) = 3*a(n-1) + a(n-2) - 2*a(n-3).
%F a(n) = Sum_{alpha=RootOf(1-3*z-z^2+2*z^3)} (1/229)*(66 +15*alpha -28*alpha^2)*alpha^(-1-n).
%p spec := [S,{S=Sequence(Union(Z,Z,Prod(Z,Sequence(Prod(Z,Z)))))},unlabeled ]: seq(combstruct[count ](spec,size=n), n=0..20);
%p seq(coeff(series((1-x^2)/(1-3*x-x^2+2*x^3), x, n+1), x, n), n = 0..30); # _G. C. Greubel_, Oct 18 2019
%t LinearRecurrence[{3,1,-2},{1,3,9},30] (* _Harvey P. Dale_, Aug 25 2019 *)
%o (PARI) my(x='x+O('x^30)); Vec((1-x^2)/(1-3*x-x^2+2*x^3)) \\ _G. C. Greubel_, Oct 18 2019
%o (Magma) R<x>:=PowerSeriesRing(Integers(), 30); Coefficients(R!( (1-x^2)/(1-3*x-x^2+2*x^3) )); // _G. C. Greubel_, Oct 18 2019
%o (Sage)
%o def A052939_list(prec):
%o P.<x> = PowerSeriesRing(ZZ, prec)
%o return P((1-x^2)/(1-3*x-x^2+2*x^3)).list()
%o A052939_list(30) # _G. C. Greubel_, Oct 18 2019
%o (GAP) a:=[1,3,9];; for n in [4..30] do a[n]:=3*a[n-1]+a[n-2]-2*a[n-3]; od; a; # _G. C. Greubel_, Oct 18 2019
%K easy,nonn
%O 0,2
%A encyclopedia(AT)pommard.inria.fr, Jan 25 2000
%E More terms from _James A. Sellers_, Jun 06 2000
|