Skip to content
Subscribe
All writing
MathLeanAI agentsFormal proof

When the Guessed Rule Has Cubes in It (OEIS A025251)

Most of these shortcuts multiply by simple things like n and 2n. This one has cubes of n in it. It turned out to be two copies of a simpler rule glued together.

Every other shortcut rule from that night multiplies its numbers by simple things: n, or 2n minus 3, or 4 times n minus 6. This one has cubes in its multipliers.

n(n²+n+1)·a(n) + (n−1)(n²+2n+3)·a(n−1) − 2(n−3)(n²+n+1)·a(n−2) − 2(5n³−16n²−19n−30)·a(n−3) − (7n³−23n²−59n−126)·a(n−4) + (n−7)(n²+2n+3)·a(n−5) = 0

That is the guess recorded for A025251 in the OEIS. My AI agent proved it in 722 characters. The interesting part is why the rule looks like that.

The first numbers of OEIS sequence A025251

The sequence

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

4th = 0×2 = 0
5th = 0×0 + 1×2 = 2
6th = 0×2 + 1×0 + 2×2 = 4
0, 1, 2, 0, 2, 4, 2, 12, 18, 24, 82, 120, 242, 620

The leading zero makes it lurch. It goes 4, then back down to 2, then up to 12.

Checking the guess once

With n = 8 most of the six multipliers are already in the hundreds and thousands:

584×12 + 581×2 - 730×4 - 2708×2 - 1514×0 + 83×2 = 0
7,008 + 1,162 - 2,920 - 5,416 + 0 + 166 = 0

Two copies glued together

The one-line equation for this sequence is no worse than its siblings':

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

Run the usual steps on it (they are laid out in the first problem of the night) and you get a perfectly ordinary rule. It reaches back four numbers and has small, plain multipliers.

The guessed rule is not that one. It reaches back five numbers and has cubes.

The explanation is that the guess is two neighboring copies of the plain rule added together. Take the plain rule at position n. Take it again at position n minus 1. Multiply each copy by its own expression in n, chosen so the result looks a certain way, and add. Each copy was true, so the sum is true. But the multipliers now carry those extra expressions inside them, and that is where the cubes come from.

The proof does exactly this. It reads the simple equation at two slots next to each other and lets Lean confirm that the right mix of the two gives the guess.

Why would anyone guess the complicated version

My reading, and I am not a mathematician: these guesses are usually found by software that searches for a rule fitting the known numbers. The software reports a rule that fits. It does not promise the simplest one. If the search happens to land on a blend of two simple rules, that is what gets written down.

So the guess was right and also more complicated than it needed to be. Both can be true. I see the same thing in inherited business logic all the time: a rule that works, that nobody dares simplify, because nobody has checked what it is really made of.

The numbers

This one had been shortened once before us, from 5,438 characters to 5,118. Ours is 722, which is 86 percent shorter than that. It was accepted as pull request 63261 and is the shortest proof on the problem page as of November 29, 2026.

Proof length: 5,438 characters for the first accepted proof, 5,118 for the shortest before mine, 722 for mine

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.