Skip to content
TopicTracker
From HackerNewsView original
TranslationTranslation

Queens on a Prime Order Board

The article discusses a mathematical problem involving placing queens on a chessboard of prime order so that no two queens attack each other, exploring connections between the n-queens problem and modular arithmetic on prime-sized boards.

Background

- The "eight queens puzzle" is a classic chess problem: place eight queens on a standard 8×8 board so that none attack each other. This post generalizes it to prime-sized boards (e.g., 5×5, 7×7, 11×11) and explores a link to modular arithmetic and number theory. - A known result (proved by Pólya) says that when the board size is a prime number greater than 3, there is a simple formula for placing the queens — placing queen in row *r* at column 2*r* mod *p* (or 2*r*+1). The post checks whether that formula works for several small primes and discusses a near-miss at *p*=5. - John D. Cook is a long-running math and programming blogger who often writes clear, applied explanations of obscure mathematical facts. No specialized math background is needed beyond basic chess rules and what a prime number is.

Related stories

  • The article explains that for the n queens problem on an n × n board, when n is a prime number ≥ 5, a valid solution can be found by placing queens on a line with slope 2, 3, 4, and so on.

  • The author describes using Claude (an LLM) to generate Z3/Python code that solves a chess puzzle: placing all pieces (king, queen, two rooks, two bishops, two knights) on a 6x5 board. This follows previous posts where Claude and ChatGPT were used to generate Prolog code for similar chess problems.