login
Number T(n,k) of endofunctions on [n] such that the minimal cardinality of the nonempty preimages equals k; triangle T(n,k), n>=0, 0<=k<=n, read by rows.
4

%I #25 Dec 16 2021 16:49:29

%S 1,0,1,0,2,2,0,24,0,3,0,216,36,0,4,0,2920,200,0,0,5,0,44100,2250,300,

%T 0,0,6,0,799134,22932,1470,0,0,0,7,0,16429504,342608,3136,1960,0,0,0,

%U 8,0,382625856,4638384,147168,9072,0,0,0,0,9,0,9918836100,79610850,1522800,18900,11340,0,0,0,0,10

%N Number T(n,k) of endofunctions on [n] such that the minimal cardinality of the nonempty preimages equals 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="/A245687/b245687.txt">Rows n = 0..100, flattened</a>

%e Triangle T(n,k) begins:

%e 1;

%e 0, 1;

%e 0, 2, 2;

%e 0, 24, 0, 3;

%e 0, 216, 36, 0, 4;

%e 0, 2920, 200, 0, 0, 5;

%e 0, 44100, 2250, 300, 0, 0, 6;

%e 0, 799134, 22932, 1470, 0, 0, 0, 7;

%e 0, 16429504, 342608, 3136, 1960, 0, 0, 0, 8;

%e ...

%p b:= proc(n, i, k) option remember; `if`(n=0, 1, `if`(i<1, 0,

%p b(n, i-1, k) +add(b(n-j, i-1, k)/j!, j=k..n)))

%p end:

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

%p `if`(k>=(n+1)/2, 0, n!*(b(n$2, k)-b(n$2, k+1))))):

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

%t b[n_, i_, k_] := b[n, i, k] = If[n == 0, 1, If[i<1, 0, b[n, i-1, k] + Sum[b[n-j, i-1, k]/j!, {j, k, n}]]]; T[n_, k_] := If[k == 0, If[n == 0, 1, 0], If[k == n, n, If[k >= (n+1)/2, 0, n!*(b[n, n, k] - b[n, n, k+1])]]]; Table[Table[T[n, k], {k, 0, n}], {n, 0, 12}] // Flatten (* _Jean-François Alcover_, Feb 02 2015, after _Alois P. Heinz_ *)

%Y T(n,1) = n*A241581(n) for n>0.

%Y Rows sums give A000312.

%Y Main diagonal gives A028310.

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

%Y Cf. A019575 (the same for maximal cardinality).

%K nonn,tabl

%O 0,5

%A _Alois P. Heinz_, Jul 29 2014