login
Sum T(n,k) of the k-th last entries in all blocks of all set partitions of [n]; triangle T(n,k), n>=1, 1<=k<=n, read by rows.
3

%I #11 May 26 2018 03:52:55

%S 1,5,1,23,6,1,109,33,7,1,544,182,45,8,1,2876,1034,284,59,9,1,16113,

%T 6122,1815,420,75,10,1,95495,37927,11931,2987,595,93,11,1,597155,

%U 246030,81205,21620,4665,814,113,12,1,3929243,1669941,573724,160607,36900,6979,1082,135,13,1

%N Sum T(n,k) of the k-th last entries in all blocks of all set partitions of [n]; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

%H Alois P. Heinz, <a href="/A286897/b286897.txt">Row n = 1..50, flattened</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Partition_of_a_set">Partition of a set</a>

%e T(3,2) = 6 because the sum of the second last entries in all blocks of all set partitions of [3] (123, 12|3, 13|2, 1|23, 1|2|3) is 2+1+1+2 = 6.

%e Triangle T(n,k) begins:

%e : 1;

%e : 5, 1;

%e : 23, 6, 1;

%e : 109, 33, 7, 1;

%e : 544, 182, 45, 8, 1;

%e : 2876, 1034, 284, 59, 9, 1;

%e : 16113, 6122, 1815, 420, 75, 10, 1;

%e : 95495, 37927, 11931, 2987, 595, 93, 11, 1;

%p b:= proc(n, l) option remember; `if`(n=0, [1, 0],

%p (p-> p+[0, n*p[1]*x^1])(b(n-1, [l[], 1]))+

%p add((p-> p+[0, n*p[1]*x^(l[j]+1)])(b(n-1,

%p sort(subsop(j=l[j]+1, l), `>`))), j=1..nops(l)))

%p end:

%p T:= n-> (p-> seq(coeff(p, x, i), i=1..n))(b(n, [])[2]):

%p seq(T(n), n=1..14);

%t b[0, _] = {1, 0}; b[n_, l_] := b[n, l] = Function[p, p + {0, n*p[[1]]*x^1} ][b[n - 1, Append[l, 1]]] + Sum[Function[p, p + {0, n*p[[1]]*x^(l[[j]] + 1)}][b[n - 1, Reverse @ Sort[ReplacePart[l, j -> l[[j]] + 1]]]], {j, 1, Length[l]}];

%t T[n_] := Function[p, Table[Coefficient[p, x, i], {i, n}]][b[n, {}][[2]]];

%t Table[T[n], {n, 1, 14}] // Flatten (* _Jean-François Alcover_, May 26 2018, from Maple *)

%Y Column k=1 gives A278677(n+1).

%Y Row sums give A000110(n) * A000217(n) = A105488(n+3).

%Y Cf. A285595.

%K nonn,tabl

%O 1,2

%A _Alois P. Heinz_, May 15 2017