%I #24 Dec 29 2018 20:50:16
%S 1,1,1,1,1,0,3,1,1,0,0,4,3,6,1,1,0,0,0,5,0,10,10,15,10,1,1,0,0,0,0,6,
%T 0,0,15,25,0,60,35,45,15,1,1,0,0,0,0,0,7,0,0,0,21,21,35,0,105,105,105,
%U 210,140,105,21,1,1,0,0,0,0,0,0,8,0,0,0,0,28,28
%N Number T(n,k) of set partitions of [n] having exactly k pairs (i,j) with i < j such that i and j are in different blocks; triangle T(n,k), n >= 0, 0 <= k <= n*(n-1)/2 read by rows.
%H Alois P. Heinz, <a href="/A271024/b271024.txt">Rows n = 0..40, flattened</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Partition_of_a_set">Partition of a set</a>
%F T(n,k) = A271023(n,n*(n-1)/2-k).
%F T(n,n-1) = n for n >= 3.
%e T(3,0) = 1: 123.
%e T(3,2) = 3: 12|3, 13|2, 1|23.
%e T(3,3) = 1: 1|2|3.
%e Triangle T(n,k) begins:
%e 1;
%e 1;
%e 1, 1;
%e 1, 0, 3, 1;
%e 1, 0, 0, 4, 3, 6, 1;
%e 1, 0, 0, 0, 5, 0, 10, 10, 15, 10, 1;
%e 1, 0, 0, 0, 0, 6, 0, 0, 15, 25, 0, 60, 35, 45, 15, 1;
%p b:= proc(n, l) option remember; `if`(n=0, x^(m->
%p add(j*(m-j)/2, j=l))(add(i, i=l)), b(n-1, [l[], 1])+
%p add(b(n-1, subsop(j=l[j]+1, l)), j=1..nops(l)))
%p end:
%p T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, [])):
%p seq(T(n), n=0..10);
%t b[n_, l_] := b[n, l] = If[n == 0, x^Function[m, Sum[(1/2)*j*(m - j), {j, l}]][Total[l]], Sum[b[n - 1, ReplacePart[l, j -> l[[j]] + 1]], {j, 1, Length[l]}] + b[n - 1, Append[l, 1]]];
%t T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n, {}]];
%t Flatten[Table[T[n], {n, 0, 10}]] (* _Jean-François Alcover_, May 27 2018, translated from Maple *)
%Y Row sums give A000110.
%Y Cf. A161680, A271023.
%K nonn,look,tabf
%O 0,7
%A _Alois P. Heinz_, Mar 28 2016
|