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.

A180056 The number of permutations of {1,2,...,2n} with n ascents.

Original entry on oeis.org

1, 1, 11, 302, 15619, 1310354, 162512286, 27971176092, 6382798925475, 1865385657780650, 679562217794156938, 301958232385734088196, 160755658074834738495566, 101019988341178648636047412, 73990373947612503295166622044, 62481596875767023932367207962680
Offset: 0

Views

Author

Peter Luschny, Aug 08 2010

Keywords

Comments

Define the Eulerian numbers A(n,k) (see A008292) to be the number of permutations of {1,2,..,n} with k ascents: A(n,k) = Sum_{j=0..k} (-1)^j binomial(n+1,j)*(k-j+1)^n.
Then a(n) = A(2*n,n) are the central Eulerian numbers. (Analogous to what are called the central binomial coefficients).

Crossrefs

A bisection of A006551.
A diagonal of A321967.

Programs

  • Maple
    A180056 :=
    proc(n) local j;
      add((-1)^j*binomial(2*n+1,j)*(n-j+1)^(2*n),j=0..n)
    end:
    # A180056_list(m) returns [a_0,a_1,..,a_m]
    A180056_list :=
      proc(m) local A, R, M, n, k;
        R := 1; M := m + 1;
        A := array([seq(1, n = 1..M)]);
        for n from 2 to M do
          for k from 2 to M do
            if n = k then R := R, A[k] fi;
            A[k] := n*A[k-1] + k*A[k]
          od
        od;
      R
    end:
  • Mathematica
    A025585[n_] := Sum[(-1)^j*(n-j)^(2*n-1)*Binomial[2*n, j], {j, 0, n}]; a[0] = 1; a[n_] := A025585[n+1]/(2*n+2); Table[a[n], {n, 0, 13}] (* Jean-François Alcover, Jun 28 2013, after Gary Detlefs *)
    << Combinatorica`; Table[Combinatorica`Eulerian[2 n, n], {n, 0, 20}] (* Vladimir Reshetnikov, Oct 15 2016 *)
  • Python
    def A180056_list(m):
        ret = [1]
        M = m + 1
        A = [1 for i in range(0, M)]
        for n in range(2, M):
            for k in range(2, M):
                if n == k:
                    ret.append(A[k])
                A[k] = n*A[k-1] + k*A[k]
        return ret

Formula

a(n-1) = A025585(n)/(2*n). - Gary Detlefs, Nov 11 2011
a(n+1)/a(n) ~ 4*n^2. - Ran Pan, Oct 26 2015
a(n) ~ sqrt(3) * 2^(2*n+1) * n^(2*n) / exp(2*n). - Vaclav Kotesovec, Oct 16 2016
From Alois P. Heinz, Jul 21 2018: (Start)
a(n) = ceiling(1/2 * (2n)! * [x^(2n) y^n] (exp(x)-y*exp(y*x))/(exp(y*x)-y*exp(x))).
a(n) = (2n)! * [x^(2n) y^n] (1-y)/(1-y*exp((1-y)*x)). (End)
a(n) = A123125(2n,n). - Alois P. Heinz, Nov 13 2024

Extensions

Partially edited by N. J. A. Sloane, Aug 08 2010

A303284 Number of permutations p of [n] such that the sequence of ascents and descents of 0p or of 0p0 (if n is odd) forms a Dyck path.

Original entry on oeis.org

1, 1, 1, 4, 8, 60, 172, 1974, 7296, 114972, 518324, 10490392, 55717312, 1384890104, 8460090160, 250150900354, 1726791794432, 59317740001132, 456440969661508, 17886770092245360, 151770739970889792, 6687689652133397064, 62022635037246022000, 3037468107154650475868
Offset: 0

Views

Author

Alois P. Heinz, Apr 20 2018

Keywords

Examples

			a(0) = 1: the empty permutation.
a(1) = 1: 1.
a(2) = 1: 21.
a(3) = 4: 132, 213, 231, 312.
a(4) = 8: 1432, 2143, 2431, 3142, 3241, 3421, 4132, 4231.
		

Crossrefs

Bisections give: A303285 (even part), A303286 (odd part).

Programs

  • Maple
    b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
          `if`(t>0,   add(b(u-j, o+j-1, t-1), j=1..u), 0)+
          `if`(o+u>t, add(b(u+j-1, o-j, t+1), j=1..o), 0))
        end:
    a:= n-> b(0, n, 0):
    seq(a(n), n=0..25);
  • Mathematica
    b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, 1, If[t > 0, Sum[b[u - j, o + j - 1, t - 1], {j, 1, u}], 0] + If[o + u > t, Sum[b[u + j - 1, o - j, t + 1], {j, 1, o}], 0]];
    a[n_] := b[0, n, 0];
    Table[a[n], {n, 0, 25}] (* Jean-François Alcover, May 25 2018, translated from Maple *)
  • PARI
    b(u, o, t) = if(u+o==0, 1, if(t > 0, sum(j=1, u, b(u-j, o+j-1, t-1)), 0) + if(o+u > t, sum(j=1, o, b(u+j-1, o-j, t+1)), 0))
    a(n) = b(0, n, 0) \\ Felix Fröhlich, May 25 2018, adapted from Mathematica

Formula

a(2n) = A303287(2n).
Showing 1-2 of 2 results.