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.

A362603 Number of permutations p of [2n] in which exactly the first n terms satisfy the up-down property p(1) < p(2) > p(3) < ... .

This page as a plain text file.
%I A362603 #23 Apr 29 2023 07:05:21
%S A362603 1,1,4,90,3024,176400,14731200,1710268560,261131270400,50881298307840,
%T A362603 12308045700787200,3620112665116147200,1272148028456410828800,
%U A362603 526419950201914728960000,253357552054376603817984000,140324455080520735061157120000,88618646911930055808757309440000
%N A362603 Number of permutations p of [2n] in which exactly the first n terms satisfy the up-down property p(1) < p(2) > p(3) < ... .
%H A362603 Alois P. Heinz, <a href="/A362603/b362603.txt">Table of n, a(n) for n = 0..234</a>
%F A362603 a(n) = (2*n)!/n! * (A000111(n) - A000111(n+1)/(n+1)) for n > 0, a(0) = 1.
%F A362603 a(n) = A092580(2n,n).
%e A362603 a(0) = 1: (), the empty permutation.
%e A362603 a(1) = 1: 21.
%e A362603 a(2) = 4: 1234, 1243, 1342, 2341.
%e A362603 a(3) = 90: 143256, 143265, 153246, 153264, ..., 564213, 564231, 564312, 564321.
%e A362603 a(4) = 3024: 13245678, 13245687, 13245768, 13245786, ..., 78456213, 78456231, 78456312, 78456321.
%p A362603 b:= proc(u, o) option remember; `if`(u+o=0, 1,
%p A362603       add(b(o-1+j, u-j), j=1..u))
%p A362603     end:
%p A362603 a:= n-> (2*n)!/n!*`if`(n=0, 1, b(n, 0)-b(n+1, 0)/(n+1)):
%p A362603 seq(a(n), n=0..19);
%o A362603 (Python)
%o A362603 from fractions import Fraction
%o A362603 from math import factorial
%o A362603 from itertools import count, islice, accumulate
%o A362603 def A362603_gen(): # generator of terms
%o A362603     yield 1
%o A362603     blist, c = (0,1), 1
%o A362603     for n in count(1):
%o A362603         blist, a, c = tuple(accumulate(reversed(blist),initial=0)), blist[-1], c*((n<<2)-2)
%o A362603         yield int(c*(a-Fraction(blist[-1],(n+1))))
%o A362603 A362603_list = list(islice(A362603_gen(),20)) # _Chai Wah Wu_, Apr 28 2023
%Y A362603 Cf. A000111, A001813, A092580.
%K A362603 nonn
%O A362603 0,3
%A A362603 _Alois P. Heinz_, Apr 27 2023