login
Number T(n,k) of endofunctions on [n] with all cycles of length k; triangle T(n,k), n>=0, 0<=k<=n, read by rows.
8

%I #28 Dec 16 2021 16:47:48

%S 1,0,1,0,3,1,0,16,6,2,0,125,51,24,6,0,1296,560,300,120,24,0,16807,

%T 7575,4360,2160,720,120,0,262144,122052,73710,41160,17640,5040,720,0,

%U 4782969,2285353,1430016,861420,430080,161280,40320,5040

%N Number T(n,k) of endofunctions on [n] with all cycles of length k; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

%C T(0,0) = 1 by convention.

%H Alois P. Heinz, <a href="/A243098/b243098.txt">Rows n = 0..140, flattened</a>

%F E.g.f. of column k>0: exp((-LambertW(-x))^k/k), e.g.f. of column k=0: 1.

%e Triangle T(n,k) begins:

%e 1;

%e 0, 1;

%e 0, 3, 1;

%e 0, 16, 6, 2;

%e 0, 125, 51, 24, 6;

%e 0, 1296, 560, 300, 120, 24;

%e 0, 16807, 7575, 4360, 2160, 720, 120;

%e 0, 262144, 122052, 73710, 41160, 17640, 5040, 720;

%e ...

%p with(combinat):

%p T:= (n, k)-> `if`(k*n=0, `if`(k+n=0, 1, 0),

%p add(binomial(n-1, j*k-1)*n^(n-j*k)*(k-1)!^j*

%p multinomial(j*k, k$j, 0)/j!, j=0..n/k)):

%p seq(seq(T(n, k), k=0..n), n=0..10);

%t multinomial[n_, k_] := n!/Times @@ (k!); T[n_, k_] := If[k*n==0, If[k+n == 0, 1, 0], Sum[Binomial[n-1, j*k-1]*n^(n-j*k)*(k-1)!^j*multinomial[j*k, Append[Array[k&, j], 0]]/j!, {j, 0, n/k}]]; Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* _Jean-François Alcover_, Feb 19 2017, translated from Maple *)

%Y Columns k=0-4 give: A000007, A000272(n+1) for n>0, A057817(n+1), 2*A060917, 6*A060918.

%Y Row sums give A241980.

%Y T(2n,n) gives A246050.

%Y Main diagonal gives A000142(n-1) for n>0.

%Y Cf. A241981, A246049.

%K nonn,tabl

%O 0,5

%A _Alois P. Heinz_, Aug 18 2014