Number of primes less then $6000$ using $n/ \log n$

608 Views Asked by At

So I am trying to use this formula here and is giving me some trouble.

If I just substitute $6000$ into the formula, the answer is approximately $1500$.

But the number of primes under $6000$ is clearly half that. How do you use this formula properly?

3

There are 3 best solutions below

0
On

The prime number theorem doesn't say $\pi(n) = \frac{n}{\log n}$. It actually says $\lim_{n \to \infty} \pi(n) \large/ \frac{n}{\log n} = 1$, which means it gets more accurate as $n$ gets larger.

0
On

$\pi(x)$ is the prime counting function, it gives the exact amount of primes below $x$

$$\pi(6000)=783$$

The formula provided is an approximation, so it gives:

$$\frac{6000}{\log_e 6000}=\frac{6000}{8.699514748}=689.69364083$$

While about $100$ from the actual answer, this is pretty accurate. It will increase in accuracy as $n$ goes to $\infty$

When you calculated the formula, you used $\log_{10}$ and not $\log_e$, that's why your value was so long from the actual value.

0
On

I'm not sure that you used teh wrong base of logarithm, because when I treid it with base 10 log, I got 1588, which I would have rounded off to 1600.

Whit the natural logarithm, the answer is 690, which is off by almost a hundred. I am reminded of the frivolous tehorem of arithmetic: "almost all integers are very large." Legendre probly knew that $\pi(6000) = 783$, so he thought that the formula was $\pi(n) \approx \frac{n}{\log n - 1.08366}$, and indeed that gives 788, which is far closer. But if you keep going higher and hihger, you'll probably revise that 1.08633 number until at some point you realize you dont even need it. So you strike it out and you get $$\left.\lim_{n \to \infty} \pi(n) \middle/ \frac{n}{\log n}\right. = 1$$