This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A337126 #26 Jan 02 2021 12:24:03 %S A337126 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, %T A337126 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, %U A337126 18,32,50,72,95,117,134,143,145,138,122,101,78,55,36,21,10,4,1 %N 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). %D A337126 R. Stanley, Enumerative Combinatorics, volume 1, second edition, Cambridge University Press (2012), p.295. %H A337126 Alois P. Heinz, <a href="/A337126/b337126.txt">Rows n = 0..50, flattened</a> %F A337126 Sum_{k=1..ceiling((n-1)^2/2)} k * T(n,k) = A337193(n). %e A337126 Triangle T(n,k) begins: %e A337126 1; %e A337126 1; %e A337126 0, 1; %e A337126 0, 1, 1; %e A337126 0, 0, 1, 1, 2, 1; %e A337126 0, 0, 1, 2, 3, 4, 3, 2, 1; %e A337126 0, 0, 0, 1, 2, 5, 7, 9, 10, 10, 8, 5, 3, 1; %e A337126 ... %e A337126 T(6,5) = 5 because we have: {2, 1, 5, 4, 6, 3}, {2, 1, 6, 3, 5, 4}, %e A337126 {3, 1, 5, 2, 6, 4}, {3, 2, 4, 1, 6, 5}, {4, 1, 3, 2, 6, 5}. %p A337126 b:= proc(u, o, t) option remember; expand(`if`(u+o=0, 1, add( %p A337126 x^`if`(t=0, o-1+j, u-j)*b(o-1+j, u-j, 1-t), j=1..u))) %p A337126 end: %p A337126 T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0$2)): %p A337126 seq(T(n), n=0..10); # _Alois P. Heinz_, Aug 17 2020 %t A337126 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[ %t A337126 QBinomial[n - list[[i]], list[[i + 1]] - list[[i]], q], {i, 1, %t A337126 Length[list] - 1}]; CoefficientList[Expand[FunctionExpand[Total[Map[f, a]] + (-1)^(Floor[n/2])]], q], {n, 0, 8}] // Grid %t A337126 (* Second program: *) %t A337126 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 A337126 T[n_] := CoefficientList[b[n, 0, 0], x]; %t A337126 T /@ Range[0, 10] // Flatten (* _Jean-François Alcover_, Jan 02 2021, after _Alois P. Heinz_ *) %Y A337126 Cf. A000111 (row sums), A337193 (total number of inversions). %K A337126 nonn,tabf %O A337126 0,12 %A A337126 _Geoffrey Critzer_, Aug 17 2020