A137783 a(n) = the number of permutations (p(1), p(2), ..., p(2n+1)) of (1, 2, ..., 2n+1) where, for each k (2 <= k <= 2n+1), the sign of (p(k) - p(k-1)) equals the sign of (p(2n+2-k) - p(2n+3-k)).
1, 4, 44, 1028, 40864, 2484032, 214050784, 24831582176, 3731039384576, 704879630525696, 163539441616948736, 45712130697710081024, 15150993151215400441856, 5875388829103413298173952, 2635427286694074346846232576, 1353918066433734600362650169344
Offset: 0
Keywords
Examples
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.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..90
Programs
-
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 */
Extensions
First 4 terms calculated by Olivier Gérard
Edited and extended by Max Alekseyev, May 09 2009
Comments