When Donald Knuth Lets an AI Do the Math

Something slightly surreal happened this week.

Donald Knuth—yes, that Donald Knuth—published a short paper describing how an AI system helped solve a mathematical problem he had been thinking about.

Not a startup founder.
Not a grad student.
Not a research lab.

Donald Knuth himself.

The note is called “Claude’s Cycles.” And it reads like the lab notebook of a slightly eccentric but very determined collaborator who happens to run on GPUs.

The problem sits squarely in Knuth’s favorite territory: combinatorics and graph theory.

Imagine a directed graph whose vertices are triples (i,j,k) modulo m. From each vertex you can increment exactly one coordinate. The challenge is deceptively simple:

Can all edges of this graph be partitioned into three Hamiltonian cycles?

In other words: can you find three giant loops that collectively use every edge exactly once?

Knuth had already solved the tiny case m=3. But the general case resisted tidy formulas. The structure looked regular enough to suggest a pattern, yet messy enough to frustrate straightforward constructions.

Enter Claude.

The model did not simply jump to the answer. Instead, it behaved suspiciously like a human researcher.

It reformulated the graph as a Cayley digraph.
It tried “serpentine” constructions.
It experimented with simulated annealing.
It investigated fiber decompositions.
It failed repeatedly.

Only after dozens of exploratory attempts did a pattern emerge.

Eventually the model discovered a simple rule based on

s=(i+j+k)modms = (i + j + k) \bmod m

Using this quantity, the algorithm decides which coordinate to increment next. That rule generates one Hamiltonian cycle; two related rules generate the other two. Together they partition the edges perfectly—for all odd values of m.

Problem solved.

Knuth’s reaction is delightful. Instead of defensiveness, he expressed genuine enthusiasm. He wrote that learning about the result was “a joy,” and that the episode might force him to revise his opinions about generative AI.

Which might be the most Knuthian sentence imaginable.

What makes the story interesting is not that an AI produced a mathematical construction. Computer-assisted proofs have existed for decades.

What’s new is the style of exploration.

Reading the note feels less like running a program and more like watching a mathematician think: propose a hypothesis, test it, discard it, reframe the problem, and try again.

The machine did not merely calculate. It searched for structure.

And the fact that Donald Knuth—arguably the patron saint of careful algorithmic thinking—is willing to document that process publicly is remarkable.

There is also a quiet irony here.

For years we were told that AI would automate routine tasks first while leaving deep creative reasoning to humans.

Instead, the first surprising successes are appearing exactly where mathematicians spend their lives: exploring patterns in abstract structures.

Knuth spent half a century teaching us how to think about algorithms.

Now, apparently, the algorithms are beginning to return the favor.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *