A286897 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.
1, 5, 1, 23, 6, 1, 109, 33, 7, 1, 544, 182, 45, 8, 1, 2876, 1034, 284, 59, 9, 1, 16113, 6122, 1815, 420, 75, 10, 1, 95495, 37927, 11931, 2987, 595, 93, 11, 1, 597155, 246030, 81205, 21620, 4665, 814, 113, 12, 1, 3929243, 1669941, 573724, 160607, 36900, 6979, 1082, 135, 13, 1
Offset: 1
Examples
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. Triangle T(n,k) begins: 1; 5, 1; 23, 6, 1; 109, 33, 7, 1; 544, 182, 45, 8, 1; 2876, 1034, 284, 59, 9, 1; 16113, 6122, 1815, 420, 75, 10, 1; 95495, 37927, 11931, 2987, 595, 93, 11, 1; ...
Links
- Alois P. Heinz, Row n = 1..50, flattened
- Wikipedia, Partition of a set
Crossrefs
Programs
-
Maple
b:= proc(n, l) option remember; `if`(n=0, [1, 0], (p-> p+[0, n*p[1]*x^1])(b(n-1, [l[], 1]))+ add((p-> p+[0, n*p[1]*x^(l[j]+1)])(b(n-1, sort(subsop(j=l[j]+1, l), `>`))), j=1..nops(l))) end: T:= n-> (p-> seq(coeff(p, x, i), i=1..n))(b(n, [])[2]): seq(T(n), n=1..14);
-
Mathematica
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[n_] := Function[p, Table[Coefficient[p, x, i], {i, n}]][b[n, {}][[2]]]; Table[T[n], {n, 1, 14}] // Flatten (* Jean-François Alcover, May 26 2018, from Maple *)