OFFSET
0,3
COMMENTS
a(n) is the number of ways to partition [n] into blocks of size at most 3, order the blocks, order the elements within each block, and choose 1 element from each block.
E.g.: a(4) = 408 since we have the following cases:
1,2,3,4: 24 such orderings, 1 way to choose one element from each block;
12,34: 24 such orderings, 2*2 ways to choose one element from each block;
12,3,4: 72 such orderings, 2*1*1 ways to choose one element from each block;
123,4: 48 such orderings, 3*1 ways to choose one element from each block;
so 24*1 + 24*4 + 72*2 + 48*3 = 408 ways.
FORMULA
a(n) = n*(a(n-1)+(n-1)*(2*a(n-2)+(n-2)*3*a(n-3))) for n>=3. - Alois P. Heinz, Dec 14 2023
MAPLE
a:= proc(n) option remember; `if`(n=0, 1, add(
a(n-j)*binomial(n, j)*j!*j, j=1..min(3, n)))
end:
seq(a(n), n=0..19); # Alois P. Heinz, Dec 14 2023
MATHEMATICA
With[{m = 20}, Range[0, m]! * CoefficientList[Series[1/(1 - x - 2*x^2 - 3*x^3), {x, 0, m}], x]] (* Amiram Eldar, Oct 30 2023 *)
PROG
(PARI) my(x='x+O('x^25)); Vec(serlaplace(1/(1-x-2*x^2-3*x^3))) \\ Michel Marcus, Oct 30 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Enrique Navarrete, Oct 29 2023
STATUS
approved