Mathematicians Thought Magic Hexagons Were Limited to 2. Turns Out There Are Infinitely Many

Mathematicians Thought Magic Hexagons Were Limited to 2. Turns Out There Are Infinitely Many

MathematicsPopular ScienceProof

Sources:HN + web research · HN

To find a magic hexagon, American railway clerk Clifford Adams spent nearly half a century: he started tinkering with it in 1910 and didn’t arrive at the answer until 1957. On August 2, 2026, a new proof presented an even more astounding conclusion—magic hexagons exist for every order $n \ge 3$. If you want an order of any size, you can simply build it directly following a formula.

The original article was published on gukov.dev, and the discussion on Hacker News gathered 178 points, with commenters admiring the ingenuity of the construction. Let us trace the complete story behind this discovery.

Starting with the 3x3 Magic Square

A 3x3 magic square fills the numbers 1 through 9 such that every row, column, and the two main diagonals sum to 15. It is a staple of elementary math puzzles and represents the simplest form of a magic square. In ancient China, it was known as the Luoshu square.

Magic squares have a history of over 4,000 years, and mathematicians have thoroughly analyzed them: regardless of the matrix size, algorithms exist to construct them directly. Magic hexagons are their honeycomb relatives: replacing square tiles with hexagonal ones, numbers are arranged along straight lines in three directions, requiring the sums along every straight line to be equal. A hexagon with a side length of $n$ cells is called order $n$, containing $3n^2 - 3n + 1$ total cells. Order 3 contains 19 cells, fitting the numbers 1 through 19 perfectly.

Unlike standard magic squares, the straight lines in a hexagon are of unequal lengths: even though each is termed a “line”, some span 3 cells while others span 5 cells, yet their sums must remain identical. This constraint alone makes magic hexagons vastly more difficult than 3x3 magic squares.

The Standard Version: Only Two Members Exist

The standard definition requires numbers to be consecutive starting from 1. This version is remarkably sparse: under standard constraints, only two magic hexagons exist—order 1 and order 3. Order 1 is a single cell containing 1; order 3 fills numbers 1 through 19 across 15 straight lines in three directions, with every line summing to 38. Disregarding rotation and reflection, no other configuration is possible.

Classic Order 3 Magic Hexagon Figure: The classic order-3 magic hexagon, filled with numbers 1 to 19, where every straight line sums to 38. Source: Wikipedia

The “only two” claim is mathematically proven, and the proof is remarkably brief. By summing all numbers in the grid, the sum of each line must be an integer. Working through the divisibility equation reveals that only $n=1$ and $n=3$ yield integer solutions. An order 2 magic hexagon cannot exist—the line sum calculated for order 2 is 28/3, a fraction, immediately ruling it out.

The order-3 solution was rediscovered multiple times throughout history. The most famous account is that of railway clerk Clifford Adams, who toyed with the puzzle from 1910 to 1957, until Martin Gardner featured it in his mathematical games column in 1963. One puzzle, one man, half a lifetime.

A Side Door: Starting from Different Numbers

The story might have ended there. The prevailing consensus was that the hexagonal path had hit a dead end, leaving magic hexagons as isolated oddities. However, the “only two” proof strictly governs the version where numbers start at 1. What if we move the starting point? For example, arranging numbers from -9 to 9?

By loosening the constraint just a fraction, a whole new world opens up. These “abnormal magic hexagons” of order 3, 4, 5, 6, and beyond were gradually uncovered, but at immense computational cost: without formulas or ready-made algorithms, mathematicians had to brute-force search through astronomically vast permutation spaces, yielding new solutions only once every few years. Each new record made headlines because no one could guarantee whether the next order possessed a solution. The largest known instance reached order 10, found in 2024 by Klaus Meffert with the assistance of AI. No one knew how far this road could stretch, and many believed it would end soon.

The New Proof: Not Just Found, Built by Formula

On August 2, 2026, gukov.dev published a landmark result: magic hexagons exist for every order $n \ge 3$. Note the wording: this is not merely “finding a few more,” but proving that “all of them exist,” conquering an infinite family in one go.

The author employed two masterstrokes. First, adding symmetry: placing 0 at the center such that opposite cells are additive inverses of each other. Consequently, lines passing through the center automatically sum to 0, halving the constraints for the remaining lines. Second, changing perspective: viewing the hexagon as a topographically mapped “potential field”—in this representation, zero-sum conditions along all lines hold automatically without manual tuning.

Newly Constructed Order 50 Magic Hexagon Figure: An order-50 magic hexagon directly generated using the new construction, containing 7,351 cells with equal line sums. Source: gukov.dev

Potential Field View of the Order 50 Magic Hexagon Figure: The potential field view of the same order-50 magic hexagon, resembling a terrain map. Once constraints are automatically satisfied, the remaining task is simply filling in numbers. Source: gukov.dev

The search space shrank dramatically. The author had AI draft a custom solver, which ran for a few days on a 24-core home server, successfully locating solutions from order 3 up to order 10. Yet this was merely a prelude: finding finite examples, no matter how many, is still finite. The true breakthrough lay in the constructive proof—first proving that certain orders could be constructed via formulas, then step-by-step generalizing until all orders were covered. The journey was not immediate; at one point the author hit a bottleneck and temporarily pivoted to proving “infinitely many exist,” before ultimately eliminating all restrictions. The core tool for this construction is the Langford sequence: a combinatorial structure arranging pairs of numbers into sequence. The proof process leveraged AI theorem provers, with full conversation transcripts made publicly available online.

Why did the technical community express such admiration? Because a constructive proof does far more than state “existence.” It provides an algorithm: by following the steps, one can construct a magic hexagon of any arbitrary order. The author casually generated and published order-50 and order-500 instances, the latter comprising over 740,000 cells. While the numeric values appear chaotic, rendering them in potential field view reveals smooth, continuous terrain—slopes, ridges, and valleys far too harmonious to be the result of a random search.

Why Proving Existence Still Matters

A layperson might ask: isn’t finding one example enough? Why bother proving it? Because searching can never provide a complete answer. If you search to order 10, there remains order 100; if you search to order 100, there remains order 10,000. Verification is always finite, whereas proof encompasses the infinite. A few lines of formulas span eternity—that is the weight of an existence proof. It also serves a practical purpose: giving future researchers the confidence to search for even more elegant solutions.

We must also delineate the boundaries of this proof: it has not yet undergone formal machine verification, nor has it completed independent peer review, as the author explicitly noted in the article. Furthermore, order 2 remains non-existent—the author confirmed in discussion that order 2 mathematically forces duplicate numbers. The rules of mathematics remain unchanged: new results must await peer review.

The Boundaries Are Farther Than We Think

The most intriguing aspect of this story is that the old proof was not wrong; it indeed barred all larger orders when “starting from 1.” In mathematics, “end of the road” conclusions often hold true only under a specific set of rules. The old proof guarded the front door, while the new proof entered through the side door—shifting the starting point by just one step revealed infinitely many solutions waiting outside.

What took a railway clerk half a lifetime to find once can now be produced in endless quantities via a page of formulas. As we reflect on this breakthrough, we are reminded that the boundaries of mathematics are rarely the boundaries of the universe—they are often merely the boundaries humans draw for themselves. The next time you see a 3x3 magic square, remember its hexagonal relative: deep within the honeycomb, a staircase glows, lit at every single step.

Reference links:

  • gukov.dev: There Are Magic Hexagons of Every Order
  • HN Discussion (item?id=49229174)
  • Wikipedia: Magic hexagon
  • Wikipedia: Magic square