/-
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.
-/modulepublicimportFormalConjecturesUtil
The product of the first k + 1 primes.
On erdosproblems.com/235 this is $N_{k+1}=2\cdot 3\cdots p_{k+1}$.
The limit as $k\to\infty$ is the same for either indexing.
Let $N_k=2\cdot 3\cdots p_k$ and ${a_1<a_2<\cdots <a_{\phi(N_k)}}$ be the integers $<N_k$ which
are relatively prime to $N_k$. Then, for any $c\geq 0$, the limit
$$\frac{#{ a_i-a_{i-1}\leq c \frac{N_k}{\phi(N_k)} : 2\leq i\leq \phi(N_k)}}{\phi(N_k)}$$
exists and is a continuous function of $c$.
Solved by Hooley [Ho65], who proved that these gaps have an exponential distribution: that is, if
$f(c)$ is the function in question, then
$$f(c)=(1+o(1))(1-e^{-c})$$
(where the $o(1)$ goes to $0$ uniformly as $k\to \infty$).
See also 234 for a more difficult version of this problem using
actual primes.