Skip to content
Subscribe
All writing
MathLeanAI agentsFormal proof

The Longest Proof in the Family: 784 Characters (OEIS A025261)

Start with 3, -2, 1. Bigger starting numbers mean bigger numbers inside the proof. That and one small alignment step are all it took to make this the longest of the fifteen.

Fifteen of the proofs my AI agent submitted that night were for one family of sequences. They all use the same method. Their lengths run from 660 characters to 784. This post is about the longest one, and about why it is the longest, which turns out to be a less interesting reason than I hoped.

Proof length: 5,556 characters for the first accepted proof, 784 for mine

The sequence

Start with 3, negative 2, 1. Build each later number by pairing up earlier ones, multiplying, and adding. Stop when the right-hand partner would fall before the third entry.

4th = 3×1 = 3
5th = 3×3 + (−2)×1 = 7
6th = 3×7 + (−2)×3 + 1×1 = 16
3, -2, 1, 3, 7, 16, 40, 111, 327, 984, 2984, 9120, 28156, 87830

This is A025261 in the OEIS. With a 3 in front, it grows faster than most of its siblings, a little over three times per step.

The first numbers of OEIS sequence A025261

The shortcut

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

With n = 8:

8×111 - 39×40 + 65×16 - 56×7 + 8×3 = 0
888 - 1,560 + 1,040 - 392 + 24 = 0

Compare that with the rule for the sequence starting 1, 1, 2, where the multipliers are 1, 1, 1, 3 and 1. Here they are 1, 3, 13, 8 and 4.

Why this proof is the longest

The proof packs the whole list into one object A and writes the pairing rule as

A^2 = (1 + 3x - 2x^2)·A - (3x - 2x^2 + x^3)

Then it takes the rate of change, combines the two so A^2 cancels, and reads off the shortcut slot by slot. The route is described in the first problem of the night, and it is the same route for all fifteen.

So why 784 characters here and 736 for the sequence starting 1, 1, 2?

Bigger numbers take more characters to type. That is most of it. Where the other proof says 3, this one says 13. Where the other has a single x, this one has three of them added together. This proof also needed its result slid over by one slot before it matched the guess, like its two neighbors here and here, and that costs a few characters more.

None of that made the problem harder.

What the scoreboard measures

The site ranks proofs by character count after stripping spaces and comments. It is a clean, objective measure, and I understand why they picked it. You cannot argue with a count.

But it is worth saying plainly what it measures: typing. A proof with a 13 in it scores worse than the same proof with a 3. Length is a decent stand-in for elegance when two people prove the same statement, because the tighter argument usually wins. Across different statements it tells you almost nothing about which was harder.

I run into this every time I set up a metric for a team. The number is easy to collect, so it gets collected, and a month later people are comparing things it was never meant to compare. Lines of code, tickets closed, emails sent. Fine within one job. Misleading across jobs.

The numbers

The first accepted proof was 5,556 characters. Ours is 784, about 7.1 times shorter, accepted as pull request 62442. It is the shortest proof on the problem page as of November 29, 2026.

Someone else proved it first. Mine is a shorter proof of the same statement.

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.