OFFSET
0,6
COMMENTS
LINKS
EXAMPLE
T(5,5) = 4: there are 4 permutations of [5] with descent set {1,2,3} (the 5th subset in Gray order): 43215, 53214, 54213, 54312.
Triangle T(n,k) begins:
1;
1;
1, 1;
1, 2, 1, 2;
1, 3, 3, 5, 3, 1, 5, 3;
1, 4, 6, 9, 11, 4, 16, 9, 6, 9, 1, 4, 16, 9, 11, 4;
...
MAPLE
a:= proc(n) a(n):= `if`(n<2, n, Bits[Xor](n, a(iquo(n, 2)))) end:
b:= proc(u, o, t) option remember; `if`(u+o=0, x^a(t),
add(b(u-j, o+j-1, t), j=1..u)+
add(b(u+j-1, o-j, t+2^(o+u-1)), j=1..o))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0$2)):
seq(T(n), n=0..7);
MATHEMATICA
a[n_] := a[n] = If[n<2, n, BitXor[n, a[Quotient[n, 2] ]]];
b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, x^a[t], Sum[b[u - j, o + j - 1, t], {j, 1, u}] + Sum[b[u + j - 1, o - j, t + 2^(o + u - 1)], {j, 1, o}]];
T[n_] := CoefficientList[b[n, 0, 0], x];
Table[T[n], {n, 0, 7}] // Flatten (* Jean-François Alcover, Feb 14 2023, after Alois P. Heinz *)
CROSSREFS
KEYWORD
AUTHOR
Alois P. Heinz, Feb 03 2023
STATUS
approved