login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A199660 Number of parity alternating permutations of [n] avoiding descents from odd to even numbers. 5
1, 1, 2, 1, 5, 2, 20, 6, 114, 24, 864, 120, 8280, 720, 96480, 5040, 1325520, 40320, 20966400, 362880, 374855040, 3628800, 7468070400, 39916800, 163938297600, 479001600, 3929729126400, 6227020800, 102104460057600, 87178291200, 2857878742118400, 1307674368000 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
FORMULA
a(0) = 1, a(2*n) = (2^n+n-1)*(n-1)! for n>0, a(2*n+1) = n!.
EXAMPLE
a(4) = 5: (1,2,3,4), (2,1,4,3), (2,3,4,1), (3,4,1,2), (4,1,2,3).
a(5) = 2: (1,2,3,4,5), (3,4,1,2,5).
MAPLE
a:= n-> `if`(n=0, 1, `if`(irem(n, 2, 'r')=0, (2^r+r-1)*(r-1)!, r!)):
seq(a(n), n=0..35);
MATHEMATICA
a[n_] := If[n == 0, 1, With[{r = Quotient[n, 2]},
If[Mod[n, 2] == 0, (2^r+r-1)(r-1)!, r!]]];
Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Oct 30 2021, after Alois P. Heinz *)
CROSSREFS
Bisection gives: A052850 (even part, n>0), A000142 (odd part).
Column k=0 of A232187.
Cf. A285672.
Sequence in context: A194092 A140165 A185131 * A367671 A141483 A230038
KEYWORD
nonn,easy
AUTHOR
Alois P. Heinz, Nov 08 2011
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 10:38 EDT 2024. Contains 371791 sequences. (Running on oeis4.)