reviewed
approved
reviewed
approved
proposed
reviewed
editing
proposed
multinomial[n_, k_List] := n!/Times @@ (k!);
Unprotect[Power]; 0^0 = 1; Protect[Power];
b[n_, i_, k_] := b[n, i, k] = If[n == 0, 1, If[i < 1, 0, Sum[multinomial[n, Join[{n - i*j}, Table[i, {j}]]]/j!*b[n - i*j, i-1, k]*(i-1)!^j, {j, 0, If[Mod[k, i] == 0, n/i, 0]}]]];
A[n_, k_] := Sum[b[j, Min[k, j], k]*n^(n-j)*Binomial[n-1, j-1], {j, 0, n}];
Table[Table[A[n, d-n], {n, 0, d}], {d, 0, 12}] // Flatten (* Jean-François Alcover, Nov 22 2023, from 2nd Maple program *)
approved
editing
proposed
approved
editing
proposed
egf[k_] := Exp[Sum[(-ProductLog[-x])^d/d, {d, Divisors[k]}]];
A[1, 0] = 0; A[0, _] = 1; A[1, _] = 1; A[_, 0] = 0;
A[n_, k_] := n!*SeriesCoefficient[egf[k], {x, 0, n}];
egf[k_] := Exp[Sum[(-ProductLog[-x])^d/d, {d, Divisors[k]}]]; A[1, 0] = 0; A[0, _] = 1; A[1, _] = 1; A[_, 0] = 0; A[n_, k_] := n!*SeriesCoefficient[egf[k], {x, 0, n}]; Table[Table[A[n, d-n], {n, 0, d}], {d, 0, 10}] // Flatten (* Jean-François Alcover, Dec 04 2014, translated from first Maple program *)
approved
editing
editing
approved
1, 1, 1, 1, 1, 1, 1, ...
0, 1, 1, 1, 1, 1, 1, ...
0, 3, 4, 3, 4, 3, 4, ...
0, 16, 25, 18, 25, 16, 27, ...
0, 125, 218, 157, 224, 125, 250, ...
0, 1296, 2451, 1776, 2601, 1320, 2951, ...
0, 16807, 33832, 24687, 37072, 17671, 42552, ...
approved
editing
proposed
approved