{
  "id": "1832",
  "ident": "NS.01832",
  "slug": "erdos-357",
  "title": "Erdős Problem 357",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "Let $f(n)$ be the maximal $k$ such that there exist integers $1 \\le a_1 < \\dotsc < a_k \\le n$\nsuch that all sums of the shape $\\sum_{u \\le i \\le v} a_i$ are distinct. Is $f(n)=o(n)$?",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos357.erdos_357.parts.i",
  "statement_lean": "theorem erdos_357.parts.i : (fun n ↦ (f n : ℝ)) =o[atTop] (fun n ↦ (n : ℝ))",
  "challenge_source": "/-\nCopyright 2025 The Formal Conjectures Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-/\nmodule\n\npublic import FormalConjecturesUtil\n\n/-!\n# Erdős Problem 357\n\n*References:*\n- [erdosproblems.com/357](https://www.erdosproblems.com/357)\n- [He86] Hegyvári, Norbert, On consecutive sums in sequences. Acta Math. Hungar. (1986), 193--200.\n-/\n\n@[expose] public section\n\nnamespace Erdos357\n\nopen Filter Asymptotics\n\ndef HasDistinctSums {ι α : Type*} [Preorder ι] [AddCommMonoid α] (a : ι → α) : Prop :=\n  {J : Finset ι | (J : Set ι).OrdConnected}.InjOn (fun J ↦ ∑ x ∈ J, a x)\n\n/-- Let $f(n)$ be the maximal $k$ such that there exist integers $1 \\le a_1 < \\dotsc < a_k \\le n$\nsuch that all sums of the shape $\\sum_{u \\le i \\le v} a_i$ are distinct. -/\nnoncomputable def f (n : ℕ) : ℕ :=\n  sSup {k : ℕ | ∃ a : Fin k → ℤ, Set.range a ⊆ Set.Icc 1 n ∧ StrictMono a ∧ HasDistinctSums a}\n\n/-- Let $f(n)$ be the maximal $k$ such that there exist integers $1 \\le a_1 < \\dotsc < a_k \\le n$\nsuch that all sums of the shape $\\sum_{u \\le i \\le v} a_i$ are distinct. Is $f(n)=o(n)$? -/\n@[category research open, AMS 11]\ntheorem erdos_357.parts.i : (fun n ↦ (f n : ℝ)) =o[atTop] (fun n ↦ (n : ℝ)) := by\n  sorry\n\n/-\nFormalisation note: the next 5 formalisations are an attempt at capturing the question \"how does\n$f(n)$ grow?\". In addition to trivial solutions (e.g. setting the `answer` to `0` in some of these),\nit is possible that some of these admit easy solutions that shouldn't count as genuine solutions.\nAs usual in this repo, solving this problem is not simply filling in the `answer` definition\ntogether with a proof of the theorem, but providing a *mathematically interesting* answer.\nNote also that there might be other reasonable (and non equivalent) formal statements that capture this\nquestion.\nSimilar remarks hold for the `variants.monotone` formalisations later in this file.\n-/\n\ndef erdos_357.parts.ii.bigO_version.answer : ℕ → ℝ := sorry\n\n/-- Let $f(n)$ be the maximal $k$ such that there exist integers $1 \\le a_1 < \\dotsc < a_k \\le n$\nsuch that all sums of the shape $\\sum_{u \\le i \\le v} a_i$ are distinct.\nHow does $f(n)$ grow? Can we find a (good) explicit function $g$ such that $g = O(f)$ ? -/\n@[category research open, question value, AMS 11]\ntheorem erdos_357.parts.ii.bigO_version :\n    erdos_357.parts.ii.bigO_version.answer =O[atTop] (fun n ↦ (f n : ℝ)) := by\n  sorry\n\ndef erdos_357.parts.ii.bigO_version_symm.answer : ℕ → ℝ := sorry\n\n/-- Let $f(n)$ be the maximal $k$ such that there exist integers $1 \\le a_1 < \\dotsc < a_k \\le n$\nsuch that all sums of the shape $\\sum_{u \\le i \\le v} a_i$ are distinct.\nHow does $f(n)$ grow? Can we find a (good) explicit function $g$ such that $f = O(g)$ ? -/\n@[category research open, question value, AMS 11]\ntheorem erdos_357.parts.ii.bigO_version_symm :\n    (fun n ↦ (f n : ℝ)) =O[atTop] erdos_357.parts.ii.bigO_version_symm.answer := by\n  sorry\n\ndef erdos_357.parts.ii.bigTheta_version.answer : ℕ → ℝ := sorry\n\n/-- Let $f(n)$ be the maximal $k$ such that there exist integers $1 \\le a_1 < \\dotsc < a_k \\le n$\nsuch that all sums of the shape $\\sum_{u \\le i \\le v} a_i$ are distinct.\nHow does $f(n)$ grow? Can we find a (good) explicit function $g$ such that $f = \\Theta(g)$ ? -/\n@[category research open, question value, AMS 11]\ntheorem erdos_357.parts.ii.bigTheta_version :\n    (fun n ↦ (f n : ℝ)) =Θ[atTop] erdos_357.parts.ii.bigTheta_version.answer := by\n  sorry\n\ndef erdos_357.parts.ii.littleO_version.answer : ℕ → ℝ := sorry\n\n/-- Let $f(n)$ be the maximal $k$ such that there exist integers $1 \\le a_1 < \\dotsc < a_k \\le n$\nsuch that all sums of the shape $\\sum_{u \\le i \\le v} a_i$ are distinct.\nHow does $f(n)$ grow? Can we find a (good) explicit function $g$ such that $g = o(f)$ ? -/\n@[category research open, question value, AMS 11]\ntheorem erdos_357.parts.ii.littleO_version :\n    erdos_357.parts.ii.littleO_version.answer =o[atTop] (fun n ↦ (f n : ℝ)) := by\n  sorry\n\ndef erdos_357.parts.ii.littleO_version_symm.answer : ℕ → ℝ := sorry\n\n/-- Let $f(n)$ be the maximal $k$ such that there exist integers $1 \\le a_1 < \\dotsc < a_k \\le n$\nsuch that all sums of the shape $\\sum_{u \\le i \\le v} a_i$ are distinct.\nHow does $f(n)$ grow? Can we find a (good) explicit function $g$ such that $f = o(g)$ ? -/\n@[category research open, question value, AMS 11]\ntheorem erdos_357.parts.ii.littleO_version_symm :\n    (fun n ↦ (f n : ℝ)) =o[atTop] erdos_357.parts.ii.littleO_version_symm.answer := by\n  sorry\n\n/-- Let $f(n)$ be the maximal $k$ such that there exist integers $1 \\le a_1 < \\dotsc < a_k \\le n$\nsuch that all sums of the shape $\\sum_{u \\le i \\le v} a_i$ are distinct.\nIt is known that $f(n) \\geq (2+o(1))\\sqrt{n}$.\nSource: See comment by Desmond Weisenberg here: https://www.erdosproblems.com/forum/thread/357.\n-/\n@[category research solved, AMS 11]\ntheorem erdos_357.variants.weisenberg : ∃ o : ℕ → ℝ, o =o[atTop] (1 : ℕ → ℝ) ∧\n    ∀ᶠ n in atTop, (2 + o n) * √n ≤ f n := by\n  sorry\n\n/-- Suppose $A$ is an infinite set such that all finite sums of consecutive terms of $A$ are distinct.\nThen $A$ has lower density 0. -/\n@[category research solved, AMS 11]\ntheorem erdos_357.variants.infinite_set_lower_density (A : ℕ → ℕ) (hA : StrictMono A)\n    (hA : HasDistinctSums A) : (Set.range A).lowerDensity = 0 := by\n  sorry\n\n/--  Suppose $A$ is an infinite set such that all finite sums of consecutive terms of $A$ are distinct.\nThen it is conjectured that $A$ has density 0. -/\n@[category research open, AMS 11]\ntheorem erdos_357.variants.infinite_set_density (A : ℕ → ℕ) (hA : StrictMono A)\n    (hA : HasDistinctSums A) :\n    (Set.range A).HasDensity 0 := by\n  sorry\n\n\n/-- Suppose $A$ is an infinite set such that all finite sums of consecutive terms of $A$ are distinct.\nThen it is conjectured that the sum $\\sum_k \\frac{1}{a_k}$ converges. -/\n@[category research open, AMS 11]\ntheorem erdos_357.variants.infinite_set_sum (A : ℕ → ℕ) (hA : StrictMono A)\n    (hA : HasDistinctSums A) :\n    Summable (fun i ↦ (1 : ℝ) / A i) := by\n  sorry\n\n/-- Let $g(n)$ be the maximal $k$ such that there exist integers $1 \\le a_1, \\dotsc, a_k \\le n$\nsuch that all sums of the shape $\\sum_{u \\le i \\le v} a_i$ are distinct. -/\nnoncomputable def g (n : ℕ) : ℕ :=\n  sSup {k : ℕ | ∃ a : Fin k → ℕ, (Set.range a ⊆ Set.Icc 1 n) ∧ HasDistinctSums a}\n\n/-- Let $g(n)$ be the maximal $k$ such that there exist integers $1 \\le a_1, \\dotsc, a_k \\le n$\nsuch that all sums of the shape $\\sum_{u \\le i \\le v} a_i$ are distinct. Hegyvári [He86] proved\nthat\n$$\\left(\\frac 1 3 + o(1) \\right)n \\leq g(n) \\leq \\left(\\frac 2 3 + o(1) \\right)n.$$ -/\n@[category research solved, AMS 11]\ntheorem erdos_357.variants.hegyvari : ∃ (o o' : ℕ → ℝ), o =o[atTop] (1 : ℕ → ℝ) ∧\n    o' =o[atTop] (1 : ℕ → ℝ) ∧\n      ∀ᶠ n in atTop, (g n : ℝ) ∈ Set.Icc ((1 / 3 + o n) * n) ((2 / 3 + o' n)*n) := by\n  sorry\n\n/-- Let $h(n)$ be the maximal $k$ such that there exist integers $1 \\le a_1 \\leq \\dotsc \\leq a_k \\le n$\nsuch that all sums of the shape $\\sum_{u \\le i \\le v} a_i$ are distinct. -/\nnoncomputable def h (n : ℕ) : ℕ :=\n  sSup {k : ℕ | ∃ a : Fin k → ℤ, Set.range a ⊆ Set.Icc 1 n ∧ Monotone a ∧ HasDistinctSums a}\n\n-- The analogous question assuming only monotonicity of the $a_i$. The wording of the website\n-- suggests that this is open, though it's not clear whether the difficulty is the same as for the\n-- strictly monotone case.\n\n/-- Let $h(n)$ be the maximal $k$ such that there exist integers $1 \\le a_1 \\leq \\dotsc \\leq a_k \\le n$\nsuch that all sums of the shape $\\sum_{u \\le i \\le v} a_i$ are distinct. Is $h(n)=o(n)$? -/\n@[category research open, AMS 11]\ntheorem erdos_357.variants.monotone.parts.i : (fun n ↦ (h n : ℝ)) =o[atTop] (fun n ↦ (n : ℝ)) := by\n  sorry\n\ndef erdos_357.variants.monotone.parts.ii.bigO_version.answer : ℕ → ℝ := sorry\n\n/-- Let $h(n)$ be the maximal $k$ such that there exist integers $1 \\le a_1 \\leq \\dotsc \\leq a_k \\le n$\nsuch that all sums of the shape $\\sum_{u \\le i \\le v} a_i$ are distinct. How does $h(n)$ grow?\nCan we find a (good) explicit function $g$ such that $g = O(h)$ ? -/\n@[category research open, question value, AMS 11]\ntheorem erdos_357.variants.monotone.parts.ii.bigO_version :\n    erdos_357.variants.monotone.parts.ii.bigO_version.answer =O[atTop] (fun n ↦ (h n : ℝ)) := by\n  sorry\n\ndef erdos_357.variants.monotone.parts.ii.bigO_version_symm.answer : ℕ → ℝ := sorry\n\n/-- Let $h(n)$ be the maximal $k$ such that there exist integers $1 \\le a_1 \\leq \\dotsc \\leq a_k \\le n$\nsuch that all sums of the shape $\\sum_{u \\le i \\le v} a_i$ are distinct. How does $h(n)$ grow?\nCan we find a (good) explicit function $g$ such that $h = O(g)$ ? -/\n@[category research open, question value, AMS 11]\ntheorem erdos_357.variants.monotone.parts.ii.bigO_version_symm :\n    (fun n ↦ (h n : ℝ)) =O[atTop] erdos_357.variants.monotone.parts.ii.bigO_version_symm.answer\n      := by\n  sorry\n\ndef erdos_357.variants.monotone.parts.ii.bigTheta_version.answer : ℕ → ℝ := sorry\n\n/-- Let $h(n)$ be the maximal $k$ such that there exist integers $1 \\le a_1 \\leq \\dotsc \\leq a_k \\le n$\nsuch that all sums of the shape $\\sum_{u \\le i \\le v} a_i$ are distinct. How does $h(n)$ grow?\nCan we find a (good) explicit function $g$ such that $h = \\Theta(g)$ ? -/\n@[category research open, question value, AMS 11]\ntheorem erdos_357.variants.monotone.parts.ii.bigTheta_version :\n    (fun n ↦ (h n : ℝ)) =Θ[atTop] erdos_357.variants.monotone.parts.ii.bigTheta_version.answer := by\n  sorry\n\ndef erdos_357.variants.monotone.parts.ii.littleO_version.answer : ℕ → ℝ := sorry\n\n/-- Let $h(n)$ be the maximal $k$ such that there exist integers $1 \\le a_1 \\leq \\dotsc \\leq a_k \\le n$\nsuch that all sums of the shape $\\sum_{u \\le i \\le v} a_i$ are distinct. How does $h(n)$ grow?\nCan we find a (good) explicit function $g$ such that $g = o(h)$ ? -/\n@[category research open, question value, AMS 11]\ntheorem erdos_357.variants.monotone.parts.ii.littleO_version :\n    erdos_357.variants.monotone.parts.ii.littleO_version.answer =o[atTop] (fun n ↦ (h n : ℝ)) := by\n  sorry\n\ndef erdos_357.variants.monotone.parts.ii.littleO_version_symm.answer : ℕ → ℝ := sorry\n\n/-- Let $h(n)$ be the maximal $k$ such that there exist integers $1 \\le a_1 \\leq \\dotsc \\leq a_k \\le n$\nsuch that all sums of the shape $\\sum_{u \\le i \\le v} a_i$ are distinct. How does $h(n)$ grow?\nCan we find a (good) explicit function $g$ such that $h = o(g)$ ? -/\n@[category research open, question value, AMS 11]\ntheorem erdos_357.variants.monotone.parts.ii.littleO_version_symm :\n    (fun n ↦ (h n : ℝ)) =o[atTop] erdos_357.variants.monotone.parts.ii.littleO_version_symm.answer\n      := by\n  sorry\n\n-- TODO(Paul-Lez): add results from last paragraph of the page.\n\nend Erdos357\n",
  "statement_hash": "ad58b5d781aa8f20e77e9713cdcaf973e3cfe35e29e68895c676a4beee0bbeba",
  "toolchain": "leanprover/lean4:v4.33.1",
  "upstream_commit": "f9b3868d5ca994a7bf95039bcec05338c0c21e2f",
  "workspace": "formal-conjectures",
  "field": "math",
  "formalization": "formal",
  "verification": "lean-kernel",
  "license": "Apache-2.0",
  "attribution": "google-deepmind/formal-conjectures contributors",
  "metric_name": null,
  "metric_direction": null,
  "critiques": [],
  "public_partial_proofs": [],
  "research_threads": [],
  "instructions": "Read research_threads first: other people's public repositories and what they already tried. Write Solution.lean starting from challenge_source. Keep every definition identical, prove decl_name with exactly the same type, no sorry in its dependency closure, no new axioms, no native_decide, no metaprogramming. Submit with POST /api/v1/submissions."
}