%I #50 Sep 08 2022 08:46:00
%S 1,2,2,3,12,6,4,48,72,24,5,160,540,480,120,6,480,3240,5760,3600,720,7,
%T 1344,17010,53760,63000,30240,5040,8,3584,81648,430080,840000,725760,
%U 282240,40320,9,9216,367416,3096576,9450000,13063680,8890560,2903040,362880
%N Number of ways to form k labeled groups, each with a distinct leader, using n people. Triangle T(n,k) = n!*k^(n-k)/(n-k)! for 1 <= k <= n.
%C T(n,1)=n since there are n choices for the leader of the single group. Also, T(n,n)=n! since each of the n groups consist solely of a leader and there are n! ways to assign the n people to the n labeled groups.
%C In general, T(n,k) = n!*k^(n-k)/(n-k)! since there are n!/(n-k)! ways to assign leaders to the k labeled groups and there are k^(n-k) ways to map the remaining (n-k) people to the k groups.
%C T(n,k) is the number of functions of [n] to an arbitrary k-subset of [n], where each of the k target values is used at least once.
%C The number of ways to distribute n different toys among k girls and k boys to that each girl gets exactly one toy. - _Dennis P. Walsh_, Sep 10 2012
%H Joerg Arndt, <a href="/A199673/b199673.txt">Table of n, a(n) for n = 1..561</a>
%H George Kesidis, Takis Konstantopoulos, and Michael A. Zazanis, <a href="https://arxiv.org/abs/2104.08050">Age of information without service preemption</a>, arXiv:2104.08050 [cs.PF], 2021.
%H Dennis P. Walsh, <a href="http://frank.mtsu.edu/~dwalsh/GROUPCNT.pdf">Assigning people into labeled groups with leaders</a>
%H Dennis P. Walsh, <a href="http://frank.mtsu.edu/~dwalsh/TOYE2.pdf">Toy Story 2</a>
%F T(n,k) = n!*k^(n-k)/(n-k)! = k!*k^(n-k)*binomial(n,k) for 1 <= k <= n.
%F E.g.f.: (x*e^x)^k,for fixed k.
%F T(n,k1+k2) = Sum_{j=0..n} binomial(n,j)*T(j,k1)*T(n-j,k2).
%F T(n,1) = A000027(n);
%F T(n,2) = A001815(n);
%F T(n,3) = A052791(n);
%F Sum_{k=1..n} T(n,k) = A006153(n).
%F T(n,n) = A000142(n) = n!. - _Dennis P. Walsh_, Sep 10 2012
%e T(3,2)=12 since there are 12 ways to form group 1 and group 2, both with leaders, using people p1, p2, and p3, as illustrated below. The leader will be denoted Lj if person pj is designated the leader of the group.
%e Group 1 Group 2
%e {L1,p2} {L3}
%e {L1,p3} {L2}
%e {L1} {L2,p3}
%e {L1} {p2,L3}
%e {L2,p1} {L3}
%e {L2,p3} {L1}
%e {L2} {L1,p3}
%e {L2} {p1,L3}
%e {L3,p2} {L1}
%e {L3,p1} {L2}
%e {L3} {L1,p2}
%e {L3} {p1,L2}
%e First rows of triangle T(n,k):
%e 1;
%e 2, 2;
%e 3, 12, 6;
%e 4, 48, 72, 24;
%e 5, 160, 540, 480, 120;
%e 6, 480, 3240, 5760, 3600, 720;
%e 7, 1344, 17010, 53760, 63000, 30240, 5040;
%e 8, 3584, 81648, 430080, 840000, 725760, 282240, 40320;
%e 9, 9216, 367416, 3096576, 9450000, 13063680, 8890560, 2903040, 362880;
%p seq(seq(n!*k^(n-k)/(n-k)!, k=1..n), n=1..9);
%t nn = 10; a = y x Exp[x]; f[list_] := Select[list, # > 0 &]; Drop[Map[f, Range[0, nn]! CoefficientList[Series[1/(1 - a) , {x, 0, nn}], {x, y}]], 1] // Flatten (* _Geoffrey Critzer_, Jan 21 2012 *)
%o (Magma) [Factorial(n)*k^(n-k)/Factorial(n-k): k in [1..n], n in [1..9]]; // _Bruno Berselli_, Nov 09 2011
%o (PARI)
%o T(n,k)=n!*k^(n-k)/(n-k)!;
%o /* print triangle: */
%o for (n=1, 15, for (k=1,n, print1(T(n,k),", ")); print() );
%o /* _Joerg Arndt_, Sep 21 2012 */
%K nonn,easy,tabl
%O 1,2
%A _Dennis P. Walsh_, Nov 08 2011