OFFSET
0,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..350
INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 638
FORMULA
E.g.f.: x*(1 + x - 3*x^2)/(1 - 3*x).
Recurrence: a(0)=0, a(1)=1, a(2)=8, a(n) = 3*n*a(n-1).
a(n) = 3^(n-1)*n!, n>2.
G.f.: -1/3 + 2*x^2 + Hypergeometric2F0([1,1], [], 3*x). - G. C. Greubel, Jun 02 2022
MAPLE
spec := [S, {S=Prod(Z, Union(Z, Sequence(Union(Z, Z, Z))))}, labeled]: seq(combstruct[count](spec, size=n), n=0..20);
MATHEMATICA
With[{nn=20}, CoefficientList[Series[x (1+x-3x^2)/(1-3x), {x, 0, nn}], x] Range[0, nn]!] (* Harvey P. Dale, May 05 2018 *)
PROG
(Magma) R<x>:=PowerSeriesRing(Rationals(), 30); [0] cat Coefficients(R!(Laplace( x*(1+x-3*x^2)/(1-3*x) ))); // G. C. Greubel, Jun 02 2022
(SageMath) [3^(n-1)*factorial(n) -bool(n==0)/3 +2*bool(n==2) for n in (0..30)] # G. C. Greubel, Jun 02 2022
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
encyclopedia(AT)pommard.inria.fr, Jan 25 2000
STATUS
approved