Stanley's averaging procedure: the least and the most moves
Replace two numbers of the same parity by two copies of their average until no move is left. Stanley asked for the least and the most numbers of moves from {1, , n}. The most is for odd and for even : the variance drops by at least 2 per move, and the bound is reached because averaging and is a chip-firing move run backwards, so the longest run is a pile of chips spreading out, read in reverse. The least is for odd and for even , from counting distinct values and a parity argument when 4 divides .
Open problem settled, formally verified in Lean 4
Stanley's averaging procedure on {1, …, n}: the least and the most numbers of moves
A move on a finite multiset of integers replaces two distinct elements a ≠ b of the same parity by two copies of (a+b)/2; the procedure stops when every value of each parity is the same. Stanley asked for the least and the most numbers of moves from {1, …, n}.
- Theorem. The most is (n³ − n)/24 for odd n and (n³ − 4n)/24 for even n; the least is (n − 1)/2 for odd n and 2⌊n/4⌋ for even n.
- Upper bound. The variance Σ(x − (n+1)/2)² drops by (a − b)²/2 ≥ 2 at each move, and for even n it cannot reach 0.
- Attained. Averaging x − 1 and x + 1 is a chip-firing move at x run backwards (Propp’s “reverse chip-firing”, 2017). A pile of n chips at the centre (two piles of n/2 for even n) stabilises to one chip on each of 1, …, n with the explicit odometer v = C(m − d + 1, 2), by the least action principle and a convexity argument; reversed, it is a sequence of the maximal length.
- Lower bound. The number of distinct values drops by at most 2 per move; for n = 4k a tight sequence would pair off the removed values symmetrically about the two final values, which is impossible by parity.
- Open. The two-player game for odd n (first player wins for 3 ≤ n ≤ 15 by computation).
Preprint v1, 30 November 2026, not peer reviewed; open problem solved (Stanley’s first question; the game for odd n stays open). Zenodo: doi:10.5281/zenodo.24698885, identical to this folder at the tag stanley-averaging-moves-v1. The whole theorem (both bounds and both constructions, for every n) is formally verified in Lean 4: see lean/.
AI use: the arguments were found by Claude (Anthropic), which also wrote the programs, the Lean formalisation and the paper. Codex (OpenAI) checked the proof independently, found the integrality hypothesis needed in the least action lemma, wrote the independent programs in verify/independent/ without reading the author’s code, and searched for prior work. The author is responsible for the content.