OFFSET
3,2
COMMENTS
Circular permutations are permutations whose indices are from the ring of integers modulo n. Modular 3-sequences are of the following form: i,i+1,i+2, where arithmetic is modulo n.
REFERENCES
Wayne M. Dymacek, Isaac Lambert and Kyle Parsons, Arithmetic Progressions in Permutations, http://math.ku.edu/~ilambert/CN.pdf, 2012. - N. J. A. Sloane, Sep 15 2012
LINKS
Max Alekseyev, Table of n, a(n) for n = 3..100
FORMULA
This sequence can be related to A165961 by the use of auxiliary sequences (and the auxiliary sequences can themselves be calculated by recurrence relations).
EXAMPLE
For n=4 the a(4)=5 solutions are (0,1,3,2), (0,2,1,3), (0,2,3,1), (0,3,1,2) and (0,3,2,1).
MATHEMATICA
f[i_, n_, k_]:=If[i==0&&k==0, 1, If[i==n&&n==k, 1, Binomial[k-1, k-i]*Binomial[n-k-1, k-i-1]+2*Binomial[k-1, k-i-1]*Binomial[n-k-1, k-i-1]+Binomial[k-1, k-i-1]*Binomial[n-k-1, k-i]]];
w1[i_, n_, k_]:=If[n-2k+i<0, 0, If[n-2k+i==0, 1, (n-2k+i-1)!]];
a[n_, k_]:=Sum[f[i, n, k]*w1[i, n, k], {i, 0, k}];
A165962[n_]:=(n-1)!+Sum[(-1)^k*a[n, k], {k, 1, n}];
Table[A165962[n], {n, 3, 23}] (* David Scambler, Sep 18 2012 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Isaac Lambert, Oct 01 2009
STATUS
approved