A287215 Number T(n,k) of set partitions of [n] such that the maximal absolute difference between the least elements of consecutive blocks equals k; triangle T(n,k), n>=0, 0<=k<=max(n-1,0), read by rows.
1, 1, 1, 1, 1, 3, 1, 1, 8, 5, 1, 1, 22, 21, 7, 1, 1, 65, 86, 39, 11, 1, 1, 209, 361, 209, 77, 19, 1, 1, 732, 1584, 1123, 493, 171, 35, 1, 1, 2780, 7315, 6153, 3124, 1293, 413, 67, 1, 1, 11377, 35635, 34723, 20019, 9320, 3709, 1059, 131, 1, 1, 49863, 183080, 202852, 130916, 66992, 30396, 11373, 2837, 259, 1
Offset: 0
Examples
T(4,0) = 1: 1234. T(4,1) = 8: 134|2, 13|24, 14|23, 1|234, 14|2|3, 1|24|3, 1|2|34, 1|2|3|4. T(4,2) = 5: 124|3, 12|34, 12|3|4, 13|2|4, 1|23|4. T(4,3) = 1: 123|4. Triangle T(n,k) begins: 1; 1; 1, 1; 1, 3, 1; 1, 8, 5, 1; 1, 22, 21, 7, 1; 1, 65, 86, 39, 11, 1; 1, 209, 361, 209, 77, 19, 1; 1, 732, 1584, 1123, 493, 171, 35, 1;
Links
- Alois P. Heinz, Rows n = 0..141, flattened
- Wikipedia, Partition of a set
Crossrefs
Programs
-
Maple
b:= proc(n, k, m, l) option remember; `if`(n<1, 1, `if`(l-n>k, 0, b(n-1, k, m+1, n))+m*b(n-1, k, m, l)) end: A:= (n, k)-> b(n-1, min(k, n-1), 1, n): T:= (n, k)-> A(n, k)-`if`(k=0, 0, A(n, k-1)): seq(seq(T(n, k), k=0..max(n-1, 0)), n=0..12);
-
Mathematica
b[n_, k_, m_, l_] := b[n, k, m, l] = If[n < 1, 1, If[l - n > k, 0, b[n - 1, k, m + 1, n]] + m*b[n - 1, k, m, l]]; A[n_, k_] := b[n - 1, Min[k, n - 1], 1, n]; T[n_, k_] := A[n, k] - If[k == 0, 0, A[n, k - 1]]; Table[T[n, k], {n, 0, 12}, {k, 0, Max[n - 1, 0]}] // Flatten (* Jean-François Alcover, May 19 2018, after Alois P. Heinz *)
Comments