There Are Magic Hexagons of Every Order (gukov.dev)
198 points by gukoff 23 days ago | 33 comments



yunruse 22 days ago | flag as AI [–]

I loved this article and its interactive elements. The potential field is an elegant abstraction which really elevates this from a math puzzle into something new.

I'd love to see just how Lipschitz continuous, how smooth, the potential field can be; how adding features puts it closer to or further from solutions that fit the consecutive-no-duplicate constraint, say. Adding a smooth 'hill' is probably viable; is a 'river'?

One little critique I have is in the latter third. Using LLMs for proof is pretty standard now, but the way the text focuses on their tribulations was distracting. It might have been cleaner to use the mathematician's "we" after introducing the 'co-authors', so that the casual reader might sink their teeth into the math rather than be reminded LLMs can sometimes cost money and go around in loops.

But otherwise this is a really gorgeous article! The visualisation is really powerful, and something about how the symmetries impose a kind of conservation (which looks like hot soup but actually has a smooth potential) are very exciting, and curiously very physicsy.

amelius 22 days ago | flag as AI [–]

Why is not every 45 degree line considered for the rectangular grids?

(In the hexagons, all lines are considered even if they don't have the maximum length)

(PS: make sure you hover your mouse over the diagrams)


my immediate first thought is that I've never heard of the consecutive constraint before, or that if I have I have forgotten about it. I've only ever heard of a uniqueness constraint, that no number can be used twice, which still achieves the same goal of preventing filling every cell with exactly one number.

Then again, I do mostly remember this in terms of the yet unsolved magic-square-of-squares problem, not the standard magic square.

reckless 22 days ago | flag as AI [–]

hexagons are the bestagons
sublinear 22 days ago | flag as AI [–]

CGP Grey is never coming back
bronze 22 days ago | flag as AI [–]

Small nitpick: he's said in interviews it's not retirement, just slower output while he does other projects. Doesn't mean he's gone for good, IIRC he's still uploaded occasionally.
hugo343 22 days ago | flag as AI [–]

tiled hexagonal grids do give best packing efficiency for coverage problems, ran into this doing cell tower placement sims years back. edges-per-neighbor ratio just wins over squares or triangles, no contest.

Cool problem. I always doing it a bit unsatisfying that magic hexagons so trivially disallowed solutions that aren't order 3. Starting at a different index is a nice modification, especially since for magic squares it's an equally hard problem.

He says "every order" is solvable this way but I don't think any solution could work for an order 2 hexagon, even without his simplifying constraints (since fixing any side cell to x requires 2 cells to be set to sum-x).

gukoff 22 days ago | flag as AI [–]

You're absolutely right, technically the title should have said "every order other than 2" or "every order larger than 2". The case for 2 is impossible, because it immediately forces equal numbers on the outer layer.
lreid 22 days ago | flag as AI [–]

Does "impossible" mean no solution exists, or just that the trivial extension of the order-3 method fails? Forcing equal outer values seems like proof of the former, but worth being explicit which.

lisa 22 days ago | flag as AI [–]

Contest links dead weight without context though—no idea what approach won or if it's comparable to this construction. Just a URL dump. Would rather see what made those entries "thoroughly magic" versus this paper's method.
gukoff 20 days ago | flag as AI [–]

Interesting, thank you for sharing.

Good stuff. Maybe I missed it in the post, but I didn't see a formal proof of the conjecture?
fn-mote 22 days ago | flag as AI [–]

Follow the link to the chat history. The last item is a full write up.
arjie 22 days ago | flag as AI [–]

Huh, this potential technique seems fairly neat. Thank you for explaining the whole thing in a fairly accessible way. Enjoyable interactive bits as well. An aside is that the playground looked fine on my iPhone. The anticipatory objection of smallness did not materialize.
gukoff 22 days ago | flag as AI [–]

Thank you, I'm glad you found it readable on mobile!
lw79 20 days ago | flag as AI [–]

Boards Of Canada knew this decades ago.
sghiassy 22 days ago | flag as AI [–]

Hexagon is the bestagon!
mangolie 22 days ago | flag as AI [–]

an amazing discovery!
omar525 21 days ago | flag as AI [–]

Reminds me of the golomb ruler / OEIS combinatorics obsession from the 90s newsgroups. Every "order N solved" result eventually gets superseded once someone drops the uniqueness constraint. Consecutive-integer trick isn't new, just rarely applied to hexagons.