login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Number of parity alternating permutations of [n] avoiding descents from odd to even numbers.
5

%I #20 Oct 30 2021 13:45:24

%S 1,1,2,1,5,2,20,6,114,24,864,120,8280,720,96480,5040,1325520,40320,

%T 20966400,362880,374855040,3628800,7468070400,39916800,163938297600,

%U 479001600,3929729126400,6227020800,102104460057600,87178291200,2857878742118400,1307674368000

%N Number of parity alternating permutations of [n] avoiding descents from odd to even numbers.

%H Alois P. Heinz, <a href="/A199660/b199660.txt">Table of n, a(n) for n = 0..300</a>

%F a(0) = 1, a(2*n) = (2^n+n-1)*(n-1)! for n>0, a(2*n+1) = n!.

%e a(4) = 5: (1,2,3,4), (2,1,4,3), (2,3,4,1), (3,4,1,2), (4,1,2,3).

%e a(5) = 2: (1,2,3,4,5), (3,4,1,2,5).

%p a:= n-> `if`(n=0, 1, `if`(irem(n, 2, 'r')=0, (2^r+r-1)*(r-1)!, r!)):

%p seq(a(n), n=0..35);

%t a[n_] := If[n == 0, 1, With[{r = Quotient[n, 2]},

%t If[Mod[n, 2] == 0, (2^r+r-1)(r-1)!, r!]]];

%t Table[a[n], {n, 0, 35}] (* _Jean-François Alcover_, Oct 30 2021, after _Alois P. Heinz_ *)

%Y Bisection gives: A052850 (even part, n>0), A000142 (odd part).

%Y Column k=0 of A232187.

%Y Cf. A285672.

%K nonn,easy

%O 0,3

%A _Alois P. Heinz_, Nov 08 2011