Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Erdős Problem 261: the representation property n/2n=∑ak/2akn/2^n=\sum a_k/2^{a_k}n/2n=∑ak​/2ak​ and the greedy carry

Definition
Erdos261_defs

by Ethan Cheung Wang · Oct 23, 2026 · Mathlib 0df444a (Lean v4.33.1)

erdos-problemsnumber-theory

Erdős261Prop. A natural number nnn has property Erdos261Prop if there exist t≥2t\ge2t≥2 pairwise distinct positive integers a1,…,ata_1,\dots,a_ta1​,…,at​ with

n2n=∑k=1tak2ak.\frac{n}{2^n}=\sum_{k=1}^{t}\frac{a_k}{2^{a_k}}.2nn​=k=1∑t​2ak​ak​​.

This is copied verbatim from Google DeepMind's Formal Conjectures file for Erdős Problem 261 (the open part asks whether every n≥1n\ge1n≥1 has the property).

Greedy carry. g0=ng_0=ng0​=n and gj+1=2gj−(n+j+1)g_{j+1}=2g_j-(n+j+1)gj+1​=2gj​−(n+j+1) if 2gj≥n+j+12g_j\ge n+j+12gj​≥n+j+1, otherwise gj+1=2gjg_{j+1}=2g_jgj+1​=2gj​. This is the greedy digit iteration of Borwein–Loring and Tengely–Ulas–Zygadło started at (n,n)(n,n)(n,n); gj=0g_j=0gj​=0 for some jjj 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

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me