OFFSET
0,3
COMMENTS
Row sums are powers of 2.
The Heubach et al. reference has a table for n <= 12.
LINKS
Alois P. Heinz, Rows n = 0..62, flattened
M. Archibald, A. Blecher, A. Knopfmacher, and M. E. Mays, Inversions and parity in compositions of integers, J. Integer Seq. 23 (2020), article 20.4.1.
S. Heubach, A. Knopfmacher, M. E. Mays and A. Munagi, Inversions in Compositions of Integers, Quaest. Math. 34 (2011), no. 2, 187-202.
A. Knopfmacher, M. E. Mays, and S. Wagner, Compositions with a fixed number of inversions, Aequationes Math. 93 (2019), 601-617.
Eder G. Santos, Distributions of Inversions and Descents over Integer Compositions, arXiv:2605.20253 [math.GM], 2026.
FORMULA
G.f.: Sum_{k>=0} (x^k/((1-x)*(1-x^2)*...*(1-x^k))) * H_k(x,y), where H_k(x,y) is the joint distribution of major index and inversion number statistics over permutations of {1,2,...,k}, given by: H_k(x,y) = Sum_{|lambda| = k} f^lambda(x)f^lambda(y), where lambda runs through all partitions of k and f^lambda(q) is a q-analog of the hook-length formula. - Eder G. Santos, May 21 2026
From Alois P. Heinz, Jun 05 2026: (Start)
Sum_{k>=1} k * T(n,k) = A189052(n).
Sum_{k>=0} (-1)^k * T(n,k) = A016116(n). (End)
EXAMPLE
T(4,0) = 5: [4], [1,3], [2,2], [1,1,2], [1,1,1,1] - all partitions of 4.
T(5,2) = 3: [2,2,1], [3,1,1], [1,2,1,1].
T(6,4) = 2: [2,2,1,1], [2,1,1,1,1].
Triangle begins:
1;
1;
2;
3 1;
5 2 1;
7 5 3 1;
11 8 7 4 2;
15 15 14 10 6 3 1;
22 23 26 21 17 10 6 2 1;
30 37 44 42 36 27 19 11 6 3 1;
42 55 73 74 73 60 50 34 24 13 8 4 2;
...
MAPLE
T:= proc(n) option remember; local b, p;
b:=proc(m, i, l)
if m=0 then p(i):= p(i)+1
else seq(b(m-h, i+nops(select(j->j<h, l)), [h, l[]]), h=1..m)
fi
end;
p:= proc() 0 end; forget(p);
b(n, 0, []); seq(p(i), i=0..floor(n^2/8))
end:
seq(T(n), n=0..12); # Alois P. Heinz, Apr 17 2011
MATHEMATICA
T[n_] := T[n] = Module[{b, p}, b[m_, i_, l_List] := If[m == 0, p[i] = p[i] + 1, Table[b[m-h, i+Length[Select[ l, #<h&]], Join[{h}, l]], {h, 1, m}]]; Clear[p]; p[_]=0; b[n, 0, {}]; Table[p[i], {i, 0, Floor[n^2/8]}]]; Table[ T[n], {n, 0, 12}] // Flatten (* Jean-François Alcover, Jan 17 2016, after Alois P. Heinz *)
PROG
(SageMath)
from sage.combinat.q_analogues import q_factorial, q_int
def majInv(k):
R.<x, y> = PolynomialRing(ZZ)
Hxy = 0;
for p in Partitions(k):
hookLengthList = [];
denominator=1;
numerator=q_factorial(k, x);
for i in p.hook_lengths():
hookLengthList = hookLengthList + i;
for i in hookLengthList:
denominator=denominator*q_int(i, x);
for i in range(0, len(p)):
numerator = numerator*x^(i*p[i])
polx = numerator/denominator;
polx = polx.numerator();
poly = polx.subs(x=y);
Hxy = Hxy + polx*poly;
return Hxy;
rows = 16;
cols = 12;
prec = rows+cols;
R.<x, y> = PowerSeriesRing(ZZ, default_prec=prec);
pol = sum([majInv(k)*x^k/prod([(1-x^i) for i in [1..k]]) for k in [0..rows]]);
mat = matrix(pol.monomial_coefficients());
mat = mat[0:rows+1, 0:cols+1];
print(mat) # Eder G. Santos, May 21 2026
KEYWORD
nonn,tabf,changed
AUTHOR
N. J. A. Sloane, Apr 16 2011
STATUS
approved
