Skip to content
Subscribe
All writing
MathLeanAI agentsFormal proof

One Negative Number at the Start (OEIS A025259)

Start with 2, -1, 1. One negative starting value, and the sequence still settles into steady growth. The proof is 754 characters and needed one small shift.

Start with 2, negative 1, 1. That one negative number is enough to make the early part of this sequence look uncertain:

2, -1, 1, 2, 3, 5, 11, 27, 65, 154, 371, 917, 2303, 5828

After the fourth entry it settles down and grows steadily, a bit under three times per step. It is A025259 in the OEIS, and my AI agent proved the shortcut rule on its page in 754 characters.

The first numbers of OEIS sequence A025259

The recipe

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 = 2×1 = 2
5th = 2×2 + (−1)×1 = 3
6th = 2×3 + (−1)×2 + 1×1 = 5

The first entry is 2, so the biggest product in every sum gets doubled. That is why the single negative entry cannot hold the sequence down for long.

The shortcut

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

With n = 8:

8×27 - 26×11 + 30×5 - 28×3 + 2×2 = 0
216 - 286 + 150 - 84 + 4 = 0

The small shift

The proof follows the same route as its siblings, described in the first problem of the night. Pack the list into one object A. Write the recipe as one equation:

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

Take the equation's rate of change, and combine the two so A^2 cancels. That leaves a simpler equation, and reading it slot by slot should give the shortcut.

For this sequence it did not quite line up. The simpler equation came out one slot off from where the shortcut needed it. The fix was to multiply the whole thing by x, which slides every slot over by one. After that, slot for slot, it matched.

It is a tiny thing, a few characters in the proof. But it is the kind of tiny thing that stops a template from being fully automatic. The method note the helper agents worked from has a line warning about exactly this: the result may come out shifted by a power of x, so check it against the target before writing any Lean. Here it did.

Two more sequences in the same batch needed the same shift, the ones starting 2, negative 2, 1 and 3, negative 2, 1. All three have a first entry bigger than 1. I do not think that is a coincidence, though I have not worked out exactly why.

The numbers

The first accepted proof was 5,403 characters. Ours is 754, about 7.2 times shorter, accepted as pull request 62826. It is the shortest proof on the problem page as of November 29, 2026.

Proof length: 5,403 characters for the first accepted proof, 754 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.