|
|
A152661
|
|
Number of permutations of [n] for which the first two entries have the same parity (n>=2).
|
|
1
|
|
|
0, 2, 8, 48, 288, 2160, 17280, 161280, 1612800, 18144000, 217728000, 2874009600, 40236134400, 610248038400, 9763968614400, 167382319104000, 3012881743872000, 57621363351552000, 1152427267031040000, 24329020081766400000, 535238441798860800000
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
2,2
|
|
COMMENTS
|
a(n) is also the number of 3-term arithmetic progressions of consecutive entries in all permutations of {1,2,...,n}. Example: a(4)=8 because we have 12'3'4, 412'3, 143'2, 23'41, 32'14, 43'2'1 (the mid-terms of the arithmetic progressions are marked). [Emeric Deutsch, Aug 31 2009]
|
|
LINKS
|
|
|
FORMULA
|
a(2n) = 2*(n!)^2*binomial(2*n-2,n);
a(2n+1) = n!*(n+1)!*binomial(2n,n-1).
Conjecture: (-n+3)*a(n) +2*(n-2)*a(n-1) +(n-1)*(n-2)*(n-3)*a(n-2)=0. - R. J. Mathar, Apr 20 2015
|
|
EXAMPLE
|
a(4)=8 because we have 1324, 1342, 3124, 3142, 2413, 2431, 4213 and 4231.
|
|
MAPLE
|
a := proc (n) if `mod`(n, 2) = 0 then 2*factorial((1/2)*n)^2*binomial(n-2, (1/2)*n) else factorial((1/2)*n-1/2)*factorial((1/2)*n+1/2)*binomial(n-1, (1/2)*n-3/2) end if end proc: seq(a(n), n = 2 .. 22);
|
|
MATHEMATICA
|
a[n0_?EvenQ] := With[{n = n0/2}, 2 (n!)^2*Binomial[2*n - 2, n]];
a[n1_?OddQ] := With[{n = (n1 - 1)/2}, n! (n + 1)! Binomial[2 n, n - 1]];
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|