/- Copyright 2026 The Formal Conjectures Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ import FormalConjecturesUtil

Erdős Problem 829

References:

    erdosproblems.com/829

    [Er83] Erdős, P. and Dudley, U., Some remarks and problems in number theory related to the work of Euler. Math. Mag. (1983), 292-298.

open AdditiveCombinatorics Asymptotics Filter namespace Erdos829

The set of perfect cubes in $\mathbb{N}$.

def cubes : Set := {n | k, k ^ 3 = n}

Membership in cubes can be witnessed by a bounded cube root, which makes it decidable for concrete values.

@[category API, AMS 11] lemma mem_cubes_iff (m : ) : m cubes k, k < m + 1 k ^ 3 = m := m:m cubes k < m + 1, k ^ 3 = m m:m cubes k < m + 1, k ^ 3 = mm:(∃ k < m + 1, k ^ 3 = m) m cubes m:m cubes k < m + 1, k ^ 3 = m k: k_1 < k ^ 3 + 1, k_1 ^ 3 = k ^ 3 k:k < k ^ 3 + 1 have : k k ^ 3 := Nat.le_self_pow (k:3 0 All goals completed! 🐙) k All goals completed! 🐙 m:(∃ k < m + 1, k ^ 3 = m) m cubes k:left✝:k < k ^ 3 + 1k ^ 3 cubes All goals completed! 🐙

Erdős Problem 829 (open). Let $A \subseteq \mathbb{N}$ be the set of perfect cubes. Is it true that $(1_A \ast 1_A)(n) \ll (\log n)^{O(1)}$? That is, does there exist a natural number $C$ such that the number of representations of $n$ as a sum of two cubes is $O((\log n)^C)$ as $n \to \infty$?

@[category research open, AMS 11] theorem declaration uses 'sorry'erdos_829 : answer(sorry) C : , (fun n : => (sumRep cubes n : )) =O[atTop] (fun n : => (Real.log n) ^ C) := True C, (fun n => (sumRep cubes n)) =O[atTop] fun n => Real.log n ^ C All goals completed! 🐙

There is exactly one ordered pair of cubes summing to $0$, namely $(0, 0)$.

@[category test, AMS 11] theorem sumRep_cubes_zero : sumRep cubes 0 = 1 := sumRep cubes 0 = 1 {p Finset.antidiagonal 0 | (∃ k < p.1 + 1, k ^ 3 = p.1) k < p.2 + 1, k ^ 3 = p.2}.card = 1 All goals completed! 🐙

The only ordered pair of cubes summing to $2$ is $(1, 1)$.

@[category test, AMS 11] theorem sumRep_cubes_two : sumRep cubes 2 = 1 := sumRep cubes 2 = 1 {p Finset.antidiagonal 2 | (∃ k < p.1 + 1, k ^ 3 = p.1) k < p.2 + 1, k ^ 3 = p.2}.card = 1 All goals completed! 🐙

The integer $3$ is not the sum of two cubes.

@[category test, AMS 11] theorem sumRep_cubes_three : sumRep cubes 3 = 0 := sumRep cubes 3 = 0 {p Finset.antidiagonal 3 | (∃ k < p.1 + 1, k ^ 3 = p.1) k < p.2 + 1, k ^ 3 = p.2}.card = 0 All goals completed! 🐙

The Hardy-Ramanujan taxicab number satisfies $1729 = 1^3 + 12^3 = 9^3 + 10^3$, giving the four ordered representations $(1, 1728), (1728, 1), (729, 1000), (1000, 729)$.

@[category test, AMS 11] theorem sumRep_cubes_taxicab : sumRep cubes 1729 = 4 := sumRep cubes 1729 = 4 {p Finset.antidiagonal 1729 | (∃ k < p.1 + 1, k ^ 3 = p.1) k < p.2 + 1, k ^ 3 = p.2}.card = 4 All goals completed! 🐙 namespace variants

Mordell proved $\limsup_{n \to \infty} (1_A \ast 1_A)(n) = \infty$, where $A$ is the set of perfect cubes. Equivalently, the number of representations of $n$ as a sum of two cubes is unbounded.

@[category research solved, AMS 11] theorem declaration uses 'sorry'mordell : limsup (fun n : => (sumRep cubes n : ℕ∞)) atTop = ( : ℕ∞) := limsup (fun n => (sumRep cubes n)) atTop = All goals completed! 🐙

Mahler proved $(1_A \ast 1_A)(n) \gg (\log n)^{1/4}$ for infinitely many $n$, where $A$ is the set of perfect cubes.

[Ma35b] Mahler, K., On the lattice points on curves of genus 1. Proc. London Math. Soc. (2) (1935), 431-466.

@[category research solved, AMS 11] theorem declaration uses 'sorry'mahler : C > (0 : ), ∃ᶠ (n : ) in atTop, C * (Real.log n) ^ ((1 : ) / 4) (sumRep cubes n : ) := C > 0, ∃ᶠ (n : ) in atTop, C * Real.log n ^ (1 / 4) (sumRep cubes n) All goals completed! 🐙

Stewart improved Mahler's lower bound to $(1_A \ast 1_A)(n) \gg (\log n)^{11/13}$ for infinitely many $n$, where $A$ is the set of perfect cubes.

[St08] Stewart, C. L., Cubic Thue equations with many solutions. Int. Math. Res. Not. IMRN (2008), Art. ID rnn040, 11.

@[category research solved, AMS 11] theorem declaration uses 'sorry'stewart : C > (0 : ), ∃ᶠ (n : ) in atTop, C * (Real.log n) ^ ((11 : ) / 13) (sumRep cubes n : ) := C > 0, ∃ᶠ (n : ) in atTop, C * Real.log n ^ (11 / 13) (sumRep cubes n) All goals completed! 🐙 end variants end Erdos829