A Padovan-automatic description of a nested recurrence
Benoit Cloitre, Haobo Ma, Wenlin Zhang
math.NT
Sep 27, 2026 · v1
math.CO
TL;DR
Lean formalizes the recurrence identification, six-decimal discrepancy bound, exact offset set, morphic identity, least balance constant, and an effective extrema algorithm.
Abstract
We study the sequence $a(0)=0$, $a(1)=1$ and $a(n)=n-a(n-a(n-a(n-1)))$ for $n\ge 2$, listed as A076502 in the On-Line Encyclopedia of Integer Sequences. We identify $a(n)$ as a two-position shift in the greedy Padovan numeration system, with a finite-state correction. The proof constructs an addition automaton from an exact integer-carry invariant and certifies its completeness by finite-language inclusion; a synchronized automaton then verifies the nested recurrence. We establish bounded discrepancy from the line of slope $c$, where $c^3-c^2+2c-1=0$, and show that the exact set of offsets from $\lfloor cn\rfloor$ is $\{-1,0,1,2\}$. We construct an explicit 26-letter non-erasing morphic presentation of the first-difference word, prove that its least balance constant is 4, and give an effective procedure for enclosing the global discrepancy extrema to arbitrary accuracy. We formalize the recurrence identification, six-decimal discrepancy bound, exact offset set, concrete morphic identity, least balance constant, and an effective extrema algorithm in Lean. Separate exact computations refine the numerical enclosures.
Problem
The nested recurrence a(n)=n-a(n-a(n-a(n-1))) (OEIS A076502) lacked a proven closed description; an earlier conjectural offset set {0,1,2} relative to floor(cn) was incorrect.
Approach
The sequence is identified as a two-position shift in the greedy Padovan numeration system with a finite-state correction encoded by DFAOs. An addition automaton is built from an exact integer-carry invariant and certified complete by finite-language inclusion; a synchronized automaton verifies the recurrence. Bounded discrepancy is proved via a contracting quadratic form, and the difference word is given an explicit 26-letter non-erasing morphic presentation. The identification chain, discrepancy bound, offset set, morphic identity, least balance constant, and an effective extrema algorithm are formalized in Lean.
Results
Proves a(n)=shift_2(n)+E(rep(n)), the discrepancy bound -1.049234<a(n)-cn<1.155081, the exact offset set {-1,0,1,2}, and least balance constant 4. Lean's final axiom closure uses only propext, Classical.choice, and Quot.sound.
| Represented relation | States |
|---|
| x+y=z | 411 |
| v=b(n) | 72 |
| p=b(n-1), n>=1 | 79 |
| v=b(n-b(n-1)) | 144 |
| Good(n) | 7 |
Selected partial DFAs used in the recurrence verification.