# Prime Counting Function Difference

If $\pi\left(x\right)$ is the prime counting function, is anything known about the number of x values satisfy $$\pi\left(2x\right)-\pi\left(x\right)=1$$ Sorry if this is a stupid question, but I am just curious about the size of such $x$ values and perhaps some properties that they may have. Thanks.

• Well, I can tell you its never zero. Jun 25, 2017 at 19:47
• The fact that $\pi\left(2x\right)-\pi\left(x\right)\geq 1$ is the Bertrand postulate. See also the question & answer here math.stackexchange.com/questions/2310803/… ... The second bar in each of the histograms always has non zero height. Jun 25, 2017 at 19:58
• Yes, the values of $x$ with this property are very, very small. One can easily show that $\pi(2x)-\pi(x)> 1$ for all $x > 10$, say. So then $x$ is confined to the interval $[1,10]$ and we could very easily characterize all real numbers $x$ with the property. Jun 25, 2017 at 20:00

As you know, Bertrand's postulate states that $\pi(2x) - \pi(x) \ge 1$ for all $x \ge 2$. A refinement due to Nagura in 1952 states that as long as $x \ge 25$ then $\pi(6x/5) - \pi(x) \ge 1$. But then $\pi(36x/25) - \pi(6x/5) \ge 1$ too, and since $36/25 < 2$ leads to $\pi(2x) - \pi(x) \ge 2$. This can be improved significantly, but as far as your question goes, the values of $x$ satisfying $\pi(2x) - \pi(x) = 1$ are very limited in number.

Per Wikipedia, there is always a prime between $2n$ and $3n$, and always a prime between $3n$ and $4n$. Since $3n$ is not prime (barring $n=1$), there are always at least two primes between $x$ and $2x$ for $x=2n$ even.

For $x=2n+1$ odd, there is always a prime between $2n$ and $3n=\frac{3}{2}(x-1)$. (Since $2n$ is not prime, that means there is a prime between $x$ and $3n$.) There is also always a prime between $3(x-1)/2$ and $3n=3 \times \frac{x-1}{2}$, which is less than $2x = 4n+2$. So it works for odd $x$ too.

So the only such values of $x$ are very small. (I can't be bothered to work out exactly which they are, but they're certainly less than $10$. The above two paragraphs contain statements which are true for larger $x$ than that.)

One should expect only a small, finite number of such $x$. The Prime Number Theorem implies for $x$ sufficiently large $\pi(2x)-\pi(x)\sim\frac{x}{\log x}$. So beyond small examples like $x=1,2, 3, 5$ there aren't any.

The prime counting function is defined for real numbers $x$. The exact set of real numbers $x$ for which $\pi(2x) - \pi(x) = 1$ is the union of the following intervals:

$$[1,1.5) \cup [2,2.5) \cup [3,3.5) \cup [5,5.5).$$

You can see a sketch of this in the graph (Wolfram Alpha).