Erdős Problem 261: the representation property and the greedy carry
DefinitionErdos261_defserdos-problemsnumber-theory
Erdős261Prop. A natural number has property Erdos261Prop if there exist pairwise distinct positive integers with
This is copied verbatim from Google DeepMind's Formal Conjectures file for Erdős Problem 261 (the open part asks whether every has the property).
Greedy carry. and if , otherwise . This is the greedy digit iteration of Borwein–Loring and Tengely–Ulas–Zygadło started at ; for some means the greedy algorithm finds a finite representation.
Definition code
import Mathlib
namespace Erdos261
/-- Verbatim from Formal Conjectures `FormalConjectures/ErdosProblems/261.lean`. -/
def Erdos261Prop (n : ℕ) : Prop := ∃ᵉ (t ≥ 2) (a : Fin t → ℕ), a.Injective ∧
(1 ≤ a) ∧ n / (2 ^ n : ℚ) = ∑ k, (a k) / (2 ^ (a k) : ℚ)
/-- The greedy carry from `(n, n)`: `g₀ = n`, `g_{j+1} = 2 g_j - (n+j+1)` if `2 g_j ≥ n+j+1`,
otherwise `g_{j+1} = 2 g_j` (the Borwein–Loring / Tengely–Ulas–Zygadło greedy iteration). -/
def greedy (n : ℕ) : ℕ → ℤ
| 0 => n
| j + 1 => if ((n + j + 1 : ℕ) : ℤ) ≤ 2 * greedy n j
then 2 * greedy n j - ((n + j + 1 : ℕ) : ℤ) else 2 * greedy n j
end Erdos261
Source
Erdős Problem 261, https://www.erdosproblems.com/261; Formal Conjectures FormalConjectures/ErdosProblems/261.lean (def Erdos261Prop); greedy: Tengely, Ulas, Zygadło, J. Number Theory 217 (2020), arXiv:2008.01501, §3