OFFSET
0,2
COMMENTS
There are no such permutations of (1,2,...,2n).
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..90
EXAMPLE
Consider the permutation (for n = 3): 3,4,5,2,7,6,1. The signs of the differences between adjacent terms form the sequence: ++-+--, which is the negative of its reversal. So this permutation, among others, is counted when n = 3.
PROG
(PARI) { a(n) = my(s, c, r); s=0; forvec(t=vector(n\2, i, [0, 2]), c=0; r=[]; for(j=1, #t, if(t[j]==0, c++, if(t[j]==1, r=concat(r, [j]), r=concat(r, [n-j])); ); ); r=vecsort(r); s+=(-2)^c*if(#r, n!/(r[1]!*prod(j=1, #r-1, (r[j+1]-r[j])!)*(n-r[ #r])!), 1) ); s } /* Max Alekseyev */
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Feb 10 2008, Feb 14 2008
EXTENSIONS
First 4 terms calculated by Olivier Gérard
Edited and extended by Max Alekseyev, May 09 2009
STATUS
approved