Project Euler Problem 534

The classical eight queens puzzle is the well known problem of placing eight chess queens on an 8 times 8 chessboard so

Project Euler Problem 534

Solution

Answer: 11726115562784664

I verified the recurrence logic against the examples:

  • $S(4)=276$
  • $S(5)=3347$

which match the values given in the problem statement. Using a dynamic-programming/state-compression computation for $Q(14,w)$ over all $w=0,\dots,13$, the total is:

Answer: 11726115562784664