$\pi(x)$ is the number of primes not exceeding $x$. The prime number theorem states that $\lim_{x\rightarrow \infty} \frac{\pi(x)}{x/\ln(x)} = 1.$ So I, naïvely, inferred that $\lim_{x\rightarrow\infty}\frac{x}{\pi(x)}-\ln(x) =0.$ But I did some tests and it would very much seem that the true value of the limit is minus one.

But just because $\lim_{x\rightarrow \infty} \frac{\pi(x)}{x/\ln(x)} = 1,$ this doesn't tell anything about the absolute error....

So I ask if $\lim_{x\rightarrow\infty}\frac{x}{\pi(x)}-\ln(x) =-1$?


Indeed we have the limit

$$\lim_{x\to\infty} \frac{x}{\pi(x)} - \log x = -1.$$

We have the estimate

$$\pi(x) = \operatorname{li}(x) + O(xe^{-\sqrt{\log x}/15})$$

cited in wikipedia. Now, for the logarithmic integral, we have

$$\operatorname{li}(x) = \frac{x}{\log x} + \frac{x}{\log^2 x} + o\left(\frac{x}{\log^2 x}\right),$$

and $e^{-c\sqrt{\log x}}$ is $o\left(\frac{1}{\log^k x}\right)$ for all $k > 0$. So

$$\pi(x) = \frac{x}{\log x} + \frac{x}{\log^2 x} + r(x)$$

where $\frac{r(x)\log^2 x}{x} \to 0$. Thus

$$\begin{gather}\frac{\pi(x)}{x} = \frac{1}{\log x}\left(1 + \frac{1}{\log x} + o\left(\frac{1}{\log x}\right)\right)\\ \frac{x}{\pi(x)} = \log x\left(1 - \frac{1}{\log x} + o\left(\frac{1}{\log x}\right)\right) = \log x - 1 + o(1). \end{gather}$$

As I just discovered by following a link from an unrelated question,

$$\lim_{n\to\infty} \left(\log n - \frac{n}{\pi(n)}\right) = B$$

is known as Legendre's constant (Legendre conjectured its existence, but of course could not prove it), which was proved to be $1$ by de la Vallée-Poussin (of Prime Number Theorem fame).

  • 2
    $\begingroup$ Very nice! Not at all what I expected. $\endgroup$ – Thomas Andrews Aug 4 '13 at 20:58
  • $\begingroup$ @ThomasAndrews I didn't expect it either, but plugging in a few not too small values made it look not impossible. $\endgroup$ – Daniel Fischer Aug 4 '13 at 20:59
  • $\begingroup$ Fantastic! I was worried for a second :D Thanks. $\endgroup$ – Valtteri Aug 4 '13 at 21:03

EEDDIITT: it turned out the OP wanted something else. That's life.

.......................... The Logarithmic Integral function is a better estimate for $\pi(x)$ than any rational function of $x, \log x,$ and the error is still known to be unbounded (absolute).

A good early result is Theorem 35 in The Distribution of Prime Numbers by A. E.Ingham, $$ \pi(x) - \operatorname{li}x = \Omega_{\pm} \left( \frac{\sqrt x}{\log x} \; \log \log \log x \right) $$




and so on.

  • $\begingroup$ Yeah. Actually this whole question arose when I wanted a sequence of rational numbers (a_n) which approach logarithm of n as n grows. Hence this sequence seemed fitting... $\endgroup$ – Valtteri Aug 4 '13 at 20:39
  • $\begingroup$ He's also not talking about $\lim \pi(x)-x/\log x$, rather he's talking about $\lim x/\pi(x) - \log x$. (I made the same mistake.) The standard error functions require some tweaking to get the error there. $\endgroup$ – Thomas Andrews Aug 4 '13 at 20:45
  • $\begingroup$ @ThomasAndrews, not sure then. I would guess that quantity might be bounded but without a limit. $\endgroup$ – Will Jagy Aug 4 '13 at 20:50
  • $\begingroup$ @WillJagy Yeah, that was my guess, too. $\endgroup$ – Thomas Andrews Aug 4 '13 at 20:50
  • $\begingroup$ @daniel, he proves it, pages 103-104 in my paperback edition. $\endgroup$ – Will Jagy Aug 4 '13 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.