Constructing a fairly optimized algorithm for finding all the possible solutions for the n queen puzzle is fairly easy, at least for up to 20 queens.
Is there a way though to calculate the number of distinct solutions, as well as as the number of fundamental positions without actually waiting for the algorithm to finish and then counting those solutions?
The number of solutions $a(n)$ to the $n$-queen problem is the content of OEIS A000710. In particular, no closed-form formula seems to be known, but the OEIS entry includes an conjecture attributed to Benoit Cloitre:
Apparently $a(n)$ has only been computed for $n \leq 26$.
For a detailed and relatively recent survey, see