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.

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

Original entry on oeis.org

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

Views

Author

Emeric Deutsch, Nov 11 2008

Keywords

Comments

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

Examples

			T(4,2) = 6 because we have 1432, 3142, 3214, 4312, 4231 and 3421.
Triangle begins with T(1,1):
    0
    1
    2     1
    6     6
   12    36      12
   28   155     147      29       1
   56   605    1208     586      64       1
  120  2160    7800    7800    2160     120
  240  7320   44160   78000   44160    7320     240
  496 23947  227623  655039  655315  227569   23893   517    1
  992 76305 1102068 4868556 7862124 4869558 1101420 76332 1044 1
		

Crossrefs

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; 0; for n to 11 do seq(coeff(P[n], t, j), j = 1 .. ceil((1/2)*binomial(n, 2))-ceil((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->`if`(n=1, 0, (p->seq(coeff(p, x, i), i=1..degree(p)))
           (add(b(j-1, n-j, irem(j+1, 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_] := If[n == 1, 0, Function[{p}, Table[Coefficient[p, x, i], {i, 1, Exponent[p, x]}]][Sum[ b[j-1, n-j, Mod[j+1, 2]], {j, 1, n}]]]; Table[T[n], {n, 1, 12}] // Flatten (* Jean-François Alcover, May 28 2015, after Alois P. Heinz *)
    Needs["Combinatorica`"];
    Join[{0}, Table[(Eulerian[n, k] - Sum[Binomial[j-1-Floor[n/2], j] Eulerian[Ceiling[n/2], k-j], {j, Max[0, k+1-Ceiling[n/2]], Min[Floor[n/2], k]}])/2, {n, 2, 15}, {k, 1, n}] // Flatten // DeleteCases[0]] (* Robert A. Russell, Nov 16 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 odd 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 16 2018