OFFSET
0,6
REFERENCES
Richard Stanley, Enumerative Combinatorics, Volume 1, Second Edition, Example 2.2.5.
EXAMPLE
Triangle begins:
0;
0;
0, 1;
0, 3, 3, 9;
0, 6, 12, 6, 30, 30, 30, 72;
0, 10, 30, 30, 10, 70, 120, 70, 120, 120, 70, 270, 270, 270, 270, 600; ...
T(4,7) = 30. S = {2,3}. There are A392945(4,7) = 12 permutations of [4] whose descent set is contained in S: {1, 2, 3, 4}, {1, 2, 4, 3}, {1, 3, 2, 4}, {1, 3, 4, 2}, {1, 4, 2, 3}, {1, 4, 3, 2}, {2, 3, 1, 4}, {2, 3, 4, 1}, {2, 4, 1, 3}, {2, 4, 3, 1}, {3, 4, 1, 2}, {3, 4, 2, 1}. There are 0, 1, 1, 2, 2, 3, 2, 3, 3, 4, 4, 5 inversions respectively in these permutations for a total of 30.
MATHEMATICA
steplengths[n_] := Map[Differences, Map[Append[#, n] &, Map[Prepend[#, 0] &, Subsets[Range[n - 1]]]]]; f[list_] := Apply[Times, Map[QFactorial[#, q] &, list]]; numberofinversions[n_, steplengths_] :=Limit[D[QFactorial[n, q]/f[steplengths] // FunctionExpand, q], q -> 1]; Table[Map[numberofinversions[n, #] &, steplengths[n]], {n, 0, 6}]
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Geoffrey Critzer, Feb 03 2026
STATUS
approved
