login
Expansion of e.g.f. 1/(1-2*x-x^2).
3

%I #22 Sep 08 2022 08:44:59

%S 1,2,10,72,696,8400,121680,2056320,39715200,862928640,20832940800,

%T 553246848000,16027872537600,503031194265600,17001946241280000,

%U 615694938034176000,23782705115000832000,976080997055324160000

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

%H G. C. Greubel, <a href="/A052555/b052555.txt">Table of n, a(n) for n = 0..390</a>

%H INRIA Algorithms Project, <a href="http://ecs.inria.fr/services/structure?nbr=496">Encyclopedia of Combinatorial Structures 496</a>

%F E.g.f.: 1/(1 - 2*x - x^2).

%F a(n) = 2*n*a(n-1) + n*(n-1)*a(n-2), with a(0)=1, a(1)=2.

%F a(n) = Sum(1/4*(1+_alpha)*_alpha^(-1-n), _alpha=RootOf(-1+2*_Z+_Z^2))*n!

%F a(n) = n!*A000129(n+1). - _R. J. Mathar_, Nov 27 2011

%p spec := [S,{S=Sequence(Union(Z,Z,Prod(Z,Z)))},labeled]: seq(combstruct[count](spec,size=n), n=0..20);

%p with(combstruct):ZL:=[T,{T=Union(Z,Prod(Epsilon,Z,T),Prod(T,Z,Epsilon),Prod(T,Z,Z))},labeled]:seq(count(ZL,size=i)/i,i=1..18); # _Zerinvary Lajos_, Dec 16 2007

%t With[{m = 20}, CoefficientList[Series[1/(1-2*x-x^2), {x,0,m}], x]* Range[0, m]!] (* _G. C. Greubel_, May 07 2019 *)

%o (PARI) my(x='x+O('x^20)); Vec(serlaplace( 1/(1-2*x-x^2) )) \\ _G. C. Greubel_, May 07 2019

%o (Magma) m:=20; R<x>:=PowerSeriesRing(Rationals(), m); b:=Coefficients(R!( 1/(1-2*x-x^2) )); [Factorial(n-1)*b[n]: n in [1..m]]; // _G. C. Greubel_, May 07 2019

%o (Sage) m = 20; T = taylor(1/(1-2*x-x^2), x, 0, m); [factorial(n)*T.coefficient(x, n) for n in (0..m)] # _G. C. Greubel_, May 07 2019

%o (GAP) a:=[2,10];; for n in [3..20] do a[n]:=2*n*a[n-1]+n*(n-1)*a[n-2]; od; Concatenation([1], a); # _G. C. Greubel_, May 07 2019

%K easy,nonn

%O 0,2

%A encyclopedia(AT)pommard.inria.fr, Jan 25 2000