# $n$ groups of $n$ queens on a toroidal chessboard

An interesting question came up in the Puzzling Stack Exchange a few days ago about "queen-connected sets". When trying to solve this problem, I came across an arrangement of five colours of queens that would not attack each other on a toroidal 5×5 chessboard, and discovered that 4 queens could be placed into two non-attacking groups but not four individual ones.

Let a queen number be a number $n$ where there exists an arrangement of $n$ colours of $n$ queens that are placed on an $n \times n$ chessboard, such that no queen can attack a queen of the same colour, including through broken diagonals.

5 is the smallest queen number, and the arrangement I found is the one where all of them are a knight's move away from each other:

1 2 3 4 5
3 4 5 1 2
5 1 2 3 4
2 3 4 5 1
4 5 1 2 3


I haven't come across a way to prove that 6 is not a queen number, although I suspect that's true. I also tried making an arrangement for 10 just now using the same method that I used for 5, but it didn't work:

1234567890
4567890123
7890123456
0123456789
3456789012
6789012345
9012345678
2345678901
5678901234
8901234567


If you notice, every queen attacks the next queen 5 squares right and 5 squares down. But I don't know if there is another arrangement that does work.

Is there any way to determine the set of queen numbers without going through every arrangement to verify that it solves the problem?

• If the problem were about rooks, you would be talking about Latin squares, of which there is much literature. Queen problems on various boards have been considered. Try a web search and tell us what you find. Gerhard "Studying Boards Made Of Hexagons" Paseman, 2015.10.08 – Gerhard Paseman Oct 8 '15 at 18:20
• The problem is equivalent if you just ask about 1 color, since positions of the remaining n-1 colors may be obtained by translation symmetry simply by shifting the pattern, as is readily apparent in your 5x5 example. – user00000 Oct 8 '15 at 19:09
• $6$ is not a queen number. To see this, just notice that you have to place some queen in the top square of the first column. You then have only three choices for the queen of the same color in the next column. Each of these three choices leads pretty quickly to a contradiction. – Will Brian Oct 8 '15 at 19:56