OFFSET
0,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..350
INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 630
FORMULA
E.g.f.: (1-x)/(1 - x - 3*x^2).
Recurrence: a(0)=1, a(1)=0, a(n) = n*a(n-1) + 3*n*(n-1)*a(n-2).
a(n) = (n!/13)*Sum_{alpha=RootOf(-1+Z+3*Z^2)} (-1 + 7*alpha)*alpha^(-1-n).
a(n) = n!*A052533(n). - R. J. Mathar, Nov 27 2011
MAPLE
spec := [S, {S=Sequence(Prod(Z, Sequence(Z), Union(Z, Z, Z)))}, labeled]: seq(combstruct[count](spec, size=n), n=0..20);
MATHEMATICA
With[{nn=20}, CoefficientList[Series[(1-x)/(1-x-3*x^2), {x, 0, nn}], x] Range[0, nn]!] (* Harvey P. Dale, Jul 15 2020 *)
a[n_]:= a[n]= If[n<2, 1-n, n*a[n-1] +3*n*(n-1)*a[n-2]];
Table[a[n], {n, 0, 40}] (* G. C. Greubel, Jun 04 2022 *)
PROG
(Magma) R<x>:=PowerSeriesRing(Rationals(), 30); Coefficients(R!(Laplace( (1-x)/(1-x-3*x^2) ))); // G. C. Greubel, Jun 04 2022
(SageMath) [factorial(n)*sum(binomial(n-k-1, n-2*k)*3^k for k in (0..n//2)) for n in (0..40)] # G. C. Greubel, Jun 04 2022
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
encyclopedia(AT)pommard.inria.fr, Jan 25 2000
STATUS
approved