%I #49 Nov 16 2023 07:43:32
%S 1,1,1,6,1,20,1,50,90,1,112,630,1,238,2940,2520,1,492,11508,30240,1,
%T 1002,40950,226800,113400,1,2024,137610,1367520,2079000,1,4070,445896,
%U 7271880,22869000,7484400,1,8164,1410552,35692800,196396200,194594400,1,16354
%N The number of ways of putting n labeled items into k labeled boxes so that each box receives at least 2 objects.
%C Equivalently, the number of ordered set partitions of the set [n] into k blocks of size at least two. When the boxes are unlabeled or the set partitions unordered we obtain A008299.
%C The number of doubly-surjective functions f:[n]->[k], where a doubly-surjective function f has pre-image sets of size at least 2 for each element of the codomain. Also, the number of ways to distribute n different toys to k different children so that each child gets at least two toys. - _Dennis P. Walsh_, Apr 09 2013
%C T(n,k) is the number of chains 0 = x_0 < x_1 < ... < x_k = 1 in the Boolean lattice of rank n, such that x_i is not covered by x_(i+1) for all i. - _Geoffrey Critzer_, Jul 15 2018
%D P. Flajolet and R. Sedgewick, Analytic Combinatorics, Cambridge University Press, 2009, page 100-109.
%H Muniru A Asiru, <a href="/A200091/b200091.txt">Table of n, a(n) for n = 2..626</a>
%H Marko R. Riedel, <a href="https://math.stackexchange.com/questions/4411396/">Count by PIE and symbolic combinatorics</a>, Math Stackexchange, March 2022.
%H Dennis Walsh, <a href="http://capone.mtsu.edu/dwalsh/DOUBSURJ.pdf">Notes on doubly-surjective finite functions</a>
%F E.g.f. with additional 1: 1/(1-t*(exp(x)-1-x)) = 1 + t*x^2/2! + t*x^3/3! + (t+6*t^2)*x^4/4! + ....
%F E.g.f. (k fixed): (exp(x)-x-1)^k. - _Dennis P. Walsh_, Apr 09 2013
%F Recurrence relation: T(n+1,k) = k*(T(n,k) + n*T(n-1,k-1)). T(n,k) = k!*A008299(n,k).
%F T(n,k+j) = Sum_{i=0..n} C(n,i)*T(i,k)*T(n-i,j). - _Dennis P. Walsh_, Apr 09 2013
%F T(n,k) = Sum_{j=0..k} (-1)^j*C(k,j)*(Sum_{i=0..j} C(j,i)*C(n,i)*i!*(k-j)^(n-i)) for 1 <= k <= n/2 and n >= 2. - _Dennis P. Walsh_, Apr 10 2013
%F T(n,k) = k!*Sum_{r=0..min(n,k)} binomial(n,r)*(-1)^r*Stirling2(n-r, k-r). - _Marko Riedel_, Mar 25, 2022
%e Table begins
%e n |k=1 2 3 4
%e ----+-------------------
%e 2 | 1
%e 3 | 1
%e 4 | 1 6
%e 5 | 1 20
%e 6 | 1 50 90
%e 7 | 1 112 630
%e 8 | 1 238 2940 2520
%e 9 | 1 492 11508 30240
%e ...
%e T(4,2) = 6: The arrangements of 4 objects into 2 boxes { } and [ ] so that each box contains at least 2 items are {1,2}[3,4], {1,3}[2,4], {2,3}[1,4] and the 3 other possibilities where the contents of a pair of boxes are swapped.
%p seq(seq(eval(diff((exp(x)-x-1)^k,x$n),x=0),k=1..floor(n/2)),n=2..20); # _Dennis P. Walsh_, Apr 09 2013
%p T := proc(n,k) local r; k!* add(binomial(n,r)*(-1)^r*Stirling2(n-r,k-r), r=0..min(n,k)); end; # _Marko Riedel_, Mar 25, 2022
%t t[n_, k_] := k! * Sum[ (-1)^i*Binomial[n, i] * Sum[ (-1)^j*(k - i - j)^(n - i) / (j!*(k - i - j)!), {j, 0, k - i}], {i, 0, k}]; Table[ t[n, k], {n, 2, 14}, {k, 1, n/2}] // Flatten (* _Jean-François Alcover_, Apr 10 2013 *)
%o (GAP) Flat(List([2..14],n->List([1..Int(n/2)],k->Sum([0..k],j->(-1)^j*Binomial(k,j)*(Sum([0..j],i->Binomial(j,i)*(Binomial(n,i)*Factorial(i)*(k-j)^(n-i)))))))); # _Muniru A Asiru_, Jul 17 2018
%Y T(n,2) = A052515(n), T(n,3) = A224541(n), T(n,4) = A224542(n).
%Y Cf. A032032 (row sums).
%Y Cf. A008299, A019538, A200092.
%K nonn,easy,tabf
%O 2,4
%A _Peter Bala_, Dec 04 2011