{
  "id": "500",
  "ident": "NS.00500",
  "slug": "erdos-1054",
  "title": "Erdős Problem 1054",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Let $f(n)$ be the minimal integer $m$ such that $n$ is the sum of the $k$ smallest divisors\nof $m$ for some $k\\geq 1$. Is it true that $f(n)=o(n)$?\n\nThe strong claim that $f(n)=o(n)$ was disproved by Tao in the comments to\n[468](https://www.erdosproblems.com/468), in which he proves that the upper density of\n$\\{ n : f(n)\\leq \\delta n\\}$ is $\\ll \\delta^2$.",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "question",
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos1054.erdos_1054.parts.i",
  "statement_lean": "theorem erdos_1054.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 1054\n\n*References:*\n- [erdosproblems.com/1054](https://www.erdosproblems.com/1054)\n- [PALOMAR-2026-10-05-000005](https://palomar-registry.org/entry.html?id=PALOMAR-2026-10-05-000005&version=1)\n-/\n\n@[expose] public section\n\nnamespace Erdos1054\n\nopen Filter Asymptotics\n\n/-- Let $f(n)$ be the minimal integer $m$ such that $n$ is the sum of the $k$ smallest\ndivisors of $m$ for some $k\\geq 1$. -/\nnoncomputable def f (n : ℕ) : ℕ :=\n  open scoped Classical in\n  if h : ∃ᵉ (m) (k ≥ 1), n = ∑ i < k, Nat.nth (· ∈ m.divisors) i then\n    Nat.find h\n  else 0\n\nset_option linter.style.formal_proof_palomar false in\n/-- Let $f(n)$ be the minimal integer $m$ such that $n$ is the sum of the $k$ smallest divisors\nof $m$ for some $k\\geq 1$. Is it true that $f(n)=o(n)$?\n\nThe strong claim that $f(n)=o(n)$ was disproved by Tao in the comments to\n[468](https://www.erdosproblems.com/468), in which he proves that the upper density of\n$\\{ n : f(n)\\leq \\delta n\\}$ is $\\ll \\delta^2$.\n-/\n@[category research solved, question, AMS 11, formal_proof using lean4 at \"https://github.com/linrock/math-proofs/blob/0917cd01090b52088aa82b09c8c84689047b8171/erdos-1054/Solution.lean#L97\"]\ntheorem erdos_1054.parts.i : ¬ (fun n ↦ (f n : ℝ)) =o[atTop] (fun n ↦ (n : ℝ)) := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/-- Let $f(n)$ be the minimal integer $m$ such that $n$ is the sum of the $k$ smallest divisors\nof $m$ for some $k\\geq 1$. Is it true that $f(n)=o(n)$ for almost all $n$?\n\nNo: combining the Tao–Kovač small-ratio bound $\\#\\{n \\leq X : 0 < f(n) \\leq \\delta n\\} \\ll \\delta^2 X$\nwith the fact that almost all odd integers are represented (or via the lower-density bound below),\n$f(n)$ is not $o(n)$ along any density-one set $A$. -/\n@[category research solved, question, AMS 11, formal_proof using lean4 at \"https://github.com/linrock/math-proofs/blob/0917cd01090b52088aa82b09c8c84689047b8171/erdos-1054/Solution.lean#L103\"]\ntheorem erdos_1054.parts.ii : ¬ ∃ (A : Set ℕ), A.HasDensity 1 ∧\n    (fun (n : A) ↦ (f ↑n : ℝ)) =o[atTop] (fun n ↦ (n : ℝ)) := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/-- Let $f(n)$ be the minimal integer $m$ such that $n$ is the sum of the $k$ smallest divisors\nof $m$ for some $k\\geq 1$. Is it true that $\\limsup f(n)/n=\\infty$?\n\nYes: for every $A \\geq 1$, a positive lower density of odd integers satisfy $f(n) > A n$, so\n$\\limsup f(n)/n = \\infty$. -/\n@[category research solved, question, AMS 11, formal_proof using lean4 at \"https://github.com/linrock/math-proofs/blob/0917cd01090b52088aa82b09c8c84689047b8171/erdos-1054/Solution.lean#L110\"]\ntheorem erdos_1054.parts.iii : ∃ (A : Set ℕ), A.HasDensity 1 ∧\n    atTop.limsup (fun n ↦ (f n : EReal) / n) = ⊤ := by\n  sorry\n\n/-- Let $f(n)$ be the minimal integer $m$ such that $n$ is the sum of the $k$ smallest divisors\nof $m$ for some $k\\geq 1$. Show that $f$ is undefined at $n=2$, i.e. we get the junk value $0$. -/\n@[category textbook, AMS 11]\ntheorem f_undefined_at_2 : f 2 = 0 := by\n  rw [f, dif_neg]\n  rintro ⟨m, k, hk, hsum⟩\n  rcases eq_or_ne m 0 with rfl | hm\n  · simp at hsum\n  · -- For `m ≠ 0` the smallest divisor is `1` and every later term is `≥ 2`, so the sum of the\n    -- `k` smallest divisors is `1` or `≥ 3`, never `2`.\n    have hk0 : (0 : ℕ) ∈ Finset.Iio k := Finset.mem_Iio.mpr (by omega)\n    rw [← Finset.add_sum_erase _ _ hk0, Nat.nth_divisors_zero hm] at hsum\n    obtain ⟨i, hi_mem, hi_ne⟩ :=\n      Finset.exists_ne_zero_of_sum_ne_zero (s := (Finset.Iio k).erase 0)\n        (f := Nat.nth (· ∈ m.divisors)) (by omega)\n    have h2 := Nat.two_le_nth_divisors hm (Finset.ne_of_mem_erase hi_mem) hi_ne\n    have := h2.trans (Finset.single_le_sum (fun j _ => Nat.zero_le _) hi_mem)\n    omega\n\n/-- Let $f(n)$ be the minimal integer $m$ such that $n$ is the sum of the $k$ smallest divisors\nof $m$ for some $k\\geq 1$. Show that $f$ is undefined at $n=5$, i.e. we get the junk value $0$. -/\n@[category textbook, AMS 11]\ntheorem f_undefined_at_3 : f 5 = 0 := by\n  rw [f, dif_neg]\n  rintro ⟨m, k, hk, hsum⟩\n  rcases eq_or_ne m 0 with rfl | hm\n  · simp at hsum\n  · set p : ℕ → Prop := fun x => x ∈ m.divisors with hpdef\n    have hfin : (Set.ofPred p).Finite := Set.finite_mem_finset m.divisors\n    have hg0 : Nat.nth p 0 = 1 := Nat.nth_divisors_zero hm\n    -- The `j`-th smallest divisor is at least `j + 1` (for `j` below the number of divisors).\n    have hlb : ∀ j, j < hfin.toFinset.card → j + 1 ≤ Nat.nth p j := by\n      intro j\n      induction j with\n      | zero => intro _; omega\n      | succ n ih =>\n        intro hj\n        have h1 := Nat.nth_lt_nth_of_lt_card hfin (show n < n + 1 by omega)\n          (show n + 1 < hfin.toFinset.card by omega)\n        have h2 := ih (by omega)\n        omega\n    -- The second smallest divisor of `m` is never `4`: if `4 ∣ m` then `2 ∣ m`, so `2` would be\n    -- the second smallest divisor.\n    have refute4 : Nat.nth p 1 ≠ 4 := by\n      intro h\n      have hne : Nat.nth p 1 ≠ 0 := by rw [h]; norm_num\n      have hcard1 : 1 < hfin.toFinset.card := by\n        by_contra! hcon\n        exact hne (Nat.nth_eq_zero.mpr (Or.inr ⟨hfin, hcon⟩))\n      have hmem : p (Nat.nth p 1) := Nat.nth_mem_of_lt_card hfin hcard1\n      rw [h] at hmem\n      have h4 : (4 : ℕ) ∣ m := (Nat.mem_divisors.mp hmem).1\n      have h2d : (2 : ℕ) ∣ m := dvd_trans (by norm_num) h4\n      have h2mem : p 2 := by simp [hpdef, Nat.mem_divisors, h2d, hm]\n      have hcount : Nat.count p 2 = 1 := by\n        simp [hpdef, Nat.count_succ, Nat.count_zero, Nat.mem_divisors, hm]\n      have hnc := Nat.nth_count (p := p) h2mem\n      rw [hcount, h] at hnc\n      norm_num at hnc\n    rcases lt_or_ge k 3 with hk3 | hk3\n    · -- `k = 1` or `k = 2`.\n      interval_cases k\n      · rw [Nat.Iio_eq_range, Finset.sum_range_one, hg0] at hsum\n        omega\n      · rw [Nat.Iio_eq_range, Finset.sum_range_succ, Finset.sum_range_one, hg0] at hsum\n        exact refute4 (by omega)\n    · -- `k ≥ 3`.\n      rcases eq_or_ne (Nat.nth p 2) 0 with hg2 | hg2\n      · -- At most two divisors are involved, so the sum equals `1 + Nat.nth p 1`.\n        have hz : ∀ i, 2 ≤ i → Nat.nth p i = 0 := by\n          rcases Nat.nth_eq_zero.mp hg2 with ⟨hp0', _⟩ | ⟨hf, hcle⟩\n          · exact absurd hp0' (by simp [hpdef, Nat.mem_divisors])\n          · intro i hi\n            refine Nat.nth_eq_zero.mpr (Or.inr ⟨hfin, ?_⟩)\n            have heq : hf.toFinset.card = hfin.toFinset.card := by congr 1\n            omega\n        rw [← Finset.sum_subset (s₁ := Finset.Iio 2) (s₂ := Finset.Iio k)] at hsum\n        · rw [Nat.Iio_eq_range, Finset.sum_range_succ, Finset.sum_range_one, hg0] at hsum\n          exact refute4 (by omega)\n        · intro x hx; simp only [Finset.mem_Iio] at *; omega\n        · intro x hx hx2; simp only [Finset.mem_Iio] at *; exact hz x (by omega)\n      · -- Three distinct divisors `1 < d₁ < d₂` force the sum to be at least `6`.\n        have hc3 : 2 < hfin.toFinset.card := by\n          by_contra! hcon\n          exact hg2 (Nat.nth_eq_zero.mpr (Or.inr ⟨hfin, hcon⟩))\n        have hg1 := hlb 1 (by omega)\n        have hg2' := hlb 2 (by omega)\n        have hsub : ∑ i ∈ Finset.Iio 3, Nat.nth p i ≤ ∑ i ∈ Finset.Iio k, Nat.nth p i := by\n          apply Finset.sum_le_sum_of_subset_of_nonneg\n          · intro x hx; simp only [Finset.mem_Iio] at *; omega\n          · intros; positivity\n        rw [Nat.Iio_eq_range, Finset.sum_range_succ, Finset.sum_range_succ,\n          Finset.sum_range_one, hg0] at hsub\n        lia\n\nend Erdos1054\n",
  "statement_hash": "de48a31a24425e4b530d19d631f4e7da1383b69a32bd385766cec25c296c5bfc",
  "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."
}