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.

A128564 Triangle, read by rows, where T(n,k) equals the number of permutations of {1..n+1} with [(nk+k)/2] inversions for n>=k>=0.

This page as a plain text file.
%I A128564 #11 Dec 04 2023 10:05:07
%S A128564 1,1,1,1,2,1,1,5,5,1,1,9,22,15,1,1,29,90,90,29,1,1,49,359,573,359,98,
%T A128564 1,1,174,1415,3450,3450,1415,174,1,1,285,5545,17957,29228,21450,5545,
%U A128564 628,1,1,1068,21670,110010,230131,230131,110010,21670,1068,1
%N A128564 Triangle, read by rows, where T(n,k) equals the number of permutations of {1..n+1} with [(nk+k)/2] inversions for n>=k>=0.
%C A128564 Row sums equal 2*n! for n>0.
%H A128564 Alois P. Heinz, <a href="/A128564/b128564.txt">Rows n = 0..140, flattened</a>
%F A128564 T(n,k) = A008302(n+1, [(nk+k)/2]) = coefficient of q^[(nk+k)/2] in the q-factorial of n+1 for n>=0.
%e A128564 Row sums equal 2*n! for n>0:
%e A128564 [1, 2, 4, 12, 48, 240, 1440, 10080, 80640, ..., 2*n!,...].
%e A128564 Triangle begins:
%e A128564   1;
%e A128564   1,    1;
%e A128564   1,    2,     1;
%e A128564   1,    5,     5,      1;
%e A128564   1,    9,    22,     15,       1;
%e A128564   1,   29,    90,     90,      29,       1;
%e A128564   1,   49,   359,    573,     359,      98,       1;
%e A128564   1,  174,  1415,   3450,    3450,    1415,     174,      1;
%e A128564   1,  285,  5545,  17957,   29228,   21450,    5545,    628,     1;
%e A128564   1, 1068, 21670, 110010,  230131,  230131,  110010,  21670,  1068,    1;
%e A128564   1, 1717, 84591, 526724, 1729808, 2409581, 1729808, 686763, 84591, 4015, 1;
%e A128564   ...
%p A128564 b:= proc(u, o) option remember; expand(`if`(u+o=0, 1,
%p A128564        add(b(u+j-1, o-j)*x^(u+j-1), j=1..o)+
%p A128564        add(b(u-j, o+j-1)*x^(u-j), j=1..u)))
%p A128564     end:
%p A128564 T:= (n, k)-> coeff(b(n+1, 0), x, iquo((n+1)*k, 2)):
%p A128564 seq(seq(T(n,k), k=0..n), n=0..10);  # _Alois P. Heinz_, May 02 2017
%t A128564 b[u_, o_] := b[u, o] = Expand[If[u + o == 0, 1, Sum[b[u + j - 1, o - j]* x^(u+j-1), {j, 1, o}] + Sum[b[u-j, o+j-1]*x^(u-j), {j, 1, u}]]];
%t A128564 T[n_, k_] := Coefficient[b[n+1, 0], x, Quotient[(n+1)*k, 2]];
%t A128564 Table[Table[T[n, k], {k, 0, n}], {n, 0, 10}] // Flatten (* _Jean-François Alcover_, Dec 06 2019, after _Alois P. Heinz_ *)
%o A128564 (PARI) {T(n,k)=local(faq=prod(j=1, n+1, (1-q^j)/(1-q))); polcoeff(faq, (n*k+k)\2, q)}
%Y A128564 Cf. A008302 (Mahonian numbers); A128565 (column 1), A128566 (column 2).
%Y A128564 Row sums give A098558.
%K A128564 nonn,tabl
%O A128564 0,5
%A A128564 _Paul D. Hanna_, Mar 12 2007