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 A221057 #22 Mar 27 2021 08:07:39 %S A221057 1,1,2,2,1,3,2,1,3,2,3,2,4,3,5,4,3,1,4,3,5,6,7,6,3,1,5,4,7,9,11,11,10, %T A221057 6,5,2,5,4,7,9,13,14,18,17,15,12,7,4,1,6,5,9,12,18,20,27,28,30,26,23, %U A221057 19,15,9,4,1,6,5,9,12,18,22,30,34,42,45,46,46,44,36,28,19,11,7,2,7,6,11,15,23,29,40,47,60,68,76,78,82,77,73,63,56,44,32,20,11,5,1 %N A221057 Irregular triangle read by rows: T(n,k) is the number of Dyck prefixes of length n having k inversions (n >= 0, k >= 0). %C A221057 A Dyck prefix of length n is a binary word of a total of n 0's and 1's in which no initial segment contains more 1's than 0's. %C A221057 Sum of entries in row n = binomial(n, floor(n/2)) = A001405(n). %C A221057 Sum_{k>=0} k*T(n,k) = A221058(n). %H A221057 Alois P. Heinz, <a href="/A221057/b221057.txt">Rows n = 0..60, flattened</a> %H A221057 M. Shattuck, <a href="https://www.emis.de/journals/INTEGERS/papers/f7/f7.Abstract.html">Parity theorems for statistics on permutations and Catalan words</a>, INTEGERS, Electronic J. of Combinatorial Number Theory, Vol. 5, Paper A07, 2005. %F A221057 Let R_n(t,s,q) be the trivariate generating polynomial of the Dyck prefixes of length n with respect to number of 0's (t), number of 1's (s), and number of inversions (q). Then R_1 = t and R_n(t,s,q) = tR_{n-1}(t,qs,q) + s[R_{n-1}(t,s,q) - (ts)^{(n-1)/2} Q_{n-1}(q)], where Q_n(q) is the generating polynomial of the Dyck words of length n with respect to number of inversions. Notice that Q_{2n+1}=0 and Q_{2n} = Ctilde_q(n), given in the Shattuck reference (Eq. (4.6)). %e A221057 Row 4 is 3,2,1 because the Dyck prefixes of length 4 are 0101, 0100, 0011, 0010, 0001, and 0000 having 1, 2, 0, 1, 0, and 0 inversions, respectively. %e A221057 Triangle begins: %e A221057 1; %e A221057 1; %e A221057 2; %e A221057 2, 1; %e A221057 3, 2, 1; %e A221057 3, 2, 3, 2; %e A221057 4, 3, 5, 4, 3, 1; %e A221057 4, 3, 5, 6, 7, 6, 3, 1; %e A221057 5, 4, 7, 9, 11, 11, 10, 6, 5, 2; %p A221057 for n from 0 to 30 do Q[2*n+1] := 0 end do: Q[0] := 1: for n from 0 to 30 do Q[2*n+2] := sort(expand(sum(q^(((i+1)*(1/2))*(2*n-2*i))* Q[2*i]* Q[2*n-2*i], i = 0 .. n))) end do: R[0] := 1: for n to 50 do R[n] := sort(expand(t*subs(s = q*s, R[n-1])+s*(R[n-1]-t^((n-1)*(1/2))*s^((n-1)* (1/2))*Q[n-1]))) end do: P := proc (n) options operator, arrow: sort(subs({s = 1, t = 1}, R[n])) end proc: for n from 0 to 12 do seq(coeff(P(n), q, j), j = 0 .. degree(P(n))) end do; # yields sequence in triangular form %t A221057 For[n = 0, n <= 30, n++, Q[2n+1] = {0}]; Q[0] = {1}; %t A221057 For[n = 0, n <= 30, n++, Q[2n+2] = Sort[Expand[Sum[q^(((i+1)/2)(2n-2i))* Q[2i] Q[2n-2i], {i, 0, n}]]]]; %t A221057 R[0] = {1}; %t A221057 For[n = 1, n <= 50, n++, R[n] = Sort[Expand[t ReplaceAll[R[n-1], s -> q s] + s(R[n-1] - t^((n-1)/2) s^((n-1)/2) Q[n-1])]]]; %t A221057 P[n_] := Sort[ReplaceAll[R[n], {s -> 1, t -> 1}]]; %t A221057 Table[CoefficientList[P[n][[1]], q], {n, 0, 12}] // Flatten (* _Jean-François Alcover_, Mar 27 2021, after Maple program *) %Y A221057 Cf. A221058, A129176, A001405. %K A221057 nonn,tabf %O A221057 0,3 %A A221057 _Emeric Deutsch_, Jan 22 2013