login
Number T(n,k) of partitions of [n] having exactly k parity changes within their blocks, n>=0, 0<=k<=max(0,n-1), read by rows.
7

%I #31 Sep 05 2023 09:38:00

%S 1,1,1,1,2,2,1,4,6,4,1,10,18,17,6,1,25,61,68,38,10,1,75,210,292,202,

%T 83,14,1,225,778,1252,1116,576,170,22,1,780,3008,5670,5928,3899,1490,

%U 341,30,1,2704,12219,26114,32382,25320,12655,3856,678,46,1,10556,52268,126073,177666,163695,98282,39230,9418,1319,62,1

%N Number T(n,k) of partitions of [n] having exactly k parity changes within their blocks, n>=0, 0<=k<=max(0,n-1), read by rows.

%H Alois P. Heinz, <a href="/A363493/b363493.txt">Rows n = 0..150, flattened</a>

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

%F Sum_{k=0..max(0,n-1)} k * T(n,k) = A363496(n).

%e T(4,0) = 4: 13|24, 13|2|4, 1|24|3, 1|2|3|4.

%e T(4,1) = 6: 124|3, 12|3|4, 134|2, 1|23|4, 14|2|3, 1|2|34.

%e T(4,2) = 4: 123|4, 12|34, 14|23, 1|234.

%e T(4,3) = 1: 1234.

%e T(5,2) = 17: 1235|4, 123|4|5, 1245|3, 12|34|5, 125|3|4, 12|3|45, 1345|2, 134|25, 14|235, 14|23|5, 15|234, 1|234|5, 1|23|45, 145|2|3, 14|25|3, 1|25|34, 1|2|345.

%e Triangle T(n,k) begins:

%e 1;

%e 1;

%e 1, 1;

%e 2, 2, 1;

%e 4, 6, 4, 1;

%e 10, 18, 17, 6, 1;

%e 25, 61, 68, 38, 10, 1;

%e 75, 210, 292, 202, 83, 14, 1;

%e 225, 778, 1252, 1116, 576, 170, 22, 1;

%e 780, 3008, 5670, 5928, 3899, 1490, 341, 30, 1;

%e 2704, 12219, 26114, 32382, 25320, 12655, 3856, 678, 46, 1;

%e ...

%p b:= proc(n, x, y) option remember; `if`(n=0, 1,

%p `if`(y=0, 0, expand(b(n-1, y-1, x+1)*y*z))+

%p b(n-1, y, x)*x + b(n-1, y, x+1))

%p end:

%p T:= n-> (p-> seq(coeff(p, z, i), i=0..degree(p)))(b(n, 0$2)):

%p seq(T(n), n=0..12);

%t b[n_, x_, y_] := b[n, x, y] = If[n == 0, 1,

%t If[y == 0, 0, Expand[b[n - 1, y - 1, x + 1]*y*z]] +

%t b[n - 1, y, x]*x + b[n - 1, y, x + 1]];

%t T[n_] := CoefficientList[b[n, 0, 0], z];

%t Table[T[n], {n, 0, 12}] // Flatten (* _Jean-François Alcover_, Sep 05 2023, after _Alois P. Heinz_ *)

%Y Columns k=0-2 give: A124419, A363511, A363588.

%Y Row sums give A000110.

%Y T(n+1,n) gives A000012.

%Y T(n+2,n) gives A027383.

%Y T(2n+1,n) gives A363495.

%Y Cf. A152874, A363496, A363519.

%K nonn,tabf

%O 0,5

%A _Alois P. Heinz_, Jun 05 2023