8 Queens problem

The 8 queens problem is a well known mathematical challenge. in an 8x8 chess board, how many ways can you place 8 queens in the board without them threatening each other?

In case you forgot, in chess, the queen can move itself diagonaly (like a bishop) or in a straight line (like a tower)

Mathematicians, keen on generalisation, expanded it to: on an n x n board, how many ways can n queens be placed on the board without them threatening each other?

When a queen occupies a square, it blocks both horizontal and vertical directions, as well as both diagonals (only one if it is in a corner).

In 1850, F. Nauck showed 92 ways to place 8 queens on an 8x8 board but couldn't prove there were not more, a proof which came later. On a 15x15 board, the number of ways to place 15 queens is 2,279,184. It grows fast!

The image above shows one of the 92 solutions for the 8-Queens Problem. Rotating the board, from this you obtain 4 solutions. And reflecting on a mirror each of the 4, you obtain 8 solutions.

Wikipedia's page on the n-queens problem

Andrei Taylor's Article on how to solve the problem computaionaly using Backtracking, which can be summarized as a technique to quickly eliminate (backtrack) the candidates that don't solve the problem; it's a quick (around 10 mins) and fluid read