A052641 Expansion of e.g.f. (1-x)/(1-3*x-x^2+x^3).
1, 2, 14, 132, 1704, 27360, 527760, 11874240, 305343360, 8833224960, 283928198400, 10038995366400, 387222498432000, 16180539927552000, 728132005791590400, 35106736224688128000, 1805508406018437120000
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..375
- INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 587
Crossrefs
Cf. A030186.
Programs
-
GAP
a:=[1,2,14];; for n in [4..30] do a[n]:=3*(n-1)*a[n-1]+(n-1)*(n-2)*a[n-2]-(n-1)*(6-5*n+n^2)*a[n-3]; od; a; # G. C. Greubel, Oct 28 2019
-
Magma
m:=20; R
:=PowerSeriesRing(Rationals(), m); b:=Coefficients(R!( (1-x)/(1-3*x-x^2+x^3) )); [Factorial(n-1)*b[n]: n in [1..m]]; // G. C. Greubel, Oct 28 2019 -
Maple
spec:= [S,{S=Sequence(Prod(Z,Union(Z,Sequence(Z),Sequence(Z))))}, labeled]: seq(combstruct[count](spec,size=n), n=0..20); seq(coeff(series((1-x)/(1-3*x-x^2+x^3), x, n+1)*n!, x, n), n = 0..20); # G. C. Greubel, Oct 28 2019
-
Mathematica
With[{nn=20},CoefficientList[Series[(1-x)/(1-3x-x^2+x^3),{x,0,nn}],x] Range[0,nn]!] (* Harvey P. Dale, Aug 26 2017 *)
-
PARI
my(x='x+O('x^20)); Vec(serlaplace( (1-x)/(1-3*x-x^2+x^3) )) \\ G. C. Greubel, Oct 28 2019
-
Sage
[factorial(n)*( (1-x)/(1-3*x-x^2+x^3) ).series(x,n+1).list()[n] for n in (0..20)] # G. C. Greubel, Oct 28 2019
Formula
E.g.f.: (1-x)/(1-3*x-x^2+x^3).
a(n+3) = 3*(n+3)*a(n+2) + (6+5*n+n^2)*a(n+1) - (6+11*n+6*n^2+n^3)*a(n).
a(n) = n! * Sum_{alpha=RootOf(1-3*z-z^2+z^3)} (1/74)*(11 + 16*_alpha - 7*alpha^2)*alpha^(-1-n).
a(n) = n!*A030186(n). - R. J. Mathar, Nov 27 2011