The queens problem asks for the maximum number of queens that can be placed on an chessboard
such that no two attack one another, where
is a positive integer.
The answer is
queens for
or
and
queens otherwise, which gives eight queens for the usual
board (Madachy 1979; Steinhaus
1999, p. 29). The number of different ways the
queens can be placed on an
chessboard so that no
two queens may attack each other for the first few
are 1, 0, 0, 2, 10, 4, 40, 92, ... (OEIS A000170;
Madachy 1979; Steinhaus 1999, p. 29). The number of rotationally and reflectively
distinct solutions of these are 1, 0, 0, 1, 2, 1, 6, 12, 46, 92, ... (OEIS A002562;
Dudeney 1970, p. 96). The 12 distinct solutions for
are illustrated above, and the remaining 80 are generated
by rotation and reflection
(Madachy 1979, Steinhaus 1999).
Write
for the number of placements of
nonattacking queens on the ordinary
chessboard, counting
all placements before identifying any by rotation or
reflection. Simkin (2023) proved that
as
, where
.
The peaceable queens problem allows queens of the same color to attack one another and maximizes the size of two equally sized armies, with no queen attacking one of the opposite color.
The minimum number of queens needed to occupy or attack all squares of an chessboard (i.e., domination numbers for the
queen graphs) are given
for
, 2, ... by 1, 1, 1, 2, 3, 3, 4, 5, 5, 5, 5, 6, 7,
8, 9, 9, 9, 9, 10, ... (OEIS A075458), where
Steinhaus (1999, p. 29) notes
.
For five queens on an
board, there are 4860 arrangements that occupy or attack every square, or 638 up
to rotation and reflection
(Steinhaus 1999, p. 29).
The following table gives the numbers of arrangements of
queens on an
chessboard that occupy
or attack every square and in which every queen is attacked ("protected")
by at least one other. Arrangements related by rotation
or reflection are counted as equivalent. These arrangements
correspond to total dominating sets of the
queen graph.
| 2 | 4 | 3 |
| 3 | 5 | 15 |
| 3 | 6 | 0 |
| 4 | 7 | 5 |
| 5 | 8 | 56 |
Dudeney (1970, pp. 95-96) gave the following numbers of arrangements of
queens on an
chessboard that occupy
or attack every square and in which no two queens attack one another (they are "not
protected"), again up to rotation and reflection.
These arrangements correspond to independent
dominating sets of the queen graph.
| 1 | 2 | 1 |
| 1 | 3 | 1 |
| 3 | 4 | 2 |
| 3 | 5 | 2 |
| 4 | 6 | 17 |
| 4 | 7 | 1 |
| 5 | 8 | 91 |
The toroidal problem identifies opposite edges of the chessboard to form a
torus, allowing attacks to wrap around the board. Write
for the full count of placements
of
nonattacking queens on this board. Pólya (1918) showed that
exactly when
. For odd
, the counts are 1, 0, 10, 28, 0, 88, ... (OEIS A007705).
Bowtell and Keevash (2021) proved that
as
through
.
Vardi (1991) also considers the toroidal "semiqueens" problem, in which a semiqueen can move like a rook or bishop, but in only one direction of wrapped
diagonals. The number of solutions to this problem for queens with
odd are 1, 3, 15, 133, 2025,
37851, ... (OEIS A006717), and 0 for even
.
For arbitrary placements of queens on an
chessboard, with no
restriction on attacks, the number of arrangements up to rotation
and reflection is given by the Cauchy-Frobenius
lemma. For an integer
with
, it equals one
eighth of the coefficient of
in the polynomial
(Velucchi)
|
(1)
|
Velucchi also considers the nondominating queens problem, which consists of placing queens on an order
chessboard to leave a maximum
number
of unattacked vacant cells. The first few values are 0, 0, 0, 1, 3, 5, 7, 11, 18,
22, 30, 36, 47, 56, 72, 82, ... (OEIS A001366).
The results can be generalized to
queens on an
board.
Ago et al. (2026) solved the variant in which each queen may attack at most one other queen. If
is the maximum number of queens on an
chessboard under this
rule, then
|
(2)
|
where
is the floor function. When each queen must attack
exactly one other queen, the maximum is 0, 2, 2, 4, and 4 for
, 2, 3, 4, and 5, respectively, and
for
(Ago et al. 2026).
For the modular -dimensional
version, a queen occupies a point of
and attacks along every line in a direction from
. For integers
and
, a placement of
mutually nonattacking queens exists iff
every prime factor of
exceeds
(Halberstam et al. 2026). In three dimensions this
is equivalent to
. The sufficient placement
consists of the solutions of
.
The new result proves necessity of the prime-factor restriction for arbitrary placements,
not just for this classical affine construction. The theorem concerns line attacks
on the modular board.
Halberstam et al. (2026) credit Codex with developing the necessity argument from their partial work with the discrete Fourier transform and exact certificates, which the authors reinterpreted and checked.