OFFSET
0,3
COMMENTS
A cyclic Latin square is a Latin square in which row i is obtained by cyclically shifting row i-1 by d places.
Equivalently, a Latin square is cyclic if and only if each row is a cyclic permutation of the first row and each column is a cyclic permutation of the first column.
Every cyclic diagonal Latin square is a cyclic Latin square, so a(n) <= A338522(2*n+1).
Cyclic diagonal Latin squares exist only for odd orders not divisible by 3. - Andrew Howroyd, May 26 2021
LINKS
Eduard I. Vatutin, Enumerating cyclic Latin squares and Euler totient function calculating using them, High-performance computing systems and technologies, 2020, Vol. 4, No. 2, pp. 40-48. (in Russian)
Eduard I. Vatutin, Numerical formula between number of cyclic diagonal Latin squares and number of toroidal n-queens problem solutions getting by knight movement (in Russian).
E. I. Vatutin, Special types of diagonal Latin squares, Cloud and distributed computing systems in electronic control conference, within the National supercomputing forum (NSCF - 2022). Pereslavl-Zalessky, 2023. pp. 9-18. (in Russian)
FORMULA
a(n) = A123565(2*n+1) * (2*n+1)!.
a(n) = A370672(n) * (2n)!. - Eduard I. Vatutin, Mar 13 2024
EXAMPLE
For n=3 there are 6 cyclic Latin squares of order 7 with the first row in ascending order, only 4 of them are diagonal:
0 1 2 3 4 5 6 0 1 2 3 4 5 6 0 1 2 3 4 5 6 0 1 2 3 4 5 6
2 3 4 5 6 0 1 3 4 5 6 0 1 2 4 5 6 0 1 2 3 5 6 0 1 2 3 4
4 5 6 0 1 2 3 6 0 1 2 3 4 5 1 2 3 4 5 6 0 3 4 5 6 0 1 2
6 0 1 2 3 4 5 2 3 4 5 6 0 1 5 6 0 1 2 3 4 1 2 3 4 5 6 0
1 2 3 4 5 6 0 5 6 0 1 2 3 4 2 3 4 5 6 0 1 6 0 1 2 3 4 5
3 4 5 6 0 1 2 1 2 3 4 5 6 0 6 0 1 2 3 4 5 4 5 6 0 1 2 3
5 6 0 1 2 3 4 4 5 6 0 1 2 3 3 4 5 6 0 1 2 2 3 4 5 6 0 1
and 4*7! = 20160 cyclic diagonal Latin squares.
PROG
(PARI) a(n)={my(m=2*n+1); m!*if(gcd(m, 6)==1, sum(k=1, m, gcd(k^3-k, m)==1))} \\ Andrew Howroyd, Apr 30 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Eduard I. Vatutin, Nov 02 2020
EXTENSIONS
More terms from Andrew Howroyd, Apr 30 2021
Zero terms for even orders removed by Andrew Howroyd, May 26 2021
STATUS
approved