OFFSET
1,2
LINKS
Alois P. Heinz, Row n = 1..50, flattened
Wikipedia, Partition of a set
EXAMPLE
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;
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 *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Alois P. Heinz, May 15 2017
STATUS
approved