OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..444
EXAMPLE
a(3) = 13: 3abc, 2ab1c, 2ac1b, 2bc1a, 1a2bc, 1b2ac, 1c2ab, 1a1b1c, 1a1c1b, 1b1a1c, 1b1c1a, 1c1a1b, 1c1b1a.
MAPLE
b:= proc(n, i, p) option remember; `if`(n=0, p!, `if`(i<1, 0,
add(b(n-i*j, i-1, p+j)*binomial(n, i*j), j=0..n/i)))
end:
a:= n-> b(n$2, 0):
seq(a(n), n=0..23);
MATHEMATICA
b[n_, i_, p_] := b[n, i, p] = If[n == 0, p!, If[i < 1, 0,
Sum[b[n - i*j, i - 1, p + j]*Binomial[n, i*j], {j, 0, n/i}]]];
a[n_] := b[n, n, 0];
Table[a[n], {n, 0, 23}] (* Jean-François Alcover, Aug 01 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Sep 21 2019
STATUS
approved