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.

A362581 Number of alternating permutations on [2n+1] with 1 in position n+1.

Original entry on oeis.org

1, 2, 6, 80, 1750, 64512, 3438204, 253913088, 24687555750, 3062092267520, 471565937953396, 88298062293762048, 19753693667117055100, 5203824518733863321600, 1594426273578194363292600, 562191171748426920367226880, 226024705816530632892282399750
Offset: 0

Views

Author

Alois P. Heinz, Apr 25 2023

Keywords

Examples

			a(0) = 1: 1.
a(1) = 2: 213, 312.
a(2) = 6: 23154, 24153, 25143, 34152, 35142, 45132.
		

Crossrefs

Programs

  • Maple
    b:= proc(u, o) option remember; `if`(u+o=0, 1,
          add(b(o-1+j, u-j), j=1..u))
        end:
    a:= n-> binomial(2*n, n)*b(n, 0)^2:
    seq(a(n), n=0..20);
  • Python
    from itertools import accumulate
    from math import comb
    def A362581(n):
        if n <= 1: return n+1
        blist = (0,1)
        for _ in range(n-1):
            blist = tuple(accumulate(reversed(blist),initial=0))
        return blist[-1]**2*comb(n<<1,n) # Chai Wah Wu, Apr 25 2023

Formula

a(n) = binomial(2*n,n)*A000111(n)^2:
a(n) = A104345(2*n,n).