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.

A185652 Number of permutations of [n] having a shortest ascending run of length 2.

Original entry on oeis.org

0, 0, 1, 0, 5, 18, 89, 519, 3853, 27555, 233431, 2167152, 21596120, 232817282, 2718706924, 33814848445, 448311181346, 6319365554730, 94225534689624, 1481940898130323, 24536143182460549, 426432943716156580, 7762187693343502658, 147704506384475066381
Offset: 0

Views

Author

Alois P. Heinz, Aug 29 2013

Keywords

Examples

			a(2) = 1: 12.
a(4) = 5: 1324, 1423, 2314, 2413, 3412.
a(5) = 18: 12435, 12534, 13245, 13425, 13524, 14235, 14523, 15234, 23145, 23415, 23514, 24135, 24513, 25134, 34125, 34512, 35124, 45123.
		

Crossrefs

Column k=2 of A064315.
Cf. A086089 (3*sqrt(3)/(2*Pi)).

Programs

  • Mathematica
    A[n_, k_] := A[n, k] = Module[{b}, b[u_, o_, t_] := b[u, o, t] = If[t + o <= k, (u + o)!, Sum[b[u + i - 1, o - i, Min[k, t] + 1], {i, 1, o}] + If[t <= k, u (u + o - 1)!, Sum[b[u - i, o + i - 1, 1], {i, 1, u}]]]; Sum[b[j - 1, n - j, 1], {j, 1, n}]];
    a[n_] := A[n, 2] - A[n, 1];
    Table[a[n], {n, 0, 23}] (* Jean-François Alcover, Oct 26 2021, after Alois P. Heinz in A064315 *)

Formula

a(n) ~ c * (3*sqrt(3)/(2*Pi))^n * n!, where c = 0.45178068752734823... . - Vaclav Kotesovec, Sep 06 2014