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.

A326308 Number of inversion sequences of length n where all consecutive subsequences i,j,k satisfy i > j < k or i < j > k.

Original entry on oeis.org

1, 1, 2, 1, 3, 6, 26, 85, 476, 2171, 14905, 87153, 708825, 5053464, 47514180, 399542814, 4264132468, 41306091312, 493337571005, 5408829555639, 71476985762027, 874870165668858, 12673922434134249, 171294209823727623, 2699365743596908540, 39925463781029750810
Offset: 0

Views

Author

Alois P. Heinz, Oct 17 2019

Keywords

Examples

			a(6) = 26: 010101, 010102, 010103, 010104, 010105, 010201, 010202, 010203, 010204, 010205, 010212, 010213, 010214, 010215, 010301, 010302, 010303, 010304, 010305, 010312, 010313, 010314, 010315, 010323, 010324, 010325.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, j, t, u, c) option remember; `if`(n=0, 1, add(
          `if`(c>0 or i>j and t or ij), max(0, c-1)), 0), i=1..n))
        end:
    a:= n-> b(n, 0, true$2, 2):
    seq(a(n), n=0..25);
  • Mathematica
    b[n_, j_, t_, u_, c_] := b[n, j, t, u, c] = If[n == 0, 1, Sum[If[c>0 || i>j && t || ij, Max[0, c-1]], 0], {i, 1, n}]];
    a[n_] := b[n, 0, True, True, 2];
    a /@ Range[0, 25] (* Jean-François Alcover, Feb 29 2020, after Alois P. Heinz *)

Formula

a(n) ~ n! * c * 2^n / (Pi^n * sqrt(n)), where c = 1.0215796642504649172542599982453320786973706265645819484... - Vaclav Kotesovec, Oct 31 2019