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.

A303159 Number of permutations p of [2n+1] such that 0p has exactly n+1 alternating runs.

Original entry on oeis.org

1, 3, 43, 1344, 74211, 6384708, 789649750, 132789007200, 29145283614115, 8092186932120060, 2772830282722806978, 1149343084932146388144, 566844242187778610648334, 328043720353943611689811272, 220147053200818211779539712908, 169580070210721829547034445169024
Offset: 0

Views

Author

Alois P. Heinz, Apr 19 2018

Keywords

Examples

			a(1) = 3: 132, 231, 321.
		

Crossrefs

Bisection (odd part) of A303160.
Cf. A186370.

Programs

  • Maple
    b:= proc(n, k) option remember; `if`(k=0,
          `if`(n=0, 1, 0), `if`(k<0 or k>n, 0,
           k*b(n-1, k)+b(n-1, k-1)+(n-k+1)*b(n-1, k-2)))
        end:
    a:= n-> b(2*n+1, n+1):
    seq(a(n), n=0..20);
  • Mathematica
    b[n_, k_] := b[n, k] = If[k == 0,
        If[n == 0, 1, 0], If[k < 0 || k > n, 0,
        k b[n-1, k] + b[n-1, k-1] + (n-k+1) b[n-1, k-2]]];
    a[n_] := b[2n+1, n+1];
    a /@ Range[0, 20] (* Jean-François Alcover, Dec 21 2020, after Alois P. Heinz *)

Formula

a(n) = A186370(2n+1,n+1).
a(n) ~ c * d^n * n!^2, where d = 3.4210546206711870249402157940795853513031388... and c = 0.974460718185930534652526741942010711752... - Vaclav Kotesovec, Apr 29 2018