Skip to content
Subscribe
All writing
MathLeanAI agentsFormal proof

A Proof the Reference Page Had Already Sketched (OEIS A025270)

The page for this sequence already explained why the guess should be true. So what was left to do? Make a computer agree with every step. That turns out to be a different job.

The page for A025270 in the OEIS lists a guessed shortcut rule. Right under it, someone has added a note explaining why the guess follows from a known formula for the sequence. It is a few sentences long.

So when my AI agent proved this one, in 666 characters of Lean, what exactly got added? I think the answer is worth a short post, because it is the clearest example from that night of the difference between an argument and a checked proof.

The first numbers of OEIS sequence A025270

The sequence

Start with 1, 2, 1, 1. To get each new number, line the list up against itself in reverse, multiply the pairs, and add.

5th = 1×1 + 2×1 + 1×2 + 1×1 = 6
6th = 1×6 + 2×1 + 1×1 + 1×2 + 6×1 = 17
1, 2, 1, 1, 6, 17, 60, 201, 688, 2370, 8218, 28703, 100846, 356370

The guessed rule:

n·a(n) − 2(2n−3)·a(n−1) − 4(n−3)·a(n−2) + 6(2n−9)·a(n−3) + 20(n−6)·a(n−4) = 0

With n = 7:

7×60 - 22×17 - 16×6 + 30×1 + 20×1 = 0
420 - 374 - 96 + 30 + 20 = 0

The short version

In plain words, the note on the page says this. The sequence has a closed formula involving a square root. Square both sides to get rid of the root. Take the rate of change of that and match up the terms, and the rule falls out.

A person who knows the area reads that and nods. It is correct. It is also the same idea my agent used.

What the short version leaves out

A proof checker does not nod. Each of the following had to be spelled out, shown, or deliberately avoided.

What the square root means. The formula takes the square root of an endless expression. For numbers, everyone knows what a square root is. For an endless list of coefficients, you have to define it and show it behaves. The agent's proof avoids the question entirely. It never takes a root. It works from the squared form directly:

A^2 = A - (x + x^2 - 3x^3 - 5x^4)

That the formula really describes this sequence. The note takes the formula as given. The checker wanted it derived from the pairing rule and the four starting numbers, entry by entry.

Where the rule starts. The note says the rule holds from n = 5. Why 5 and not 4? Because the first four entries are set by hand and do not follow the pairing rule. A person waves at that. Lean wanted the early cases handled one at a time.

The matching up. "Match the terms" hides a paragraph of bookkeeping about which slot of which expression lines up with which.

None of this is new mathematics. All of it is the distance between "I am convinced" and "a machine has checked every step".

Why I care about that distance

Most of my work is building software that businesses run on. The short version of any system is easy to agree with. Orders come in, get checked against stock, and go to the warehouse. Everyone nods.

The failures live in the parts the short version skips. What counts as in stock. Where the rule starts applying. Which record matches which. Writing the checked version is slower and less fun, and it is where you find out whether the nod was earned.

The full method is in the first problem of the night.

The numbers

The first accepted proof was 5,217 characters. Ours is 666, about 7.8 times shorter, accepted as pull request 63029. It is the shortest proof on the problem page as of November 29, 2026.

Proof length: 5,217 characters for the first accepted proof, 666 for mine

Someone else proved it first, and someone before that explained why it should be true. Mine is the shortest checked version.

Get the next build note.

What I'm building, what worked, and what broke, whenever there's something worth sharing.

Subscribe to my newsletter

Keep up with the work.

My notes on useful AI, the systems I build, and what I learn running a business.