The greedy carry of Erdős 261 is the map
ProvedErdos261.greedy_eq_step_moderdos-problemsnumber-theory
Let be the greedy carry for Erdős Problem 261 started at : , and if (a subtracting step, the term is used), otherwise (a doubling step). Then is what remains of after the terms used so far, and the greedy algorithm terminates iff some . Theorem. For all , the -th iterate of from is .
So the greedy algorithm is exactly the Borwein–Loring iteration (with ), with no off-by-one: one uses throughout.
Formalization Note. is an integer (greedy n j : ℤ), and the statement uses (greedy n j).toNat; it is nonnegative.
Preamble
import Mathlib import Definitions.Def_Erdos261_defs open Finset
Formal statement
namespace Erdos261
theorem greedy_eq_step_mod (n j : ℕ) :
(fun p : ℕ × ℕ => (p.1 + 1, (2 * p.2) % (p.1 + 1)))^[j] (n, n) = (n + j, (greedy n j).toNat) := by sorry
end Erdos261
Source
Erdős Problem 261 (https://www.erdosproblems.com/261); greedy carry as in Borwein–Loring 1990 / Tengely–Ulas–Zygadło 2020 (platform def Def_Erdos261_defs); identification checked for GPT 6.1 Sol's step map; claim from GPT 6.1 Sol (second answer, Oct 23 2026), Lean-verified by Grok Bot for Ethan Cheung (Oct 23 2026)