TOPICS
Search

Red and Black Knights Problem


The red and black knights problem asks for an explanation of the patterns generated by a deterministic greedy algorithm devised by J. Karlsson for placing two colors of chess knights on an infinite chessboard (Numberphile 2026). Label the cells 0, 1, 2, ... in a counterclockwise spiral, starting at the origin and first moving right. The first three cells have coordinates (0,0), (1,0), and (1,1), and the successive straight line runs have lengths 1, 1, 2, 2, 3, 3, ....

Starting with an empty chessboard, black and red take turns, with black moving first. At each turn, place a knight on the lowest-numbered unoccupied cell not attacked by a knight of the opposite color. A knight attacks the eight cells whose coordinates differ from its own by (+/-1,+/-2) or (+/-2,+/-1).

RedandBlackKnightsSteps

The first four placements occupy cells 0, 1, 2, and 3. On the fifth turn, black skips cell 4 because it is attacked by the red knight on cell 1, and occupies cell 5 instead. On the sixth turn, red occupies cell 4, since attacks between red knights are allowed. The panels show these first six placements; a gold outline marks the newest knight and gold rings mark the cells it attacks in the displayed region.

The knight graph encodes the same attack relation on a finite chessboard. The classical knights problem asks for the maximum number of mutually nonattacking knights on such a board. In the two-color construction, attacks between knights of the same color are allowed.

The labels occupied by black knights begin 0, 2, 5, 9, 11, 15, 20, 21, 30, 31, ... (OEIS A392177), while those occupied by red knights begin 1, 3, 4, 6, 10, 12, 24, 25, 34, 35, ... (OEIS A392178). Reading the placements in turn order and using negative labels for red gives 0, -1, 2, -3, 5, -4, 9, -6, 11, -10, ... (OEIS A395355). This turn order differs from reading the final occupied cells in increasing label order.

successive red and black knight placements and the growth of the occupied regions

The animation first shows individual placements and their attacks, then accelerates and zooms out to the 257×257 region.

Uncolored cells remain unoccupied. Placements continue outside each displayed region until neither color can subsequently occupy another cell within it. The large-scale computations linked from OEIS A392177 suggest red and black regions approaching the upper and lower half-planes, respectively, away from narrow bands near the coordinate axes. These finite computations do not establish the suggested asymptotic separation. Branicky et al. (2026) report a convergence proof.

Numberphile (2026) explains the two-color construction, while Numberphile2 (2026) presents additional patterns and variants.


See also

Chess, Greedy Algorithm, Knight Graph, Knights Problem

Explore with Wolfram|Alpha

References

Branicky, M. S.; Karlsson, J.; and Sloane, N. J. A. "Proof of Convergence of the Red and Black Knights Structure." Manuscript in preparation, May 14, 2026, cited in OEIS A392177.Numberphile. "Red & Black Knights (Extraordinary Result)." Featuring N. J. A. Sloane; video by B. Haran. May 12, 2026. https://www.youtube.com/watch?v=UiX4CFIiegM.Numberphile2. "Amazing Chessboard Patterns (Extra)." Featuring N. J. A. Sloane; video by B. Haran. May 13, 2026. https://www.youtube.com/watch?v=VgmDuBCayPw.Sloane, N. J. A. Sequences A392177, A392178, and A395355 in "The On-Line Encyclopedia of Integer Sequences."

Cite this as:

Weisstein, Eric W. "Red and Black Knights Problem." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/RedandBlackKnightsProblem.html

Subject classifications