2

If $x>2$, $x$ is even number, and $\pi(x)$ is a number of prime numbers less than $x$, then how can I find the roots of the equation $$x=2\pi(2x)-2$$ without the use of computer programming.

Travis Willse
  • 99,363

4 Answers4

5

Aside from the two primes $2$ and $3$ every prime is of the form $6n\pm 1$, and the first of these is $5$. This is on average one third of the remaining numbers, less $1$, because $1$ does not count as a prime.

It is therefore easy to prove that $\pi(n)\le \frac n3+2$. But to get a bound on the solutions you need to do better than $\frac n4$ for the variable bit.

If you eliminate the four primes $2,3,5,7$ and their multiples, the fraction of numbers left is $\frac 12\times \frac 23\times \frac 45\times \frac 67=\frac 8{35}\lt \frac 14$ so that you obtain, with the four special primes, and noting that $1$ does not count as prime, $\pi(n)\le \frac 8{35}n+4$

Then $x=2\pi(2x)-2\le \frac {32}{35}x+8-2$ or $3x\le 210$.

This gives a finite search which is easy enough to do by hand.

Mark Bennet
  • 100,194
2

Unfortunately this is one of those questions where it is really hard to solve without a computer program. If you want the answer $x=2,44,46,52,54,56,58...$ However this is one of those questions where you would just have to bruteforce to solve!

2

The prime-counting function $\pi(n)$ is asymptotic to $\frac{n}{\log n}$ as $n \to \infty$, and in fact one can show that $$\pi(x) <C \frac{x}{\log x},$$ where $C = 1.25506$ (see the reference below). So, if $n$ is a solution to $$n = 2 \pi(2 n) - 2,$$ we must have $$\phantom{(\ast)} \qquad n < 2 \left(C\frac{(2 n)}{\log (2 n)}\right) - 2 = \frac{4 C n}{\log (2n)} - 2 \qquad (\ast).$$ Rearranging gives $$n \log 2 n < 4 C n - 2 \log 2 n < 4 C n$$ and then $$\log 2n < 4 C ,$$ and so (since $\log$ is increasing) $$n < \frac{1}{2} e^{4 C} < 76.$$ In fact, by analyzing the inequality $(\ast)$ using elementary calculus, we can improve this bound to $$n < 66.$$ This leaves just $32$ even numbers to check. (One cannot hope to do too much better with this upper bound, as $n = 58$ is a solution.)

The inequality in the first display equation is (3.6) in Corollary 1 of the

Rosser, J. Barkley; Schoenfeld, Lowell. Approximate formulas for some functions of prime numbers. Illinois J. Math. 6 (1962), no. 1, 64--94.

Glorfindel
  • 3,955
Travis Willse
  • 99,363
1

$\pi(x)$ is known to be asymptotically $\frac{x}{\ln x}$ and this is also a good approximation for relatively small values (see table). Just trying to solve $x = 2\frac{2x}{\ln 2x} -2$ we can assume $x$ is in the vicinity of $\ln 2x \approx 4$.

So check the values near and you'll find all roots.

JJZ
  • 94