For which a and b does latin square exist?

35 Views Asked by At

Latin square $L$ is an $n\times n$ array filled with $n$ different symbols, each occurring exactly once in each row and exactly once in each column.

Les us $L = l_{ij} = (a i + b j) \mod n$

For which $a,b$ is $L$ really a latin square?

It is easy to say, that for $a=b=1$ is true, but how to describe all possible values of $a,b$?

1

There are 1 best solutions below

0
On

As indicated in Berci's comment, it is necessary that $\gcd(a,n)=\gcd(b,n)=1$. This condition is also sufficient.

To prove this equivalence, it is enough to show that the number of distinct symbols in each row is $\frac{n}{\gcd(b,n)}$ and the number of distinct symbols in each column is $\frac{n}{\gcd(a,n)}$.