N = 4
- Input
- tabuleiro 4x4
- Expected output
- 2 soluções, 1 fundamental
The two are mirrors of each other. You can solve it on paper: b4 d3 a2 c1 and c4 a3 d2 b1.
Eight Queens Puzzle (and N Queens)
n queens problem
The N queens problem asks you to place N queens on an N x N board so that none attacks another. It has a solution for N = 1 and for every N from 4 up; for N = 2 and N = 3 there are none.
The two are mirrors of each other. You can solve it on paper: b4 d3 a2 c1 and c4 a3 d2 b1.
Fewer solutions than 5x5, which has 10. A single family of 4 boards.
The tool's counter reaches that total in a few seconds in the browser.
There are 92 solutions on the 8x8 board. If rotations and reflections count as the same, 12 fundamental solutions remain (OEIS A002562). Eleven of them generate 8 solutions each and one, symmetric under a 180 degree turn, generates only 4: 11 x 8 + 4 = 92.
None in the game. In Brazilian Portuguese the chess piece is called dama, while computing books usually call the problem "N rainhas". It is the same problem.
No closed formula is known. The values come from computer counting and are in OEIS sequence A000170.
It plays and counts from N = 4 to 14. Browsing solutions one by one goes up to N = 12.
0 of 8 queens on the board. 0 placements and 0 removals so far.
| N | Computed here | OEIS A000170 | Fundamental (A002562) | Time |
|---|---|---|---|---|
| Press Count to compute. | ||||
The count uses bitmasks and explores only half of the first row, doubling by the mirror. The fundamental column comes from the OEIS table (checked here by enumeration up to N = 11).
Everything runs in your browser: your moves and calculations are not sent to any server.