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.

Showing 1-2 of 2 results.

A128566 Number of permutations of {1..n} with n inversions.

Original entry on oeis.org

1, 0, 0, 1, 5, 22, 90, 359, 1415, 5545, 21670, 84591, 330121, 1288587, 5032235, 19664205, 76893687, 300895513, 1178290263, 4617369760, 18106447251, 71048746505, 278966179936, 1095987764828, 4308300939450, 16944940572831, 66680029591816, 262519664110588
Offset: 0

Views

Author

Paul D. Hanna, Mar 12 2007

Keywords

Crossrefs

Diagonal of A008302 (Mahonian numbers).
Column 2 of A128564.
Cf. A128565 (column 1), A214086, A048651.

Programs

  • Maple
    a:= n-> coeff(series(mul((1-q^j)/(1-q), j=1..n), q, n+1), q, n):
    seq(a(n), n=0..30);  # Alois P. Heinz, Mar 05 2013
  • Mathematica
    Table[SeriesCoefficient[QPochhammer[x, x, n]/(1-x)^n, {x, 0, n}], {n, 0, 25}] (* Vaclav Kotesovec, May 13 2016 *)
  • PARI
    {a(n)=polcoeff(prod(j=1, n, (1-q^j)/(1-q)),n,q)}

Formula

a(n) = A008302(n,n) = coefficient of q^n in the q-factorial of n.
a(n) = T(n,n) with T(n,k) = T(n-1,k) + Sum_{j=1..n-1} T(n-1,k-j) for n>=0, k>0; T(n,k) = 0 for n<0; T(n,0) = 1 for n>=0. - Alois P. Heinz, Mar 07 2013
a(n) ~ c * 2^(2*n-1) / sqrt(Pi*n), where c = A048651 = QPochhammer[1/2] = 0.28878809508660242127889972192923... . - Vaclav Kotesovec, Sep 07 2014

Extensions

Edited by Alois P. Heinz, Mar 05 2013

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.

Original entry on oeis.org

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, 1, 1, 174, 1415, 3450, 3450, 1415, 174, 1, 1, 285, 5545, 17957, 29228, 21450, 5545, 628, 1, 1, 1068, 21670, 110010, 230131, 230131, 110010, 21670, 1068, 1
Offset: 0

Views

Author

Paul D. Hanna, Mar 12 2007

Keywords

Comments

Row sums equal 2*n! for n>0.

Examples

			Row sums equal 2*n! for n>0:
[1, 2, 4, 12, 48, 240, 1440, 10080, 80640, ..., 2*n!,...].
Triangle begins:
  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,       1;
  1,  174,  1415,   3450,    3450,    1415,     174,      1;
  1,  285,  5545,  17957,   29228,   21450,    5545,    628,     1;
  1, 1068, 21670, 110010,  230131,  230131,  110010,  21670,  1068,    1;
  1, 1717, 84591, 526724, 1729808, 2409581, 1729808, 686763, 84591, 4015, 1;
  ...
		

Crossrefs

Cf. A008302 (Mahonian numbers); A128565 (column 1), A128566 (column 2).
Row sums give A098558.

Programs

  • Maple
    b:= proc(u, o) option remember; expand(`if`(u+o=0, 1,
           add(b(u+j-1, o-j)*x^(u+j-1), j=1..o)+
           add(b(u-j, o+j-1)*x^(u-j), j=1..u)))
        end:
    T:= (n, k)-> coeff(b(n+1, 0), x, iquo((n+1)*k, 2)):
    seq(seq(T(n,k), k=0..n), n=0..10);  # Alois P. Heinz, May 02 2017
  • Mathematica
    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[n_, k_] := Coefficient[b[n+1, 0], x, Quotient[(n+1)*k, 2]];
    Table[Table[T[n, k], {k, 0, n}], {n, 0, 10}] // Flatten (* Jean-François Alcover, Dec 06 2019, after Alois P. Heinz *)
  • PARI
    {T(n,k)=local(faq=prod(j=1, n+1, (1-q^j)/(1-q))); polcoeff(faq, (n*k+k)\2, q)}

Formula

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.
Showing 1-2 of 2 results.