A274581 Number T(n,k) of set partitions of [n] with alternating parity of elements and exactly k blocks; triangle T(n,k), n>=0, 0<=k<=n, read by rows.
1, 0, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 3, 3, 1, 0, 1, 5, 7, 4, 1, 0, 1, 7, 14, 12, 5, 1, 0, 1, 11, 30, 33, 19, 6, 1, 0, 1, 15, 57, 84, 62, 27, 7, 1, 0, 1, 23, 119, 222, 204, 108, 37, 8, 1, 0, 1, 31, 224, 545, 627, 409, 169, 48, 9, 1, 0, 1, 47, 460, 1425, 2006, 1558, 763, 254, 61, 10, 1
Offset: 0
Examples
T(5,1) = 1: 12345. T(5,2) = 5: 1234|5, 123|45, 12|345, 145|23, 1|2345. T(5,3) = 7: 123|4|5, 12|34|5, 12|3|45, 1|234|5, 145|2|3, 1|2|345, 1|23|45. T(5,4) = 4: 12|3|4|5, 1|23|4|5, 1|2|34|5, 1|2|3|45. T(5,5) = 1: 1|2|3|4|5. Triangle T(n,k) begins: 1; 0, 1; 0, 1, 1; 0, 1, 2, 1; 0, 1, 3, 3, 1; 0, 1, 5, 7, 4, 1; 0, 1, 7, 14, 12, 5, 1; 0, 1, 11, 30, 33, 19, 6, 1; 0, 1, 15, 57, 84, 62, 27, 7, 1; 0, 1, 23, 119, 222, 204, 108, 37, 8, 1; 0, 1, 31, 224, 545, 627, 409, 169, 48, 9, 1; ...
Links
- Alois P. Heinz, Rows n = 0..35, flattened
- Wikipedia, Partition of a set
Crossrefs
Programs
-
Maple
b:= proc(l, i, t) option remember; `if`(l=[], x, `if`(l[1]=t, 0, expand(x*b(subsop(1=[][], l), 1, 1-t) ))+add(`if`(l[j]=t, 0, b(subsop(j=[][], l), j, 1-t) ), j=i..nops(l))) end: T:= n-> `if`(n=0, 1, (p-> seq(coeff(p, x, j), j=0..n))( b([seq(irem(i, 2), i=2..n)], 1$2))): seq(T(n), n=0..12);
-
Mathematica
b[l_, i_, t_] := b[l, i, t] = If[l == {}, x, If[l[[1]] == t, 0, Expand[x*b[Rest[l], 1, 1 - t]]] + Sum[If[l[[j]] == t, 0, b[Delete[l, j], j, 1 - t]], {j, i, Length[l]}]]; T[n_] := If[n==0, {1}, Function[p, Table[Coefficient[p, x, j], {j, 0, n}]][ b[Table[Mod[i, 2], {i, 2, n}], 1, 1]]]; Flatten[Table[T[n], {n, 0, 12}]] (* Jean-François Alcover, May 27 2018, from Maple *)
Formula
Sum_{k=0..n} k * T(n,k) = A305823(n).