OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..200
R. Ehrenborg, Cyclically consecutive permutation avoidance, arXiv:1312.2051 [math.CO], 2013.
FORMULA
a(n) = n! * Sum_{k=-oo..oo} (sqrt(3)/(2*Pi*(k+1/3)))^n for n >= 2.
a(n) = A080635(n-1)*n for n>0. - Alois P. Heinz, Dec 01 2013
EXAMPLE
a(4) = 12 comes from the 3 permutations 1324, 1423 and 1432, and by cyclically shifting we obtain 3 * 4 = 12 permutations.
MAPLE
b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
`if`(t<2, add(b(u+j-1, o-j, t+1), j=1..o), 0)+
add(b(u-j, o+j-1, 1), j=1..u))
end:
a:= n-> `if`(n=0, 1, n*b(0, n-1, 1)):
seq(a(n), n=0..25); # Alois P. Heinz, Dec 01 2013
MATHEMATICA
b[u_, o_, t_] := b[u, o, t] = If[u+o==0, 1, If[t<2, Sum[b[u+j-1, o-j, t+1], {j, 1, o}], 0] + Sum[b[u-j, o+j-1, 1], {j, 1, u}]];
a[n_]:= If[n==0, 1, n*b[0, n-1, 1]];
Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Aug 14 2017, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Richard Ehrenborg, Dec 01 2013
STATUS
approved