{
  "id": "3482",
  "ident": "NS.03482",
  "slug": "erdos-878",
  "title": "Erdős Problem 878",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Is it true that, for almost all $n$, $f(n)=o(n\\log\\log n)$ and\n$F(n)\\gg n\\log\\log n$?\n\nThe answer is yes; a Lean proof is given in [Ki26].",
  "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": "Erdos878.erdos_878.parts.i",
  "statement_lean": "theorem erdos_878.parts.i :\n    ∃ A : Set ℕ, A.HasDensity 1 ∧\n      (fun n : A ↦ (f n : ℝ)) =o[atTop]\n        (fun n : A ↦ (n : ℝ) * Real.log (Real.log (n : ℝ))) ∧\n      (fun n : A ↦ (n : ℝ) * Real.log (Real.log (n : ℝ))) =O[atTop]\n        (fun n : A ↦ (F n : ℝ))",
  "challenge_source": "/-\nCopyright 2026 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 878\n\n*References:*\n- [erdosproblems.com/878](https://www.erdosproblems.com/878)\n- [Er84e] Erdős, P., _On two unconventional number theoretic functions and on some\n  related problems_. (1984), 113--121.\n- [Ki26] Kitamura, K., _Erdős Problem #878 in Lean_,\n  [GitHub repository](https://github.com/KitaKen1/erdos-878-lean/tree/d4a8eecf0606b3eee7342c2040a31c8c30eb5d76) (2026).\n-/\n\n@[expose] public section\n\nopen Filter Asymptotics\nopen scoped Topology Real\n\nnamespace Erdos878\n\n/-- The function $f(n)=\\sum_{p\\mid n}p^{\\lfloor\\log_p n\\rfloor}$. -/\nnoncomputable def f (n : ℕ) : ℕ :=\n  ∑ p ∈ n.primeFactors, p ^ Nat.log p n\n\nopen scoped Classical in\n/-- The function $F(n)$ from Erdős Problem 878, with nontrivial terms $a_i \\ge 2$. -/\nnoncomputable def F (n : ℕ) : ℕ :=\n  ((Finset.Icc 2 n).powerset.filter fun A ↦\n    A ⊆ Finset.Icc 2 n ∧\n      (A : Set ℕ).Pairwise (fun a b ↦ Nat.Coprime a b) ∧\n      ∀ a ∈ A, ∀ p, p.Prime → p ∣ a → p ∣ n).sup fun A ↦ ∑ a ∈ A, a\n\n/-- The maximum of an arithmetic function on $\\{0,\\ldots,x\\}$. -/\nnoncomputable def maxUpTo (g : ℕ → ℕ) (x : ℕ) : ℕ :=\n  (Finset.range (x + 1)).sup g\n\n/-- The function $H(x)=\\sum_{1\\le n<x}f(n)/n$. -/\nnoncomputable def H (x : ℕ) : ℝ :=\n  ∑ n ∈ Finset.Ico 1 x, (f n : ℝ) / n\n\nset_option linter.style.formal_proof_palomar false in\n/-- Is it true that, for almost all $n$, $f(n)=o(n\\log\\log n)$ and\n$F(n)\\gg n\\log\\log n$?\n\nThe answer is yes; a Lean proof is given in [Ki26]. -/\n@[category research solved, question, AMS 11,\n  formal_proof using lean4 at\n    \"https://github.com/KitaKen1/erdos-878-lean/blob/d4a8eecf0606b3eee7342c2040a31c8c30eb5d76/lean/Erdos878/FixedLoss.lean#L120\"]\ntheorem erdos_878.parts.i :\n    ∃ A : Set ℕ, A.HasDensity 1 ∧\n      (fun n : A ↦ (f n : ℝ)) =o[atTop]\n        (fun n : A ↦ (n : ℝ) * Real.log (Real.log (n : ℝ))) ∧\n      (fun n : A ↦ (n : ℝ) * Real.log (Real.log (n : ℝ))) =O[atTop]\n        (fun n : A ↦ (F n : ℝ)) := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/-- Is it true that $\\max_{n\\le x}f(n)\\sim x\\log x/\\log\\log x$?\n\nThe answer is yes; a Lean proof is given in [Ki26]. -/\n@[category research solved, question, AMS 11,\n  formal_proof using lean4 at\n    \"https://github.com/KitaKen1/erdos-878-lean/blob/d4a8eecf0606b3eee7342c2040a31c8c30eb5d76/lean/Erdos878/TrackBEndpointParameters.lean#L630\"]\ntheorem erdos_878.parts.ii :\n    Tendsto (fun x : ℕ ↦\n        (maxUpTo f x : ℝ) / ((x : ℝ) * Real.log x / Real.log (Real.log x)))\n        atTop (𝓝 1) := by\n  sorry\n\n/-- Is it true that, for all $x$, $\\max_{n\\le x}f(n)=\\max_{n\\le x}F(n)$?\nBarreto noted that this is false at $x=210$. -/\n@[category research solved, question, AMS 11]\ntheorem erdos_878.parts.iii_all :\n    ¬ ∀ x : ℕ, maxUpTo f x = maxUpTo F x := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/-- Is it true that, for all large $x$, $\\max_{n\\le x}f(n)=\\max_{n\\le x}F(n)$?\n\nThis is false, as formalized in Lean 4 by Ilia Pauzner using Gemini 4 Argon. -/\n@[category research solved, question, AMS 11, formal_proof using formal_conjectures at \"https://github.com/ilpauzner/formal-conjectures/blob/b7742e7d900ca30503c0dd4c940625a6d9cf0a0c/FormalConjectures/ErdosProblems/878.lean#L435\"]\ntheorem erdos_878.parts.iii_eventually :\n    ¬ ∀ᶠ x : ℕ in atTop, maxUpTo f x = maxUpTo F x := by\n  sorry\n\ndef erdos_878.parts.iv.answer : ℕ → ℝ := by sorry\n\n/-- Find an asymptotic formula for the number of $n<x$ such that $f(n)=F(n)$. -/\n@[category research open, question value, AMS 11]\ntheorem erdos_878.parts.iv :\n    (fun x : ℕ ↦\n      (((Finset.Ico 1 x).filter fun n ↦ f n = F n).card : ℝ))\n      ~[atTop] erdos_878.parts.iv.answer := by\n  sorry\n\ndef erdos_878.parts.v.answer : ℕ → ℝ := by sorry\n\n/-- Find an asymptotic formula for $H(x)=\\sum_{n<x}f(n)/n$. -/\n@[category research open, question value, AMS 11]\ntheorem erdos_878.parts.v :\n    H ~[atTop] erdos_878.parts.v.answer := by\n  sorry\n\n/-- Is it true that $H(x)\\ll x\\log\\log\\log\\log x$? -/\n@[category research open, question, AMS 11]\ntheorem erdos_878.parts.vi :\n    H =O[atTop] fun x : ℕ ↦\n        (x : ℝ) * Real.log (Real.log (Real.log (Real.log (x : ℝ)))) := by\n  sorry\n\n/-- Erdős [Er84e] proved that $\\max_{n\\le x}f(n)\\sim x\\log x/\\log\\log x$\nfor a sequence of $x\\to\\infty$. -/\n@[category research solved, AMS 11]\ntheorem erdos_878.variants.second_question_subsequence :\n    ∃ X : ℕ → ℕ, Tendsto X atTop atTop ∧\n      Tendsto (fun k : ℕ ↦\n        (maxUpTo f (X k) : ℝ) /\n          ((X k : ℝ) * Real.log (X k) / Real.log (Real.log (X k))))\n        atTop (𝓝 1) := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/-- For almost all $n$, $F(n)\\sim \\frac12 n\\log\\log n$.\nA Lean proof is given in [Ki26]. -/\n@[category research solved, AMS 11,\n  formal_proof using lean4 at\n    \"https://github.com/KitaKen1/erdos-878-lean/blob/d4a8eecf0606b3eee7342c2040a31c8c30eb5d76/lean/Erdos878/SharpFirstAsymptotic.lean#L168\"]\ntheorem erdos_878.variants.proposed_first_question_sharp :\n    ∃ A : Set ℕ, A.HasDensity 1 ∧\n      Tendsto (fun n : A ↦\n        (F n : ℝ) / ((n : ℝ) * Real.log (Real.log (n : ℝ))))\n        atTop (𝓝 (1 / 2 : ℝ)) := by\n  sorry\n\n/-- Erdős [Er84e] showed that $\\limsup_{x\\to\\infty}H(x)/x=\\infty$. -/\n@[category research solved, AMS 11]\ntheorem erdos_878.variants.H_div_self_limsup_infinite :\n    ∀ C : ℝ, ∃ᶠ x : ℕ in atTop, C ≤ H x / (x : ℝ) := by\n  sorry\n\n/-- Erdős [Er84e] showed that $\\liminf_{x\\to\\infty}H(x)/x<\\infty$. -/\n@[category research solved, AMS 11]\ntheorem erdos_878.variants.H_div_self_liminf_finite :\n    ∃ C : ℝ, ∃ᶠ x : ℕ in atTop, H x / (x : ℝ) ≤ C := by\n  sorry\n\n/-- Erdős [Er84e] proved that $H(x)\\ll x\\log\\log\\log x$. -/\n@[category research solved, AMS 11]\ntheorem erdos_878.variants.H_upper_triple_log :\n    H =O[atTop] fun x : ℕ ↦\n      (x : ℝ) * Real.log (Real.log (Real.log (x : ℝ))) := by\n  sorry\n\n/-- Erdős [Er84e] proved that $x\\log\\log\\log\\log x\\ll H(x)$;\nthis entry records the infinitely-often consequence. -/\n@[category research solved, AMS 11]\ntheorem erdos_878.variants.H_lower_quadruple_log_infinitely_often :\n    ∃ c : ℝ, 0 < c ∧ ∃ᶠ x : ℕ in atTop,\n      c * ((x : ℝ) * Real.log (Real.log (Real.log (Real.log (x : ℝ))))) ≤ H x := by\n  sorry\n\n/-- The function $h(x)=\\max_{n\\le x}\\omega(n)$ from [Er84e]. -/\nnoncomputable def h (x : ℕ) : ℕ :=\n  maxUpTo (fun n ↦ n.primeFactors.card) x\n\n/-- The function $m(x)=\\max_{n\\le x}f(n)$ from [Er84e]. -/\nnoncomputable def m (x : ℕ) : ℕ := maxUpTo f x\n\nset_option linter.style.formal_proof_palomar false in\n/-- Formula (17) of [Er84e]: does $(x h(x)-m(x))/x\\to\\infty$?\n\nThe answer is yes; a Lean proof is given in [Ki26]. -/\n@[category research solved, question, AMS 11,\n  formal_proof using lean4 at\n    \"https://github.com/KitaKen1/erdos-878-lean/blob/d4a8eecf0606b3eee7342c2040a31c8c30eb5d76/lean/Erdos878/Formula17.lean#L192\"]\ntheorem erdos_878.variants.original_formula_17 :\n    Tendsto (fun x : ℕ ↦\n        ((x * h x - m x : ℕ) : ℝ) / (x : ℝ)) atTop atTop := by\n  sorry\n\nend Erdos878\n",
  "statement_hash": "9fd3276bdb9bfecb1c88f809e899fd87dbdcda360e4cf9583c5cc90b9f688624",
  "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."
}