OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..400
EXAMPLE
a(3) = 19: 3a|b|c, 3a|c|b, 3b|a|c, 3b|c|a, 3c|a|b, 3c|b|a, 2a|b1c, 2b|a1c, 2a|c1b, 2c|a1b, 2b|c1a, 2c|b1a, 1a2b|c, 1a2c|b, 1b2a|c, 1b2c|a, 1c2a|b, 1c2b|a, 111abc.
MAPLE
with(combinat):
b:= proc(n, i, p) option remember; `if`(n=0, p!, `if`(i<1, 0, add(
b(n-i*j, i-1, p+j)/j!*multinomial(n, n-i*j, j$i), j=0..n/i)))
end:
a:= n-> b(n$2, 0):
seq(a(n), n=0..25);
MATHEMATICA
multinomial[n_, k_List] := n!/Times @@ (k!);
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]/j!*multinomial[n, Join[{n - i*j}, Table[j, {i}]]], {j, 0, n/i}]]];
a[n_] := b[n, n, 0];
Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Mar 04 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Aug 31 2015
STATUS
approved