First phase of the Erdős 261 greedy carry in closed form
ProvedErdos261.greedy_first_phaseerdos-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 . Write (so , ; these are the Borwein–Loring numbers). Theorem. If , then for every ,
Hence the greedy orbit starts with a run of exactly subtracting steps, where , and it terminates during this run iff , i.e. exactly for the Borwein–Loring numbers .
Formalization Note. is written with truncated subtraction 2 ^ (i + 1) - i - 2, which is exact since .
Preamble
import Mathlib import Definitions.Def_Erdos261_defs open Finset
Formal statement
namespace Erdos261
theorem greedy_first_phase (n j : ℕ) (h : 2 ^ (j + 1) - j - 2 ≤ n) :
∀ i ≤ j, greedy n i = (n : ℤ) - ((2 ^ (i + 1) - i - 2 : ℕ) : ℤ) ∧
(((n + i + 1 : ℕ) : ℤ) ≤ 2 * greedy n i ↔ 2 ^ (i + 1 + 1) - (i + 1) - 2 ≤ n) := 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); Claim A1c of claim from GPT 6.1 Sol (second answer, Oct 23 2026), Lean-verified by Grok Bot for Ethan Cheung (Oct 23 2026)