OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..375
INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 616
FORMULA
E.g.f.: 1/(1-3*x-x^3).
a(n) = 3*n*a(n-1) + n*(n-1)*(n-2)*a(n-3), a(0)=1, a(1)=3, a(2)=18.
a(n) = (n!/15) * Sum_{alpha=RootOf(-1+3*_Z+_Z^3)} (4 + alpha + 2*alpha^2) * alpha^(-1-n).
a(n) = n!*A052541(n). - R. J. Mathar, Nov 27 2011
MAPLE
spec := [S, {S=Sequence(Union(Z, Z, Z, Prod(Z, Z, Z)))}, labeled]: seq(combstruct[count](spec, size=n), n=0..20);
MATHEMATICA
a[n_]:= a[n]= If[n<3, 3^n*n!, 3*n*a[n-1] + n*(n-1)*(n-2)*a[n-3]];
Table[a[n], {n, 0, 40}] (* G. C. Greubel, Sep 03 2022 *)
PROG
(Magma) R<x>:=PowerSeriesRing(Rationals(), 40); Coefficients(R!(Laplace( 1/(1-3*x-x^3) ))); // G. C. Greubel, Sep 03 2022
(SageMath)
def A052668_list(prec):
P.<x> = PowerSeriesRing(QQ, prec)
return P( 1/(1-3*x-x^3) ).egf_to_ogf().list()
A052668_list(40) # G. C. Greubel, Sep 03 2022
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
encyclopedia(AT)pommard.inria.fr, Jan 25 2000
STATUS
approved