A381899 Irregular triangular array read by rows. T(n,k) is the number of length n words x on {0,1} such that I(x) + W(x)*(n-W(x)) = k, where I(x) is the number of inversions in x and W(x) is the number of 1's in x, n >= 0, 0 <= k <= floor(n^2/2).
1, 2, 2, 1, 1, 2, 0, 2, 2, 2, 2, 0, 0, 2, 3, 3, 4, 1, 1, 2, 0, 0, 0, 2, 2, 4, 4, 6, 4, 4, 2, 2, 2, 0, 0, 0, 0, 2, 2, 2, 4, 5, 7, 6, 9, 7, 7, 5, 4, 1, 1, 2, 0, 0, 0, 0, 0, 2, 2, 2, 2, 4, 4, 8, 6, 10, 12, 14, 12, 14, 10, 10, 6, 4, 2, 2
Offset: 0
Examples
Triangle T(n,k) begins: 1; 2; 2, 1, 1; 2, 0, 2, 2, 2; 2, 0, 0, 2, 3, 3, 4, 1, 1; 2, 0, 0, 0, 2, 2, 4, 4, 6, 4, 4, 2, 2; ... T(4,5) = 3 because we have: {0, 1, 0, 0}, {0, 1, 0, 1}, {1, 1, 0, 1}.
Links
- Alois P. Heinz, Rows n = 0..50, flattened
Programs
-
Maple
b:= proc(i, j) option remember; expand(`if`(i+j=0, 1, `if`(i=0, 0, b(i-1, j))+`if`(j=0, 0, b(i, j-1)*z^i))) end: T:= n-> (p-> seq(coeff(p, z, i), i=0..degree(p)))( expand(add(b(n-j, j)*z^(j*(n-j)), j=0..n))): seq(T(n), n=0..10); # Alois P. Heinz, Mar 09 2025
-
Mathematica
nn = 7; B[n_] := FunctionExpand[QFactorial[n, q]]*q^Binomial[n, 2];e[z_] := Sum[z^n/B[n], {n, 0, nn}]; Map[CoefficientList[#, q] &, Table[B[n], {n, 0, nn}] CoefficientList[Series[e[z]^2, {z, 0, nn}],z]]
Formula
Sum_{n>=0} Sum_{k>=0} T(n,k)*q^k*x^n/(n_q!*q^binomial(n,2)) = e(x)^2 where e(x) = Sum_{n>=0} x^n/(n_q!*q^binomial(n,2)) where n_q! = Product{i=1..n} (q^n-1)/(q-1).
Comments