cp's OEIS Frontend

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.

A129529 Triangle read by rows: T(n,k) is the number of ternary words of length n on {0,1,2} that have k inversions (n >= 0, k >= 0).

This page as a plain text file.
%I A129529 #35 Apr 13 2025 14:56:11
%S A129529 1,3,6,3,10,8,8,1,15,15,21,18,9,3,21,24,39,45,48,30,24,9,3,28,35,62,
%T A129529 82,107,108,101,81,62,37,17,8,1,36,48,90,129,186,222,264,252,255,219,
%U A129529 183,126,90,48,27,9,3,45,63,123,186,285,372,492,561,624,648,651,597,537,435,336,249,165,99,54,27,9,3
%N A129529 Triangle read by rows: T(n,k) is the number of ternary words of length n on {0,1,2} that have k inversions (n >= 0, k >= 0).
%C A129529 Row n has 1 + floor(n^2/3) terms.
%C A129529 Row sums are equal to 3^n = A000244(n).
%C A129529 Alternating row sums are 3^(ceiling(n/2)) = A108411(n+1).
%C A129529 This sequence is mentioned in the Andrews-Savage-Wilf paper. - _Omar E. Pol_, Jan 30 2012
%D A129529 M. Bona, Combinatorics of Permutations, Chapman & Hall/CRC, Boca Raton, FL, 2004, pp. 57-61.
%D A129529 G. E. Andrews, The Theory of Partitions, Addison-Wesley, 1976.
%H A129529 Alois P. Heinz, <a href="/A129529/b129529.txt">Rows n = 0..50, flattened</a>
%H A129529 G. E. Andrews, C. D. Savage and H. S. Wilf, <a href="http://www.math.psu.edu/andrews/pdf/286.pdf">Hypergeometric identities associated with statistics on words</a>
%H A129529 Mark A. Shattuck and Carl G. Wagner, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL8/Shattuck2/shattuck44.html">Parity Theorems for Statistics on Lattice Paths and Laguerre Configurations</a>, Journal of Integer Sequences, Vol. 8 (2005), Article 05.5.1.
%F A129529 T(n,0) = (n+1)*(n+2)/2 = A000217(n+1).
%F A129529 Sum_{k>=0} k*T(n,k) = 3^(n-1)*n*(n-1)/2 = A129530(n).
%F A129529 Generating polynomial of row n is Sum_{i=0..n} Sum_{j=0..n-i} binomial[n; i,j,n-i-j], where binomial[n;a,b,c] (a+b+c=n) is a q-multinomial coefficient.
%F A129529 Sum_{k=0..floor(n^2/3)} (-1)^k * T(n,k) = A056449(n). - _Alois P. Heinz_, Feb 12 2025
%e A129529 T(3,2) = 8 because we have 100, 110, 120, 200, 201, 211, 220 and 221.
%e A129529 Triangle starts:
%e A129529    1;
%e A129529    3;
%e A129529    6,  3;
%e A129529   10,  8,  8,  1;
%e A129529   15, 15, 21, 18,  9,  3;
%e A129529   21, 24, 39, 45, 48, 30, 24,  9,  3;
%e A129529   ...
%p A129529 for n from 0 to 40 do br[n]:=sum(q^i,i=0..n-1) od: for n from 0 to 40 do f[n]:=simplify(product(br[j],j=1..n)) od: mbr:=(n,a,b,c)->simplify(f[n]/f[a]/f[b]/f[c]): for n from 0 to 9 do G[n]:=sort(simplify(sum(sum(mbr(n,a,b,n-a-b),b=0..n-a),a=0..n))) od: for n from 0 to 9 do seq(coeff(G[n],q,j),j=0..floor(n^2/3)) od; # yields sequence in triangular form
%p A129529 # second Maple program:
%p A129529 b:= proc(n, l) option remember; `if`(n=0, 1, add(expand(b(n-1, `if`(j<3,
%p A129529       subsop(j=l[j]+1, l), l)))*x^([0, l[1], l[1]+l[2]][j]), j=1..3))
%p A129529     end:
%p A129529 T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, [0$2])):
%p A129529 seq(T(n), n=0..10);  # _Alois P. Heinz_, Feb 12 2025
%t A129529 b[n_, l_] := b[n, l] =
%t A129529    If[n == 0, 1, Sum[Expand[b[n-1, If[j < 3, ReplacePart[l, j -> l[[j]]+1], l]]]*x^({0, l[[1]], l[[1]]+l[[2]]}[[j]]), {j, 1, 3}]];
%t A129529 T[n_] := With[{p = b[n, {0, 0}]}, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]];
%t A129529 Table[T[n], {n, 0, 10}] // Flatten (* _Jean-François Alcover_, Apr 13 2025, after _Alois P. Heinz_ *)
%Y A129529 Cf. A000244, A056449, A083906, A108411, A000217, A129530, A129531, A129532.
%K A129529 nonn,tabf
%O A129529 0,2
%A A129529 _Emeric Deutsch_, Apr 22 2007