Can we express any positive real number with arbitrary precision using a ratio of two prime numbers? [duplicate]

Although the question might look trivial at first because there are infinitely many prime numbers and for example the ratio of two near prime numbers tends to $1$ at infinity, there is still a point that is missing.

If we define the set $S=\{\, \frac{p_{i}}{p_{j}}\mid i,j\in\Bbb N\,\}$ where $p_i$ is prime number $i$, is it dense in the set of non-negative reals?

If it is, as much as it looks (prevalently) obvious, I am not sure about which precise property is ensuring this, as neither the infinitude of primes nor the limit of ratio of two successive primes reaching $1$ (which is a theorem on its own) looks sufficient individually.

I could imagine something like: the rational set has this property and we can replace each rational number with a ratio of two primes to any desired precision. But, can we?

Maybe I am missing something, but it is not obvious whichever way I look at it.

Theorem that is expected is like:

If $\frac{r_{1}}{s_{1}}>\frac{r_{2}}{s_{2}} > 0$ then there are always two prime numbers $p_{m}$ and $p_{n}$ so that $\frac{r_{1}}{s_{1}}>\frac{p_{m}}{p_{n}}>\frac{r_{2}}{s_{2}}$

if that is to work.


Yes, you can. Let $x_0>0$ be a given positive number, and let $p_k$ denote the $k$th prime.

Recall that $p_n \sim n \log n$ as $n \to \infty$ so

$$\lim_{n \to +\infty} \frac{p_{\lfloor nx_0 \rfloor}}{p_n} = \lim_{n \to +\infty} \frac{\lfloor nx_0 \rfloor \log \lfloor nx_0 \rfloor}{n \log n} = \lim_{n \to +\infty} \frac{\left(nx_0 - \epsilon_n\right)\log (nx_0 - \epsilon_n)}{n \log n}$$

where $\epsilon_n \in [0,1)$ ($\epsilon_n$ depends on $n$).

Since for fixed $x_0>0$, and any sequence $\left\{\epsilon_n\right\} \subset [0,1)$ we have the equivalences $nx_0 - \epsilon_n \sim nx_0 $ and $\log (nx_0 - \epsilon_n) \sim \log(nx_0)$ as $n \to \infty$, we get

$$\lim_{n \to +\infty} \frac{\left(nx_0 - \epsilon_n\right)\log (nx_0 - \epsilon_n)}{n \log n} = \lim_{n \to +\infty} \frac{nx_0\left(\log n + \log x_0\right)}{n \log n} = \lim_{n \to +\infty} \frac{x_0\left(\log n\right)}{\log n} + \lim_{n \to +\infty} \frac{x_0\log x_0}{\log n} = x_0 $$

This implies any $x_0>0$ can be approximated to arbitrary precision by the sequence $\left\{\frac{p_{\lfloor {nx_0} \rfloor}}{p_n}\right\}_{n \geq 1}$

If you allow negative primes, this means prime ratios are dense in $\mathbb{R}$.


As hinted at by the OP, this is implied by the pair of facts that there are infinitely many primes, and the ratio of successive primes converges to $1$. Here is a proof that uses no further properties of the sequence of primes, hence the same result applies to any increasing integer sequence with those two properties (more generally, any sequence of reals that increases to $\infty$ and has ratios converging to $1$).

Let $C>1$ be a positive real to be approximated ($C=1$ is directly implied by our assumptions, and $C<1$ can be handled by taking reciprocals), and suppose we need to find a prime fraction in the range $(C,C + \epsilon)$.

Since $p_{n+1}/p_n \to 1$, we may choose $N$ such that $p_{n+1}/p_n < 1 + \epsilon/C$ for all $n \ge N$. We now take $b = p_N$ as our denominator and choose $a := p_m$ so that $m$ is the least index satisfying $p_m/b > C$. Clearly such an $m$ exists since there are infinitely many primes so arbitrarily large values of $a$ are available.

It is clear that $m > N$ and that $a/b > C$. By our choice of $m$, $p_{m-1}/b \le C$. By our choice of $N$, $p_m/p_{m-1} < 1 + \epsilon/C$. Therefore $a/b = (p_m/p_{m-1})(p_{m-1}/b) < C + \epsilon$.


The set of primes has asymptotic density zero, but $\pi(n)$ is not terribly smaller than $n$, it is about $\frac{n}{\log n}$ by the PNT. Additionally, a result of Ingham ensures the existence of a prime in the interval $[n^3,(n+1)^3]$ for any $n\geq N=\exp\exp(34)$. Let $r\in(1,+\infty)$. For any prime $p>N^3$, there is a prime $q$ in the range $[pr,((pr)^{1/3}+1)^3]$. Obviously $\frac{q}{p}\geq r$, but $$ \frac{q}{p}-r \leq \frac{3(pr)^{2/3}}{p} = \frac{3r^{2/3}}{p^{1/3}} $$ and the RHS tends to zero as $p\to \infty$, hence the ratios of primes are dense in $(1,+\infty)$. By considering reciprocals and opposites it is simple to prove that the ratios of primes are dense in $\mathbb{R}$.


Obviously we do not stricly need the finesse of Ingham's result, something like "for any $n$ large enough, there always is a prime in the interval $[n^{42},(n+1)^{42}]$" would have done the job equally fine. We may also prove the claim by invoking something like

Let $E\subset\mathbb{N}$ the set of natural numbers $n$ with the property that there is a prime in the interval $[n,n+\log(n)^{12}]$. $E$ has a positive asymptotic density.

encoding the fact that moderately large prime gaps are quite rare. Indeed, in the interval $[1,n]$ the average distance between a prime and the next one is around $\log n$, always by the PNT.