# Intuition for the prime number theorem

(surprisingly, it appears that this question has not been asked before)

Let $\pi(n)$ denote the number of primes $\leq n$. The prime number theorem states that

$$\pi(n) \sim \frac{n}{\log n} \ \text{as} \ n \to +\infty$$

After painstakingly reading through Erdos's elementary proof of this theorem, I think I understand the mechanics of it from a formal perspective. However, I still don't seem to understand intuitively why this theorem is true. I would like some intuitive insight as to why this theorem holds.

I understand that for a result as deep as this one, even the intuition is going to contain some nitty-gritty details. It's probably not the sort of thing that you could explain to a child, for example. Nevertheless, I will ask this question regardless. There has to be some convincing argument for this theorem beyond the technical details of the proofs.

• If you move the $n$ to the other side, you get a statement about the density of the primes in the naturals. – Simply Beautiful Art Feb 15 '17 at 2:09
• Fair enough. It's just that this seems to be the more common way of presenting it. – MathematicsStudent1122 Feb 15 '17 at 2:13
• – Winther Feb 15 '17 at 2:33
• Wasn't asked before but will be asked plenty of times after. – Robert Soupe Jul 18 '18 at 3:36

Not a full explanation, but it is too long for a comment.

Consider the Sieve of Eratosthenes.

Start with the first $n$ numbers. Remove (one less than) $\frac 12$ of them as multiples of $2$, Of the remainder, remove $\frac 13$ of them as multiples of $3$. Of the remainder, remove $\frac 15$ as multiples of $5$, etc. You should be left with about $$n\prod_{p\le n, \text{ prime}}1 - \frac 1p$$

values as primes below $n$. Now, when multiplied out

$$\prod_{p\le n, \text{ prime}}1 - \frac 1p = 1 - \sum_{k \in S_n} \frac 1k$$ Where $S_n$ is the set of all square-free integers $> 1$ whose prime factors are $\le n$.

It remains to estimate that $1 - \sum_{k \in S_n} \frac 1k\approx \frac 1{\log n}$.

Edit:

Since it was already chosen as the solution and Winther has kindly provided Merten's 3rd theorem which says just what was needed, I could just let this go. But Merten's theorem strikes me as hardly more intuitively obvious than the prime number theorem itself, so I've been thinking on heuristic concepts to explain it.

Now for $|x| < 1$, $\frac1{1-x} = 1 + x + x^2 + ...$ Therefore $$\frac 1{\prod\limits_{p\le n}1 - \frac 1p} = \prod\limits_{p\le n}\left(1 + \frac 1p + \frac 1{p^2} + ...\right)$$

Multiplying the right side out, we get $\sum_{k \in R_n} \frac 1k$, where $R_n$ is the set of all integers whose prime factors are all $\le n$. Of these, it should be expected (I'm being heuristic here, so I can get away with that weasel-wording) that the sum for $k > n$ will be significantly smaller than for $k \le n$. Thus it seems reasonable that $$\sum_{k \in R_n} \frac 1k \sim \sum_{k \in R_n, k\le n} \frac 1k = \sum_{k=1}^n \frac 1k \sim \log n$$

• :D you capture everything I think of in a nut-shell. +1 – Simply Beautiful Art Feb 15 '17 at 12:01
• By Mertens' 3rd theorem the asymptotic behavior of $\prod_{p\leq n} \left(1 - \frac{1}{p}\right)$ is $\sim \frac{e^{-\gamma}}{\log(n)} \approx \frac{0.56}{\log(n)}$. – Winther Feb 15 '17 at 12:27

The intuition behind the Prime Number Theorem is indeed simple enough that you can explain it to a child.

It’s very intuitive that, other things being equal, as you lower the price of a product, the more of the product will be sold. Because of the phenomenon of discount pricing for wholesale purchases, you can lower your retail price, and still make a profit, by making larger wholesale purchases. The mechanism of discount pricing can be implemented, qualitatively, by means of the (natural) logarithm. That is, the total cost for x items is log(x). (Technically, log(1 + x), but we’re assuming that x is large enough that we can approximate log(1 + x) by log(x).) The unit cost is then log(x)/x. If you grant that, qualitatively, the number of sales is the reciprocal of the unit cost, then you have a real-world analog of, or at least a mnemonic for, the Prime Number Theorem, by taking the number of retail sales (assuming the entire stock is sold) to be pi(x). Then pi(x) times the unit cost is approximately 1. Then pi(x) times log(x)/x is approximately 1. Then pi(x) times log(x) is approximately x. Then x divided by (pi(x) times log(x)) is approximately 1. Then (x divided by log(x)) divided by pi(x) is approximately 1, which is the Prime Number Theorem. To reiterate: the real-world analog / mnemonic is that the number of retail sales is approximately equal to the reciprocal of the unit price, which is something that the first ten-year-old you meet coming down the sidewalk would understand.