OFFSET
0,5
LINKS
Moa Apagodu, David Applegate, N. J. A. Sloane, and Doron Zeilberger, Analysis of the Gift Exchange Problem, arXiv:1701.08394, 2017.
David Applegate and N. J. A. Sloane, The Gift Exchange Problem (arXiv:0907.0513, 2009)
EXAMPLE
Array begins:
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
1, 2, 7, 37, 266, 2431, 27007, 353522, 5329837, ...
1, 3, 31, 842, 45296, 4061871, 546809243, 103123135501, ...
1, 4, 121, 18252, 7958726, 7528988476, 13130817809439, ...
1, 5, 456, 405408, 1495388159, 15467641899285, 361207016885536095, ...
1, 6, 1709, 9268549, 295887993624, 34155922905682979, 10893033763705794846727, ...
...
MAPLE
b := proc(n, i, k) local r;
option remember;
if n = i then 1;
elif i < n then 0;
elif n < 1 then 0;
else add( binomial(i-1, r)*b(n-1, i-1-r, k), r=0..k);
end if;
end proc;
T:=proc(n, k); add(b(n, i, k), i=0..(k+1)*n); end proc;
MATHEMATICA
multinomial[n_, k_List] := n!/Times @@ (k!); t[n_, k_] := Module[{i, ik}, ik = Array[i, k]; 1/k!* Sum[multinomial[Total[ik], ik], Evaluate[Sequence @@ Thread[{ik, 1, n}]]]]; Table[t[n-k, k], {n, 1, 10}, {k, 0, n-1}] // Flatten (* Jean-François Alcover, Jan 14 2014 *)
KEYWORD
nonn,tabl
AUTHOR
David Applegate and N. J. A. Sloane, Dec 15 2008, Dec 21 2008
STATUS
approved