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-3 of 3 results.

A145882 Triangle read by rows: T(n,k) is the number of even permutations of {1,2,...,n} having k descents (n >= 1, k >= 0).

Original entry on oeis.org

1, 1, 1, 2, 1, 5, 5, 1, 1, 14, 30, 14, 1, 1, 29, 147, 155, 28, 1, 64, 586, 1208, 605, 56, 1, 127, 2133, 7819, 7819, 2133, 127, 1, 1, 262, 7288, 44074, 78190, 44074, 7288, 262, 1, 1, 517, 23893, 227569, 655315, 655039, 227623, 23947, 496, 1, 1044, 76332, 1101420
Offset: 1

Views

Author

Emeric Deutsch, Nov 11 2008

Keywords

Comments

Number of entries in row n is 1+floor(binomial(n,2)/2)-floor(binomial(n-2,2)/2).
Sum of entries in row n is A001710(n) for n>=2.

Examples

			T(4,2) = 5 because we have 4132, 2143, 4213, 2431 and 3241.
Triangle begins with T(1,0):
  1
  1
  1    2
  1    5      5       1
  1   14     30      14       1
  1   29    147     155      28
  1   64    586    1208     605      56
  1  127   2133    7819    7819    2133     127       1
  1  262   7288   44074   78190   44074    7288     262     1
  1  517  23893  227569  655315  655039  227623   23947   496
  1 1044  76332 1101420 4869558 7862124 4868556 1102068 76305 992
		

Crossrefs

Cf. A128612 (similar with rows reversed).

Programs

  • Maple
    for n to 11 do qbr := proc (m) options operator, arrow; sum(q^i, i = 0 .. m-1) end proc; qfac := proc (m) options operator, arrow; product(qbr(j), j = 1 .. m) end proc; Exp := proc (z) options operator, arrow; sum(q^binomial(m, 2)*z^m/qfac(m), m = 0 .. 19) end proc; g := (1-t)/(Exp(z*(t-1))-t); gser := simplify(series(g, z = 0, 17)); a[n] := simplify(qfac(n)*coeff(gser, z, n)); b[n] := (a[n]+subs(q = -q, a[n]))*1/2; P[n] := sort(subs(q = 1, b[n])) end do; for n to 11 do seq(coeff(P[n], t, j), j = 0 .. floor((1/2)*binomial(n, 2)) -floor((1/2)*binomial(n-2, 2))) end do; # yields sequence in triangular form
    # second Maple program:
    b:= proc(u, o, t) option remember; `if`(u+o=0, t, expand(
           add(b(u+j-1, o-j, irem(t+j-1+u, 2)), j=1..o)+
           add(b(u-j, o+j-1, irem(t+u-j, 2))*x, j=1..u)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))
            (add(b(j-1, n-j, irem(j, 2)), j=1..n)):
    seq(T(n), n=1..12);  # Alois P. Heinz, Nov 19 2013
  • Mathematica
    b[u_, o_, t_] := b[u, o, t] = If[u+o == 0, t, Expand[Sum[b[u+j-1, o-j, Mod[t+j-1+u, 2]], {j, 1, o}] + Sum[b[u-j, o+j-1, Mod[t+u-j, 2]]*x, {j, 1, u}]]]; T[n_] := Function[{p}, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]] [Sum[b[j-1, n-j, Mod[j, 2]], {j, 1, n}]]; Table[T[n], {n, 1, 12}] // Flatten (* Jean-François Alcover, May 26 2015, after Alois P. Heinz *)
    Needs["Combinatorica`"];
    Table[(Eulerian[n, k] + Sum[Binomial[j-1-Floor[n/2], j] Eulerian[Ceiling[n/2], k-j], {j, Max[0, k-Ceiling[n/2]], Min[Floor[n/2], k]}])/2, {n, 25}, {k, 0, n-1}] // Flatten // DeleteCases[0] (* Robert A. Russell, Nov 14 2018 *)

Formula

In the Shareshian and Wachs reference (p. 35) a q-analog of the exponential g.f. of the Eulerian polynomials is given for the joint distribution of (inv, des) (see also the Stanley reference). The first Maple program given below makes use of this function by considering its even part.
T(n,k) = (euler(n,k) + Sum_{j=max(0, k+1-ceiling(n/2))..min(floor(n/2), k)} binomial(j-1-floor(n/2), j) * euler(ceiling(n/2), k-j)) / 2, where euler(n,k) is the Eulerian number A173018 (not A008292, which has different indexing). - Robert A. Russell, Nov 15 2018

A128613 Triangle T(n,k) read by rows: number of permutations in [n] with exactly k ascents that have an odd number of inversions.

Original entry on oeis.org

0, 1, 0, 1, 2, 0, 0, 6, 6, 0, 0, 12, 36, 12, 0, 1, 29, 147, 155, 28, 0, 1, 64, 586, 1208, 605, 56, 0, 0, 120, 2160, 7800, 7800, 2160, 120, 0, 0, 240, 7320, 44160, 78000, 44160, 7320, 240, 0, 1, 517, 23893, 227569, 655315, 655039, 227623, 23947, 496, 0, 1, 1044, 76332, 1101420, 4869558, 7862124, 4868556, 1102068, 76305, 992, 0
Offset: 1

Views

Author

Ralf Stephan, May 08 2007

Keywords

Examples

			Triangle starts:
  0;
  1,   0;
  1,   2,    0;
  0,   6,    6,    0;
  0,  12,   36,   12,    0;
  1,  29,  147,  155,   28,    0;
  1,  64,  586,  120,  605,   56,   0;
  0, 120, 2160, 7800, 7800, 2160, 120, 0;
  ...
		

Crossrefs

Programs

  • Maple
    A008292 := proc(n,k) local j; add( (-1)^j*(k-j)^n*binomial(n+1,j),j=0..k) ; end: A049061 := proc(n,k) if k <= 0 or n <=0 or k > n then 0; elif n = 1 then 1 ; elif n mod 2 = 0 then A049061(n-1,k)-A049061(n-1,k-1) ; else k*A049061(n-1,k)+(n-k+1)*A049061(n-1,k-1) ; fi ; end: A128613 := proc(n,k) (A008292(n,n-k)-A049061(n,n-k))/2 ; end: for n from 1 to 11 do for k from 0 to n-1 do printf("%d,",A128613(n,k)) ; od: od: # R. J. Mathar, Nov 01 2007
    # second Maple program:
    b:= proc(u, o, i) option remember; expand(`if`(u+o=0, i,
           add(b(u+j-1, o-j, irem(i+u+j-1, 2)), j=1..o)*x+
           add(b(u-j, o+j-1, irem(i+u-j, 2)), j=1..u)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n-1))(b(n, 0$2)):
    seq(T(n), n=1..14);  # Alois P. Heinz, May 02 2017
  • Mathematica
    b[u_, o_, i_] := b[u, o, i] = Expand[If[u + o == 0, i, Sum[b[u + j - 1, o - j, Mod[i + u + j - 1, 2]], {j, 1, o}]*x + Sum[b[u - j, o + j - 1, Mod[i + u - j, 2]], {j, 1, u}]]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, n-1}]][b[n, 0,0]];
    Table[T[n], {n, 1, 14}] // Flatten (* Jean-François Alcover, Jul 25 2017, after Alois P. Heinz *)

Formula

a(n) = 1/2 * (A008292(n,k) - A049061(n,k)).
T(n,k) = 1/2 * (A008292(n,n-k) - A049061(n,n-k)), n>=1, 0<=kR. J. Mathar, Nov 01 2007

Extensions

Corrected and extended by R. J. Mathar, Nov 01 2007

A382309 Number of permutations of [2n] with exactly n ascents and an even number of inversions.

Original entry on oeis.org

1, 1, 5, 147, 7819, 655315, 81255642, 13985577438, 3191399514435, 932692830330915, 339781108888268398, 150979116192562395562, 80377829037419610855326, 50509994170589416909171726, 36995186973806250851237265812, 31240798437883511927927569474140
Offset: 0

Views

Author

Alois P. Heinz, Mar 21 2025

Keywords

Crossrefs

Formula

a(n) = A128612(2n,n).
a(n) ~ sqrt(3) * 2^(2*n) * n^(2*n) / exp(2*n). - Vaclav Kotesovec, Apr 02 2025
Showing 1-3 of 3 results.