OFFSET
1,3
COMMENTS
a(n) is also the number of permutations of [n+1] starting and ending with an even number. - Olivier GĂ©rard, Nov 07 2011
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..400
FORMULA
a(n) = ceiling(n/2)*ceiling(n/2-1)*(n-1)!. Proof: There are ceiling(n/2) * ceiling(n/2-1) pairs (r, s) with r and s odd and distinct. For each pair, there are n-1 places it can occur in a permutation and (n-2)! possible arrangements of the other numbers.
a(n) = (n-1)!*(2*n*(n-1)-(2*n-1)*(-1)^n-1)/8. - Bruno Berselli, Nov 07 2011
Sum_{n>=3} 1/a(n) = 4*(CoshIntegral(1) - gamma - sinh(1) + 1) = 4*(A099284 - A001620 - A073742 + 1). - Amiram Eldar, Jan 22 2023
EXAMPLE
For n=4, the a(4) = 12 permutations of degree 5 starting and ending with an even number are 21354, 21534, 23154, 23514, 25134, 25314, 41352, 41532, 43152, 43512, 45132, 45312.
MATHEMATICA
Table[Ceiling[n/2] Ceiling[n/2 - 1] (n - 1)!, {n, 22}] (* Michael De Vlieger, Aug 20 2017 *)
PROG
(Magma) [Factorial(n-1)*(2*n*(n-1)-(2*n-1)*(-1)^n-1)/8 : n in [1..30]]; // Vincenzo Librandi, Nov 16 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved