OFFSET
0,6
COMMENTS
LINKS
EXAMPLE
T(5,4) = 7: there are 7 permutations of [5] with excedance set {2,3} (the 4th subset in Gray order): 13425, 13524, 13542, 14523, 14532, 15423, 15432.
Triangle T(n,k) begins:
1;
1;
1, 1;
1, 3, 1, 1;
1, 7, 7, 3, 1, 1, 3, 1;
1, 15, 31, 7, 7, 15, 17, 3, 1, 3, 1, 1, 3, 7, 7, 1;
...
MAPLE
a:= n-> `if`(n<2, n, Bits[Xor](n, a(iquo(n, 2)))):
b:= proc(s, t) option remember; (m->
`if`(m=0, x^a(t/2), add(b(s minus {i}, t+
`if`(i<m, 2^i, 0)), i=s)))(nops(s))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b({$1..n}, 0)):
seq(T(n), n=0..7);
MATHEMATICA
a[n_] := If[n < 2, n, BitXor[n, a[Quotient[n, 2]]]];
b[s_, t_] := b[s, t] = With[{m = Length[s]}, If[m == 0, x^a[t/2], Sum[b[s ~Complement~ {i}, t + If[i < m, 2^i, 0]], {i, s}]]];
T[n_] := CoefficientList[b[Range[n], 0], x];
Table[T[n], {n, 0, 7}] // Flatten (* Jean-François Alcover, Dec 09 2023, after Alois P. Heinz *)
KEYWORD
AUTHOR
Alois P. Heinz, Feb 01 2023
STATUS
approved