Skip to content
Subscribe
All writing
MathLeanAI agentsFormal proof

A Rule That Looks Back Five Steps (OEIS A346074)

1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 9, 14. This sequence sits still for five terms before it moves. The proof needed one extra trick the others did not.

1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 9, 14, 21, 30

Five ones in a row. Then the sequence starts counting, 2, 3, 4, 5, 6, and only after that does it pick up speed.

This is A346074 in the OEIS. A 2022 guess gives a shortcut rule for it. My AI agent proved it in 751 characters, and the standard method needed one extra move to get there.

The first numbers of OEIS sequence A346074

The rule behind it

Every number is 1 plus a sum of products. The products pair up earlier numbers, but only the ones at least five steps back.

For the first five numbers there is nothing five steps back, so the sum is empty and each one is just 1. The sixth number can finally reach the first: 1 plus 1 times 1 is 2. The seventh reaches two pairs: 1 plus 1 plus 1 is 3. That is why it counts for a while. The pairs it can reach are all ones, so each step adds one more.

The speed-up starts at the eleventh number, when the pairing first reaches a 2.

The guess

R. J. Mathar's conjecture:

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

Look at which earlier numbers it uses: one back, two back, then five back and six back. Nothing at three or four. The gap is the "five steps back" in the definition showing through.

With n = 8:

13×5 - 24×4 + 11×3 - 22×1 + 20×1 = 0
65 - 96 + 33 - 22 + 20 = 0

The extra move

On the other problems that night, the definition turned into an equation with a short, finite list of terms on one side. That is what the method from the first problem expects.

Here the definition says "1 plus" at every single step, forever. Packed into one equation, with A for the whole list, that becomes

A = 1/(1 - x) + x^5·A^2

The 1/(1 - x) is an endless run of ones. An endless term is awkward. The checker has no trouble with a polynomial, but an infinite series needs its own handling at every step.

So before doing anything else, the proof multiplies the whole equation through by 1 - x. That turns the endless run of ones back into the single number 1:

(1 - x)·(A - x^5·A^2) = 1

From there it is the usual routine. Take the rate of change, combine the two so the squared term cancels, read the result one slot at a time.

It is one line in the proof. Without it, nothing after it works.

The numbers

This problem had already been shortened once before we got to it. The first accepted proof was 7,270 characters, and someone had cut it to 4,878. Ours is 751, which is 85 percent shorter than that. It was accepted as pull request 62024 and is the shortest proof on the problem page as of November 29, 2026.

Proof length: 7,270 characters for the first accepted proof, 4,878 for the shortest before mine, 751 for mine

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

What I took from it

A method that works many times in a row will meet a case that does not quite fit. The agent did not force it and did not give up on it. It reshaped the input until the method applied. That is the judgment I look for in people too: know your tool well enough to see what small change makes the problem fit it.

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.