Erdős Problem 357: bounds on sequences with distinct consecutive sums, formalized in Lean
An upper bound with leading constant below 1/2 and a lower bound of order √n, with written proofs and a Lean formalization
For Erdős Problem 357, the largest k with 1 ≤ a₁ < … < aₖ ≤ n and all consecutive sums distinct satisfies f(n) ≤ (44273/90000)n + 2√n + 177792 and, for large n, f(n) ≥ (15/√21)√n − 1800. The proofs and the Lean formalization were produced by AI agents, and the Lean statements are pinned to the community’s formal definition. Whether f(n) = o(n) is still open.
Let be the largest for which there are integers whose consecutive sums are all different. Erdős and Harzheim asked how grows, and in particular whether : whether such sequences must thin out to a vanishing fraction of . The question is Erdős Problem 357, and it is open.
Before this work, the best bounds we found were of the form (informal, July 2026) and (a web manuscript). The upper bound comes from a tidy “crossing” argument, and getting below it needs something more.
Results
| Statement | Status |
|---|---|
| Upper bound above (Theorem 1.1 of the paper) | Lean proof; complete written proof |
| , hence (Theorem 1.2) | Lean proof; complete written proof |
| for , hence the bound (Theorem 1.3) | Lean proof; complete written proof |
| , a simpler variant that is the smaller bound for | Lean proof; outline only in the paper |
| Exact for every | Computer search: evidence, not proof |
The upper bound is below only once , because of its additive constant. What it changes is the leading constant: . The constants above are exact. Their decimals are truncated, never rounded up or down to look better.
How the bounds work
Upper bound. Every term whose prefix sum passes owns a block sum in , and these are all different, which gives roughly . The new step is a lemma: a short block can be extended one term to the left without its sum exceeding , as long as the sum is at most . So every integer of that is missing from the sequence costs it one term. Missing integers are then forced by a small identity: the consecutive integers starting at have the same sum as the consecutive integers starting at . A valid sequence cannot contain both runs, so at least one of the integers is missing. Five families of such run pairs, arranged so that no integer belongs to more than two of them, force at least missing integers per .
Lower bounds. These build explicit sequences. Six residues modulo 42, , repeated with period 42 and shifted by a large offset, have block sums whose residues determine the block’s length modulo 12. A size argument separates lengths that differ by 12 or more. That gives . Adding 84 to the last fifth of the terms keeps every residue and reduces every possible coincidence to one divisor equation. A counting argument shows that some offset in a window avoids it, which gives . The framework of residue patterns plus a size argument is Pickhardt’s; the pattern, the skip and the proofs are new as far as we found.
How it was checked
The six Lean 4 files prove the theorems for a function f that Lean confirms, by definitional equality, is the f of the Formal Conjectures project’s statement of the problem. They do not prove a weaker variant with a similar name. The checks:
- a clean build with Lean
v4.27.0and Mathlibv4.27.0; - all 1023 declarations depend only on Lean’s three standard axioms, with no
sorry, nonative_decideand no added axiom; - every module replays through
lean4checker; - a script checks every number and finite case in the written proofs with exact arithmetic;
- two AI reviews, one of them adversarial with its own recomputation, found no mathematical error, and every presentation problem they raised was fixed;
- the exact values for were reproduced by a third exhaustive search, written without access to the first two.
What “reproduced” means here. These checks were run by AI sessions on the lab’s machine, repeatedly and from clean builds. By this archive’s rules, a result checked only by AI sessions is not marked verified until the author has run the checks personally; that takes one command (below). The entry will be revised when that happens. No human mathematician has checked the proofs, and the paper has not been peer reviewed.
git clone https://github.com/dreadpiratechan/erdos-357cd erdos-357FETCH_CACHE=1 bash verification/run_all.shThe repository’s README explains how to add the kernel replay with lean4checker. On Windows, it says to clone to a short path.
How the results were found
By AI agents, working in a research repository the author set up and directed:
- An OpenAI Codex agent found a modulus-22 predecessor pattern and its Lean proof on 9 September 2026.
- A multi-agent run of Claude models on the night of 22–23 October produced the modulus-42 pattern, the skip, the first upper bounds below , and their Lean proofs.
- A further Claude agent produced the five-band design of the final upper bound later on 23 October.
- Claude (Opus 5.5) then wrote the paper and ran the audits.
The author chose the problem, commissioned the runs and decided what to publish. The records show no human contribution to the mathematics itself. The paper’s statement on AI use and the repository’s docs/PROVENANCE.md give the details. The author takes responsibility for the claims on this page and for correcting any that are found to be wrong.
Limits
- Whether is untouched.
- Novelty is not established. No source we found states any of these constants, but two relevant papers were readable only as abstracts or reviews: Hegyvári (1986) and Coppersmith and Phillips (1996). The search is described in the repository’s
docs/LITERATURE.md. - The gain in the upper bound is small, in the leading constant, and the method appears to be near its limit.
- The lower bounds are of order , while computer constructions suggest is much larger: a valid sequence of 26813 terms exists in .