/-
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 FormalConjecturesUtilErdős Problem 839
References:
[Er78f] Erdős, P., Problems in number theory and combinatorics, Proc. Sixth Manitoba Conf. on Numerical Math. (1978), 35-58.
[Er92c] Erdős, P., Some of my favourite unsolved problems, J. Combin. Theory Ser. A (1992).
See also Erdős Problem 359 and Erdős Problem 867.
open Filter Real Finsetopen scoped ENNRealnamespace Erdos839A sequence $a : \mathbb{N} \to \mathbb{N}$ is "sum-of-consecutive-free" if no term equals the sum of a contiguous block of earlier terms. That is, for all $i$, $a_i \neq a_j + a_{j+1} + \cdots + a_k$ for any $j \leq k < i$.
def SumOfConsecutiveFree (a : ℕ → ℕ) : Prop :=
∀ i : ℕ, ∀ j k : ℕ, j ≤ k → k < i →
a i ≠ ∑ l ∈ Finset.Icc j k, a lErdős Problem 839 (Part 1) [Er78f][Er92c]:
Let $1 \leq a_1 < a_2 < \cdots$ be a strictly increasing sequence of positive integers such that no $a_i$ is the sum of consecutive $a_j$ for $j < i$. Is it true that $\limsup a_n / n = \infty$?
@[category research open, AMS 11]
theorem erdos_839.parts.i : answer(sorry) ↔
∀ (a : ℕ → ℕ), (∀ n, 1 ≤ a n) → StrictMono a → SumOfConsecutiveFree a →
atTop.limsup (fun n : ℕ => (a n : ℝ≥0∞) / n) = ⊤ := ⊢ True ↔
∀ (a : ℕ → ℕ), (∀ (n : ℕ), 1 ≤ a n) → StrictMono a → SumOfConsecutiveFree a → limsup (fun n ↦ ↑(a n) / ↑n) atTop = ∞
All goals completed! 🐙Erdős Problem 839 (Part 2, stronger) [Er78f][Er92c]:
Let $1 \leq a_1 < a_2 < \cdots$ be a strictly increasing sequence of positive integers such that no $a_i$ is the sum of consecutive $a_j$ for $j < i$. Is it true that $\lim_{x \to \infty} \frac{1}{\log x} \sum_{a_n < x} \frac{1}{a_n} = 0$?
This is equivalent to asking whether the range ${a_1,a_2,\ldots}$ has logarithmic density zero
(see Set.HasLogDensity).
@[category research open, AMS 11]
theorem erdos_839.parts.ii : answer(sorry) ↔
∀ (a : ℕ → ℕ), (∀ n, 1 ≤ a n) → StrictMono a → SumOfConsecutiveFree a →
Set.HasLogDensity (Set.range a) 0 := ⊢ True ↔ ∀ (a : ℕ → ℕ), (∀ (n : ℕ), 1 ≤ a n) → StrictMono a → SumOfConsecutiveFree a → (Set.range a).HasLogDensity 0
All goals completed! 🐙-- TODO: Formalize the additional material on the possible lower limit, reciprocal-sum growth,
-- upper-density constructions, and the links with Erdős Problems 359 and 867.
end Erdos839