The Equivalence of π, θ and ψ

The Prime Number Theorem is usually quoted as \pi(x) \sim x/\log x — the count of primes below x grows like x/\log x. Open almost any analytic number theory paper, though, and you will find the theorem proved in a completely different-looking costume: \psi(x) \sim x, a clean statement about a sum of logarithms with no 1/\log x in sight. A third form, \theta(x) \sim x, sits in between.

This page is about a small miracle of bookkeeping: these three statements are logically equivalent. Prove any one and the other two fall out for free, purely by Abel summation — no new analysis required. Understanding why they are interchangeable, and which one you should actually reach for when doing the hard work, is the single most useful piece of orientation in the whole subject. Spoiler: the analyst's favourite is \psi, and by the end you will see exactly why the awkward-looking one is secretly the nicest.

Meet the three counting functions

All three measure "how much prime is there below x" — they differ only in how each prime is weighted.

So \pi counts, \theta log-weights the primes, and \psi log-weights the primes and their higher powers. Written out, \psi is

\psi(x) = \sum_{p^k \le x} \log p = \sum_{p \le x} \left\lfloor \frac{\log x}{\log p} \right\rfloor \log p,

because for each prime p the powers p, p^2, \dots, p^k \le x each throw in another \log p, and the largest such k is \lfloor \log x / \log p \rfloor.

A concrete example: all three at x = 10

The primes up to 10 are 2, 3, 5, 7, so \pi(10) = 4. For \theta we log-weight them:

\theta(10) = \log 2 + \log 3 + \log 5 + \log 7 = \log 210 \approx 5.347.

For \psi we also pick up the prime powers \le 10 — namely 4 = 2^2, 8 = 2^3 and 9 = 3^2 — each contributing the log of its base prime:

\psi(10) = \underbrace{(\log 2 + \log 3 + \log 5 + \log 7)}_{\theta(10)} + \underbrace{\log 2}_{4=2^2} + \underbrace{\log 2}_{8=2^3} + \underbrace{\log 3}_{9=3^2} \approx 5.347 + 1.792 = 7.139.

Notice how close \theta(10) \approx 5.35 and \psi(10) \approx 7.14 already are to x = 10, while \pi(10) = 4 is nowhere near — it is x/\log x \approx 4.34 that \pi chases, not x. That single observation is the whole story of the log-weighting: it rescales the count so the target becomes the clean line y = x.

Seeing it: three staircases, one line

Here are all three, rescaled so they should track y = x: the log-weighted count \theta(x), the prime-power version \psi(x), and — to bring \pi onto the same axes — the product \pi(x)\log x. Watch how all three staircases press up against the diagonal:

The two Chebyshev functions \theta and \psi run almost on top of each other (\psi sits a whisker higher, from the prime powers), and \pi(x)\log x weaves around them. All three hug y = x — a visual statement that the three asymptotic laws are really one law seen through three lenses.

Step 1 — \psi and \theta are barely different

Group the terms of \psi by the power k. All the k = 1 terms are exactly \theta(x). The k = 2 terms are \sum_{p^2 \le x}\log p = \theta(x^{1/2}), the k = 3 terms give \theta(x^{1/3}), and so on. The sum is finite because p^k \le x forces k \le \log_2 x:

\psi(x) = \theta(x) + \theta(x^{1/2}) + \theta(x^{1/3}) + \cdots = \sum_{k=1}^{\lfloor \log_2 x \rfloor} \theta\!\left(x^{1/k}\right).

Now bound the tail. The trivial estimate \theta(t) \le t \log t (each of the at most t primes contributes at most \log t) gives \theta(x^{1/2}) \le x^{1/2}\log x, and there are only about \log_2 x terms, each no larger than the second. Hence

0 \le \psi(x) - \theta(x) = \sum_{k \ge 2} \theta(x^{1/k}) = O\!\left(\sqrt{x}\,\log^2 x\right).

Since \sqrt{x}\,\log^2 x is dwarfed by x, dividing by x gives (\psi(x)-\theta(x))/x \to 0. Therefore \psi(x) \sim x and \theta(x) \sim x are the same statement — the prime powers are asymptotically negligible. That is the easy half of the equivalence, and it cost us nothing but a crude bound.

Step 2 — passing between \theta and \pi by parts

The jump from a plain count \pi to a log-weighted count \theta is a job for Abel summation — partial summation, the discrete cousin of integration by parts. Writing \theta(x) = \sum_{p \le x} \log p as a Stieltjes integral against the jump-measure d\pi and integrating by parts gives the two conversion formulas that drive everything:

Each is a clean identity — no approximation, valid for all x \ge 2. The first weighs each unit step of \pi by \log p; the second unwinds the weighting back out. To read off asymptotics we just need to know that the integral terms are of lower order than the leading terms — which is exactly what the next worked example shows.

Worked example — turning \theta(x) \sim x into \pi(x) \sim x/\log x

Suppose we have already proved \theta(x) \sim x (the analytically convenient form). Let us extract the classical PNT from it, using the second identity above. The leading term is immediate:

\frac{\theta(x)}{\log x} \sim \frac{x}{\log x}.

So we only need the integral \int_2^x \theta(t)/(t\log^2 t)\,dt to be small compared with x/\log x. Using \theta(t) = O(t) (Chebyshev's bound — we do not even need the full asymptotic here), the integrand is O(1/\log^2 t), so

\int_2^x \frac{\theta(t)}{t\,\log^2 t}\,dt = O\!\left(\int_2^x \frac{dt}{\log^2 t}\right) = O\!\left(\frac{x}{\log^2 x}\right).

The last step is the standard estimate \int_2^x dt/\log^2 t \sim x/\log^2 x (split the range at \sqrt{x}: below it the integrand is bounded, above it \log t > \tfrac12\log x). Putting the pieces together,

\pi(x) = \frac{\theta(x)}{\log x} + O\!\left(\frac{x}{\log^2 x}\right) = \frac{x}{\log x}\left(1 + o(1)\right),

because the error term x/\log^2 x is exactly a factor 1/\log x smaller than the main term x/\log x. Dividing through, \pi(x)\big/(x/\log x) \to 1 — precisely \pi(x) \sim x/\log x. The conversion is that mechanical: one integration by parts and one lower-order bound.

The payoff: three theorems that are one theorem

Chaining Step 1 (\psi \leftrightarrow \theta) with Step 2 (\theta \leftrightarrow \pi), and running the arrows both ways, collapses the three statements into one.

As x \to \infty, the following are equivalent:

Prove any single one and the entire package is yours. The same equipment upgrades error terms too: a bound like \psi(x) = x + O(x\,e^{-c\sqrt{\log x}}) transfers, via these identities, into the corresponding statement about \pi(x) versus the logarithmic integral \operatorname{Li}(x) — the equivalence is not just for leading-order asymptotics but carries the fine structure along with it.

Why \psi is the analyst's darling

If all three are equivalent, why does every serious proof target \psi? Two reasons, both about algebraic cleanliness.

First, its Dirichlet series is beautiful. The von Mangoldt weights are engineered so that \log n = \sum_{d \mid n}\Lambda(d), and taking Dirichlet series turns this identity into

\sum_{n \ge 1} \frac{\Lambda(n)}{n^s} = -\frac{\zeta'(s)}{\zeta(s)}.

That right-hand side — the logarithmic derivative of the zeta function — is exactly the object whose poles sit at the zeros of \zeta. Because \psi(x) = \sum_{n \le x}\Lambda(n) is the partial-sum (summatory) function of these coefficients, a Perron / contour-integral argument reads \psi(x) \sim x straight off the pole of -\zeta'/\zeta at s = 1. Neither \pi nor \theta has a Dirichlet series anywhere near this tidy.

Second, its arithmetic is smooth. Summing \Lambda over all integers n \le x — not just primes — lets the full weight of the divisor identity \log n = \sum_{d\mid n}\Lambda(d) come to bear, which is what makes elementary manipulations (and the elementary Selberg–Erdős proof) work. Restricting to squarefree primes, as \theta and \pi do, throws that structure away. So the pattern is universal: prove it for \psi, then hand it to \theta and \pi by partial summation.

The three functions are asymptotically proportional to their targets — but they are emphatically not equal to each other, and mixing them up is the classic beginner's slip. \theta(x) \sim x and \psi(x) \sim x, yet \pi(x) \sim x/\log x — a factor of \log x smaller. At x = 10^6, for instance, \pi(x) = 78498 while \theta(x) \approx 998484 and \psi(x) \approx 998699 — the log-weighting genuinely changes the size of the answer by orders of magnitude.

The moral: "equivalent" here means the three asymptotic laws imply one another, not that the functions take the same values. \theta(x) is close to x; \pi(x) is close to x/\log x. Always match each function to its own asymptote — never write "\pi(x) \sim x" or "\theta(x) \sim x/\log x."

Pafnuty Chebyshev introduced \theta and \psi around 1850 — before Riemann's 1859 memoir put complex analysis at the centre of the subject. Working entirely with real-variable estimates, Chebyshev proved that the ratio \pi(x)/(x/\log x) is squeezed between two explicit constants (roughly 0.92 and 1.11), and that if the limit exists it must equal 1. He couldn't prove the limit existed — that needed the zero-free region of \zeta, supplied by Hadamard and de la Vallée Poussin in 1896. But his \psi, invented as a technical convenience, turned out to be the natural quantity all along, because it is precisely the summatory function of the coefficients of -\zeta'/\zeta. A tool built for hand-computation became the beating heart of the analytic theory.