/- Copyright 2025 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. -/ module public import FormalConjecturesUtil

Erdős Problem 416

References:

    erdosproblems.com/416

    [OAI26a] OpenAI, An asymptotic formula for the number of totients. OpenAI Math Release preprint (2026). https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/preprints/An-asymptotic-formula-for-the-number-of-totients-September-25-2026/An-asymptotic-formula-for-the-number-of-totients-September-25-2026.pdf

@[expose] public sectionopen Filteropen scoped Topology Realnamespace Erdos416

Let V(x) count the number of n≤x such that ϕ(m)=n is solvable.

noncomputable abbrev V (x : ℝ) : ℝ := open scoped Classical in (Finset.Icc 1 ⌊x⌋₊ |>.filter (fun n => ∃ (m : ℕ), m.totient = n)).cardset_option linter.style.formal_proof_palomar false in

Let V(x) count the number of n≤x such that ϕ(m)=n is solvable. Does V(2x)/V(x)→2 ?

Yes. This was proved by an internal OpenAI model in September 2026 [OAI26a]; see the linked Lean proof, which gives V(cx)/V(x)→c for every fixed c>0.

@[category research solved, AMS 11, formal_proof using lean4 at "https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/NumberTheory/TotientAsymptotic/UnconditionalMain.lean#L12"] theorem erdos_416.parts.i : Filter.Tendsto (fun x => (V (2 * x) / V (x))) Filter.atTop (𝓝 2) := ⊢ Tendsto (fun x ↦ V (2 * x) / V x) atTop (𝓝 2) All goals completed! 🐙set_option linter.style.formal_proof_palomar false in

Let V(x) count the number of n≤x such that ϕ(m)=n is solvable. Then V(cx)/V(x)→c for every fixed c>0, which answers a question of Erdős and Hall. This was proved by an internal OpenAI model in September 2026 [OAI26a]; see the linked Lean proof.

@[category research solved, AMS 11, formal_proof using lean4 at "https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/NumberTheory/TotientAsymptotic/UnconditionalMain.lean#L12"] theorem erdos_416.variants.regularly_varying (c : ℝ) (hc : 0 < c) : Filter.Tendsto (fun x => V (c * x) / V x) Filter.atTop (𝓝 c) := c:ℝhc:0 < c⊢ Tendsto (fun x ↦ V (c * x) / V x) atTop (𝓝 c) All goals completed! 🐙def erdos_416.parts.ii.answer : ℝ → ℝ := sorry

Let V(x) count the number of n≤x such that ϕ(m)=n is solvable. Is there an asymptotic formula for V(x)?

@[category research open, question value, AMS 11] theorem erdos_416.parts.ii : Filter.Tendsto (fun x => V x / erdos_416.parts.ii.answer x) atTop (𝓝 1) := ⊢ Tendsto (fun x ↦ V x / ii.answer x) atTop (𝓝 1) All goals completed! 🐙

Let V(x) count the number of n≤x such that ϕ(m)=n is solvable. Pillai proved V(x)=o(x). Ref: S. Sivasankaranarayana Pillai, On some functions connected with $\phi(n)$

@[category research solved, AMS 11] theorem erdos_416.variants.Pillai : V =o[atTop] id := ⊢ V =o[atTop] id All goals completed! 🐙

Let V(x) count the number of n≤x such that ϕ(m)=n is solvable. Erdős proved V(x)=x(logx)^(−1+o(1)). Ref: Erdős, P., On the normal number of prime factors of $p-1$ and some related problems concerning Euler's $\varphi$-function.

@[category research solved, AMS 11] theorem erdos_416.variants.Erdos : ∃ f : ℝ → ℝ, f =o[atTop] (1 : ℝ → ℝ) ∧ ∀ᶠ x in Filter.atTop, V x = x * x.log ^ (-1 + f x) := ⊢ ∃ f, f =o[atTop] 1 ∧ ∀ᶠ (x : ℝ) in atTop, V x = x * Real.log x ^ (-1 + f x) All goals completed! 🐙-- TODO: define the constant from the paper, 0.8178146... here and add it in the statement def erdos_416.variants.Maier_Pomerance.answer : ℝ := sorry

Let V(x) count the number of n≤x such that ϕ(m)=n is solvable. V(x)=x/logx * e^((C+o(1))(log log log x)^2), for some explicit constant C>0. Ref:Maier, Helmut and Pomerance, Carl, On the number of distinct values of Euler's $\phi$-function.

@[category research solved, question value, AMS 11] theorem erdos_416.variants.Maier_Pomerance : 0 < erdos_416.variants.Maier_Pomerance.answer ∧ ∃ f : ℝ → ℝ, f =o[atTop] (1 : ℝ → ℝ) ∧ ∀ᶠ x in Filter.atTop, (V x : ℝ) = x / x.log * (rexp <| (erdos_416.variants.Maier_Pomerance.answer + f x) * x.log.log.log ^ 2) := ⊢ 0 < Maier_Pomerance.answer ∧ ∃ f, f =o[atTop] 1 ∧ ∀ᶠ (x : ℝ) in atTop, V x = x / Real.log x * rexp ((Maier_Pomerance.answer + f x) * Real.log (Real.log (Real.log x)) ^ 2) All goals completed! 🐙-- TODO: add the constants `C₁, C₂, C₃` from the paper here def erdos_416.variants.Ford.answer : ℝ × ℝ × ℝ := sorry

Let V(x) count the number of n≤x such that ϕ(m)=n is solvable. V(x) ≍ x/log x*e^(C_1*(log log log x − log log log log x)^2+C_2 log log log x − C_3 log log log log x) Ref: Ford, Kevin, The distribution of totients.

@[category research solved, question value, AMS 11] theorem erdos_416.variants.Ford : let (C₁, C₂, C₃) : ℝ × ℝ × ℝ := erdos_416.variants.Ford.answer 0 < C₁ ∧ 0 < C₂ ∧ 0 < C₃ ∧ let G (x : ℝ) : ℝ := x / x.log * (rexp <| C₁ * (x.log.log.log - x.log.log.log.log) ^ 2 + C₂* x.log.log.log - C₃ * x.log.log.log.log) V =Θ[atTop] G := ⊢ match Ford.answer with | (C₁, C₂, C₃) => 0 < C₁ ∧ 0 < C₂ ∧ 0 < C₃ ∧ let G := fun x ↦ x / Real.log x * rexp (C₁ * (Real.log (Real.log (Real.log x)) - Real.log (Real.log (Real.log (Real.log x)))) ^ 2 + C₂ * Real.log (Real.log (Real.log x)) - C₃ * Real.log (Real.log (Real.log (Real.log x)))); V =Θ[atTop] G All goals completed! 🐙end Erdos416