/- 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 FormalConjecturesUtil

Erdős Problem 456

References:

    erdosproblems.com/456

    [Er79e] Erdős, Paul, Some unconventional problems in number theory. Astérisque (1979), 73--82.

open Nat Filteropen scoped Topology Asymptoticsnamespace Erdos456

Let $p_n$ be the smallest prime $\equiv 1\pmod{n}$.

noncomputable def p (n : ) : := sInf { k | k.Prime k 1 [MOD n] }

Let $m_n$ be the smallest integer such that $n\mid \phi(m_n)$.

noncomputable def m (n : ) : := sInf { k | 0 < k n totient k }open scoped Classical in

Is it true that $m_n<p_n$ for almost all $n$?

@[category research open, AMS 11] theorem erdos_456.parts.i : answer(sorry) Tendsto (fun N (count (fun n m n < p n) N : ) / (N : )) atTop (𝓝 1) := True Tendsto (fun N (count (fun n m n < p n) N) / N) atTop (𝓝 1) All goals completed! 🐙open scoped Classical in

Does $p_n/m_n \to \infty$ for almost all $n$?

@[category research open, AMS 11] theorem erdos_456.parts.ii : answer(sorry) A : Set , Tendsto (fun N (count (· A) N : ) / (N : )) atTop (𝓝 1) Tendsto (fun n (p n : ) / (m n : )) (atTop 𝓟 A) atTop := True A, Tendsto (fun N (count (fun x x A) N) / N) atTop (𝓝 1) Tendsto (fun n (p n) / (m n)) (atTop 𝓟 A) atTop All goals completed! 🐙

Are there infinitely many primes $p$ such that $p-1$ is the only $n$ for which $m_n=p$?

@[category research open, AMS 11] theorem erdos_456.parts.iii : answer(sorry) { q | q.Prime n, m n = q n = q - 1 }.Infinite := True {q | Nat.Prime q (n : ), m n = q n = q - 1}.Infinite All goals completed! 🐙

Linnik's theorem implies that $p_n\leq n^{O(1)}$.

@[category research solved, AMS 11] theorem erdos_456.variants.linniks_theorem : L : , (fun n (p n : )) =O[atTop] (fun n (n : ) ^ L) := L, (fun n (p n)) =O[atTop] fun n n ^ L All goals completed! 🐙

It is trivial that $m_n \leq p_n$ always.

n:hn:n 0hne:{k | Nat.Prime k k 1 [MOD n]}.Nonemptyhp:Nat.Prime (sInf {k | Nat.Prime k k 1 [MOD n]})hmod:sInf {k | Nat.Prime k k 1 [MOD n]} 1 [MOD n]n sInf {k | Nat.Prime k k 1 [MOD n]} - 1 All goals completed! 🐙

Erdős [Er79e] writes it is 'easy to show' that for infinitely many $n$ we have $m_n < p_n$.

j:k: := 2 * j + 3hm:m (2 ^ k) 2 ^ (k + 1)hp:2 ^ (k + 1) + 1 p (2 ^ k)m (2 ^ k) < p (2 ^ k) All goals completed! 🐙open scoped Classical in

Erdős [Er79e] writes it is 'easy to show' that $m_n/n \to \infty$ for almost all $n$.

@[category research solved, AMS 11] theorem erdos_456.variants.m_div_n : A : Set , Tendsto (fun N (count (· A) N : ) / N) atTop (𝓝 1) Tendsto (fun n (m n : ) / (n : )) (atTop 𝓟 A) atTop := A, Tendsto (fun N (count (fun x x A) N) / N) atTop (𝓝 1) Tendsto (fun n (m n) / n) (atTop 𝓟 A) atTop All goals completed! 🐙end Erdos456