A337126 Irregular triangular array read by rows. T(n,k) is the number of permutations of {1,2,...,n} with descent set {1,3,5,...,m} (where m is the greatest odd integer less than n) that have exactly k inversions, n=0, k=0, or n>0, 0<=k<=ceiling((n-1)^2/2).
1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 2, 1, 0, 0, 1, 2, 3, 4, 3, 2, 1, 0, 0, 0, 1, 2, 5, 7, 9, 10, 10, 8, 5, 3, 1, 0, 0, 0, 1, 3, 7, 13, 19, 26, 32, 35, 35, 32, 26, 19, 13, 7, 3, 1, 0, 0, 0, 0, 1, 3, 9, 18, 32, 50, 72, 95, 117, 134, 143, 145, 138, 122, 101, 78, 55, 36, 21, 10, 4, 1
Offset: 0
Examples
Triangle T(n,k) begins: 1; 1; 0, 1; 0, 1, 1; 0, 0, 1, 1, 2, 1; 0, 0, 1, 2, 3, 4, 3, 2, 1; 0, 0, 0, 1, 2, 5, 7, 9, 10, 10, 8, 5, 3, 1; ... T(6,5) = 5 because we have: {2, 1, 5, 4, 6, 3}, {2, 1, 6, 3, 5, 4}, {3, 1, 5, 2, 6, 4}, {3, 2, 4, 1, 6, 5}, {4, 1, 3, 2, 6, 5}.
References
- R. Stanley, Enumerative Combinatorics, volume 1, second edition, Cambridge University Press (2012), p.295.
Links
- Alois P. Heinz, Rows n = 0..50, flattened
Programs
-
Maple
b:= proc(u, o, t) option remember; expand(`if`(u+o=0, 1, add( x^`if`(t=0, o-1+j, u-j)*b(o-1+j, u-j, 1-t), j=1..u))) end: T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0$2)): seq(T(n), n=0..10); # Alois P. Heinz, Aug 17 2020
-
Mathematica
Table[a = Drop[Subsets[Table[i, {i, 1, n - 1, 2}]], 1];f[list_] := (-1)^(Floor[n/2] - Length[list]) QBinomial[n, list[[1]], q] Product[ QBinomial[n - list[[i]], list[[i + 1]] - list[[i]], q], {i, 1, Length[list] - 1}]; CoefficientList[Expand[FunctionExpand[Total[Map[f, a]] + (-1)^(Floor[n/2])]], q], {n, 0, 8}] // Grid (* Second program: *) b[u_, o_, t_] := b[u, o, t] = Expand[If[u + o == 0, 1, Sum[x^If[t == 0, o - 1 + j, u - j]*b[o - 1 + j, u - j, 1 - t], {j, 1, u}]]]; T[n_] := CoefficientList[b[n, 0, 0], x]; T /@ Range[0, 10] // Flatten (* Jean-François Alcover, Jan 02 2021, after Alois P. Heinz *)
Formula
Sum_{k=1..ceiling((n-1)^2/2)} k * T(n,k) = A337193(n).