In September, I broke a math record. Well, “I”… that’s a stretch.
The problem
Take two 1s, two 2s and two 3s. The game is to line them up so that the two 1s are separated by exactly one digit, the two 2s by two digits, and the two 3s by three digits.
There is only one solution:
3 1 2 1 3 2
Let’s check. Between the two 1s, there is a 2. Between the two 2s, there is a 1 and a 3. Between the two 3s, there are 1, 2 and 1. (Read backwards, 2 3 1 2 1 3 is the same solution, so it only counts once.)
This is Langford’s problem, named after the Scottish mathematician C. Dudley Langford, who posed it in 1958 after watching his son play with coloured blocks.
You can play with more pairs: 4, 7, 8, 11… (only when the number of pairs is a multiple of 4, or one less than a multiple of 4). Finding one solution stays easy. The real question is how many there are. And that is where things explode:
| Pairs | Number of solutions |
|---|---|
| 3 | 1 |
| 4 | 1 |
| 7 | 26 |
| 8 | 150 |
| 11 | 17,792 |
| 12 | 108,144 |
| … | … |
| 28 | 1,607,383,260,609,382,393,152 |
You can’t list them one by one: it takes clever algorithms and enormous amounts of computation. The value for 28 pairs was found in 2015, and then nothing. Since 29 and 30 have no solutions, the next one was 31. Nobody had ever computed it.
A back-to-school challenge
I came across this problem in September 2026, when I started my master’s in high-performance computing. In one of the very first classes, a professor introduced it along with an unofficial competition: who can write the most optimized algorithm, and reach the largest number of pairs?
As it happens, AI has fascinated me for a long time. Even before ChatGPT, I ran a Discord translation bot. To avoid paying for Google Translate, I had to host my own models, and that is how I started teaching myself deep learning. Since then, I have watched these models improve at a crazy pace, all the way to this September, when OpenAI was announcing one breakthrough in mathematics after another.
So I asked myself: what if an AI could break this record?
Three days, fifteen hours, fifty euros
Let’s be honest: on my own, I couldn’t have done it. So I handed the problem to Claude Opus 5, with a simple instruction: optimize Godfrey’s algorithm until 31 pairs became computable.
For three days, Opus 5 kept coming up with ideas. An algorithmic improvement, then an optimization, then another. By the end, the computation would fit in 28 days on my GPU.
I didn’t feel like waiting a month. I rented around thirty RTX 4070s on Vast.ai for about fifty euros. Fifteen hours later, the record had fallen.
The code, the paper and the full lab notebook are on GitHub.
This record doesn’t advance science: Langford’s problem has no applications. But it showed me, at my own scale, how good these models have become at mathematics and computer science. In a few days, Opus 5 went beyond everything that had been done since the challenge began.
What I take from it
The result matters little. What matters is what it taught me.
I feel almost no pride. When the number came out, I was happy. A little. No more. I could not have solved this problem on my own, not for years. I didn’t work on it: when I handed it to Opus 5, I barely understood it. I asked, then I waited. Pride is measured by the work you put in and the difficulty you overcome. Here, I put in almost nothing, and the difficulty was overcome by Opus 5.
Humans don’t have much of a future in my field. Opus 5 did in a few days what would have taken specialized researchers months, if not longer. And I am just starting my studies in a field where humans already have little essential left to contribute. Two roles remain: asking the AI to solve a problem, and choosing which problems are worth solving. That’s thin. And it doesn’t make me very confident about what comes next.
So this post is less about a record than about how fast AI is progressing, and what place is left for humans in high-performance computing.
For the curious
With 31 pairs, there are exactly
5,894,683,902,597,484,486,903,808
solutions, about 5.9 × 1024.