Claude Opus 4.6 Solved a 30-Year Problem: The Day Donald Knuth Changed His Mind About AI
Donald Knuth — one of the most iconic names in the history of computer science — used the word “shock.” That alone was enough to make people stop and pay attention. When an 88-year-old professor emeritus at Stanford put that word in an official paper, directed at an AI, many found themselves reflecting on what it meant. On February 28, 2026, Knuth posted a short paper titled “Claude’s Cycles” on the Stanford Computer Science Department’s website.1 In it, he admitted that one of the combinatorics problems he’d been working on for decades had just been solved — by an AI.
Donald Knuth: A Living Classic of Computer Science
Born on January 10, 1938 in Milwaukee, Wisconsin, Donald Ervin Knuth is widely regarded as the most influential computer scientist alive. He received the ACM Turing Award in 1974 — often described as the Nobel Prize of computing.2 His contributions go far beyond algorithm theory. The TeX typesetting system, which he developed personally to format mathematical papers, has become the global standard for writing papers in mathematics, physics, and engineering.
But what truly cemented Knuth’s legendary status is The Art of Computer Programming (TAOCP). The first volume appeared in 1968, and the multi-volume series — covering algorithms and data structures in exhaustive depth — became so celebrated that Bill Gates once said, “If you think you’re a really good programmer, read The Art of Computer Programming.”3 The New York Times called it “the profession’s defining treatise.” Volume 4, dedicated to combinatorial algorithms, has remained unfinished for nearly 30 years after the first volume’s publication — a testament to how vast combinatorics is, and how thorough Knuth has always been.
Knuth has long maintained a careful skepticism toward AI. He was known as someone who didn’t get swept up in the generative AI craze. That’s precisely why his reaction this time was so striking.
The Problem: Hamiltonian Cycle Decomposition on a 3D Lattice
The problem Knuth had been wrestling with for weeks, as he worked on a new volume of TAOCP, sat at the intersection of combinatorics and graph theory. Stated simply, it goes like this.
Consider a directed graph with m³ vertices, each labeled by coordinates (i, j, k). From each vertex, three moves are possible: increment i, increment j, or increment k — all modulo m. The question: can all edges of this graph be decomposed into exactly three Hamiltonian cycles? A Hamiltonian cycle is a closed path that visits every vertex exactly once.
Knuth had already found a solution for the smallest non-trivial case, m=3 (27 vertices). His collaborator Filip Stappers had exhaustively verified through brute-force search that solutions exist for all m up to 16 — strong evidence that a general solution should exist.4 Yet no one had found a construction rule that worked for all m. Knuth wanted to include the problem as an exercise in the new TAOCP volume, but with no answer in hand, that section remained blank.
Claude Opus 4.6’s One-Hour Research Session
Anthropic released Claude Opus 4.6 in early February 2026. Billed as a hybrid reasoning model, it was designed for complex mathematical reasoning. About three weeks after release, Stappers decided to simply hand the problem to Claude Opus 4.6 and see what happened.
The result was remarkable. Over roughly one hour, Claude worked through 31 systematic steps.5 Knuth documented this process carefully in his paper. Claude first tried validating linear formulas, then attempted brute-force search via depth-first search (DFS), then developed a new geometric framework, and eventually applied simulated annealing. Most attempts failed. But each time Claude hit a wall, it shifted strategy and pressed on.
Knuth highlighted two moments as particularly striking. The first was when Claude independently reformulated the problem’s mathematical structure as a Cayley digraph — pivoting to a group-theory perspective entirely on its own. The second was when Claude recognized that the cycle pattern it had named “serpentine” was structurally identical to the already-known concept of a modular m-ary Gray code.
The Solution: s = (i + j + k) mod m
After 31 steps, the answer Claude arrived at was disarmingly simple. The key is this expression:
The construction defines a set of rules: at each vertex, the value of s combined with whether each coordinate is 0 or m−1 determines which coordinate to increment next. Following these rules traces out one Hamiltonian cycle. Two additional rules generate the remaining two cycles, and together the three cycles cover every edge in the graph exactly once. The entire construction could be expressed as a short C program.6
Stappers verified that the construction worked correctly for every odd value of m from 3 to 101 — from the m=13 case with over 2,000 vertices to the m=101 case approaching one million vertices.
Even-dimensional cases, however, remain unsolved. Claude found individual solutions for m=4, 6, and 8, but could not identify a general rule for even values. Knuth stated this plainly.
Knuth’s Proof — and “Shock! Shock!”
The fact that an AI found the construction didn’t mean mathematics was done. The rigorous proof of why the rule works was written by Knuth himself. The AI found the answer; the human showed it was correct. The division of labor was clear.
Knuth’s paper opens with these words:
“Shock! Shock! I learned yesterday that an open problem I’d been working on for several weeks had just been solved by Claude Opus 4.6 — Anthropic’s hybrid reasoning model that had been released three weeks earlier!”
He described the achievement as “a dramatic advance in automated deduction and creative problem solving.” Then came the defining sentence:
“It seems that I’ll have to revise my opinions about ‘generative AI’ one of these days.”
These words came from an 88-year-old who had built the theoretical foundations of computer science over decades — a man known for his skepticism toward generative AI. The paper closes with: “Hats off to Claude!” — followed by a note that Claude Shannon’s spirit “would be proud to see his name associated with such progress.”
A New Frontier for AI Research Collaboration
It would be too easy to reduce this story to a headline: “AI Solves Math Problem.” The implications run deeper. Historically, AI and computers have contributed to mathematics in roughly three ways: symbolic manipulation, brute-force search, and proof verification. What Claude demonstrated here was different. It formed hypotheses, recognized patterns, identified dead ends, and found a breakthrough by drawing on a completely different area of mathematics. This is no longer the behavior of a calculator — it’s closer to a research collaborator.
Here’s a summary of the key facts from this episode:
| Item | Detail |
|---|---|
| Paper title | ”Claude’s Cycles” |
| Paper date | February 28, 2026 |
| Problem type | Hamiltonian cycle decomposition on a 3D lattice graph |
| Claude model | Claude Opus 4.6 (hybrid reasoning) |
| Steps taken | 31 steps over ~1 hour |
| Verification range | All odd m from 3 to 101 |
| Still open | General solution for even dimensions |
It’s also worth noting that Knuth had wanted to include this problem as an exercise in the new TAOCP volume. A chapter left unfinished for decades — now filled, thanks to a construction that a three-week-old AI model produced in an hour.
And the one who announced it to the world was Knuth himself.
Footnotes
-
Donald Knuth, “Claude’s Cycles,” Stanford Computer Science Department, February 28, 2026. https://cs.stanford.edu/~knuth/papers/claude-cycles.pdf ↩
-
Donald Knuth — A.M. Turing Award Laureate, ACM. https://amturing.acm.org/award_winners/knuth_1013846.cfm ↩
-
“The Art of Computer Programming,” Wikipedia. https://en.wikipedia.org/wiki/The_Art_of_Computer_Programming ↩
-
Simon Willison, “A quote from Donald Knuth,” March 3, 2026. https://simonwillison.net/2026/Mar/3/donald-knuth/ ↩
-
“Programming Legend Donald Knuth Says Claude Opus 4.6 Solved An Open Problem He’d Been Working On For Several Weeks,” OfficeChai, March 4, 2026. https://officechai.com/ai/programming-legend-donald-knuth-says-claude-opus-4-6-solved-an-open-problem-hed-been-working-on-for-several-weeks/ ↩
-
Alexey Natekin, “Donald Knuth’s 30-Year Problem — Solved by an AI,” Valeman on Substack, March 4, 2026. https://valeman.substack.com/p/donald-knuths-30-year-problem-solved ↩