HeadlinesBriefing favicon HeadlinesBriefing.com

Magic Hexagons: From 19 to 21

Hacker News •
×

What is so special about the number 19? The question surfaced when YSDA turned 19 and sparked a conversation about the only non‑trivial normal magic hexagon, which uses 3n²-3n+1 cells. A magic hexagon is a hexagonal grid where every straight line in the three directions sums to the same constant, and a normal one contains consecutive numbers from 1 to 3n²-3n+1. The proof shows that for any order *n* > 3 the sum of those numbers fails a divisibility test by 2n‑1, leaving only the order‑3 hexagon as the unique solution.

When the rule that the numbers must start at 1 is relaxed, new “abnormal” magic hexagons appear. Finding them is hard because no deterministic construction exists; the search space is enormous. The largest known solution as of July 2026 is a hexagon of order n=9, found by Klaus Meffert in 2024.

The author reduces the search space by imposing antisymmetry: placing 0 at the center and requiring opposite cells to hold opposite values. This creates zero‑sum hexagons that can be built from a basis of alternating six‑cell rings, yielding a potential‑field representation that automatically satisfies line‑sum constraints. Using GPT‑5.6 Sol, the author connects the problem to Heffter arrays and replaces a generic constraint solver with a custom simulated‑annealing routine. The combined approach discovers magic hexagons of every order up to n=21.

These results illustrate how domain‑specific insight and modern LLMs can overcome combinatorial bottlenecks that stymied traditional search methods.