OFFSET
0,3
COMMENTS
Number of order n permutations whose descent set is invariant w.r.t. the function f(x) = n-x. - Max Alekseyev, May 06 2009
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..190
FORMULA
EXAMPLE
Consider the permutation (for n = 7): 3,6,7,5,1,2,4.
The signs of the differences between adjacent terms form the sequence: ++--++, which has reflective symmetry. So this permutation, among others, is counted when n = 7.
MAPLE
b:= proc(u, o, h) option remember; `if`(u+o=0, 1,
add(add(b(u-j, o+j-1, h+i-1), i=1..u+o-h), j=1..u)+
add(add(b(u+j-1, o-j, h-i), i=1..h), j=1..o))
end:
a:= proc(n) option remember; local r;
`if`(irem(n, 2, 'r')=0, b(0, r$2)*binomial(n, r),
add(add(binomial(j-1, i)*binomial(n-j, r-i)*
b(r-i, i, n-j-r+i), i=0..min(j-1, r)), j=1..n))
end:
seq(a(n), n=0..30); # Alois P. Heinz, Sep 15 2015
MATHEMATICA
b[u_, o_, h_] := b[u, o, h] = If[u+o == 0, 1, Sum[Sum[b[u-j, o+j-1, h+i-1], {i, 1, u+o-h}], {j, 1, u}] + Sum[Sum[b[u+j-1, o-j, h-i], {i, 1, h}], {j, 1, o}]];
a[n_] := a[n] = Module[{r = Quotient[n, 2]}, If[Mod[n, 2] == 0, b[0, r, r]*Binomial[n, r], Sum[Sum[Binomial[j-1, i]*Binomial[n-j, r-i]*b[r-i, i, n-j-r+i], {i, 0, Min[j-1, r]}], {j, 1, n}]]];
Table[a[n], {n, 0, 30}] (* Jean-François Alcover, May 13 2019, after Alois P. Heinz *)
PROG
(PARI) { a(n) = local(r, u, c, t); r=0; forvec(v=vector(n-1, i, [2*i==n, 1]), u=sum(i=1, #v, v[i]); c=sum(i=1, (n-1)\2, !v[i]&&!v[n-i]); t=[0]; for(i=1, #v, if(v[i], t=concat(t, [i]))); r += (-1)^u * 2^c * n! \ prod(i=2, #t, (t[i]-t[i-1])!) \ (n-t[ #t])! ); (-1)^(n+1)*r } \\ Max Alekseyev, May 06 2009
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Feb 10 2008
EXTENSIONS
First 8 terms calculated by Olivier Gérard
Extended by Max Alekseyev, May 06 2009
a(0), a(22) from Alois P. Heinz, Jul 02 2015
a(23) from Alois P. Heinz, Sep 15 2015
STATUS
approved