Complementary carry of the Erdős 261 greedy algorithm
ProvedErdos261.compl_carry_steperdos-problemsnumber-theory
Let be the greedy carry for Erdős Problem 261 started at : , and if (a subtracting step), otherwise (a doubling step). Equivalently with , ; the greedy algorithm terminates iff some . Theorem. Put . Then
So on doubling runs doubles and on subtracting runs the complementary carry doubles.
Preamble
import Mathlib import Definitions.Def_Erdos261_defs open Finset
Formal statement
namespace Erdos261
theorem compl_carry_step (n j : ℕ) :
((n + (j + 1) + 2 : ℕ) : ℤ) - greedy n (j + 1) =
if ((n + j + 1 : ℕ) : ℤ) ≤ 2 * greedy n j
then 2 * (((n + j + 2 : ℕ) : ℤ) - greedy n j)
else 2 * (((n + j + 2 : ℕ) : ℤ) - greedy n j) - ((n + j + 1 : ℕ) : ℤ) := 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 A1 of claim from a GPT answer relayed by Ethan Cheung (third round, Oct 23 2026), Lean-verified by Grok Bot for Ethan Cheung (Oct 23 2026)