A343866 Number of inequivalent cyclic diagonal Latin squares of order 2n+1 up to rotations, reflections and permutation of symbols.
1, 0, 1, 1, 0, 2, 3, 0, 4, 4, 0, 5, 3, 0, 7, 7, 0, 2, 9, 0, 10, 10, 0, 11, 7, 0, 13, 4, 0, 14, 15, 0, 6, 16, 0, 17, 18, 0, 8, 19, 0, 20, 8, 0, 22, 10, 0, 8, 24, 0, 25, 25, 0, 26, 27, 0, 28, 10, 0, 14, 22, 0, 13, 31, 0, 32, 16, 0, 34, 34, 0, 20, 14, 0, 37, 37, 0, 14, 39, 0, 20
Offset: 0
Keywords
Examples
a(12) = 3 since there are A123565(25) = 10 cyclic diagonal Latin squares whose first row is in ascending order. Each of these is uniquely defined by the step between rows and form 5 pairs by horizontal or vertical reflection (negating the step between rows). Up to exchanging rows with columns there are 3 distinct classes, so a(12) = 3.
Programs
-
PARI
iscanon(n,k,g) = k <= vecmin(g*k%n) && k <= vecmin(g*lift(1/Mod(k,n))%n) a(n)={if(n==0, 1, my(m=2*n+1); sum(k=1, m-1, gcd(m,k)==1 && gcd(m,k-1)==1 && gcd(m,k+1)==1 && iscanon(m, k, [1,-1])))}
Formula
a((p-1)/2) = A341585((p-1)/2) for odd prime p.
Comments