The Prime Counting Function
-
Definition: The prime counting function, denoted
, counts the number of prime numbers less than or equal to a given number . -
Examples:
, since the primes are . , since the primes are .
-
Nature:
is a step function — it increases by 1 exactly at each prime number. -
Mathematical Interest: A key goal in analytic number theory is to understand how fast
grows as .
Approximations:
Related:
Dream of a Formula
In this video it is presented the (informal) idea of a Riemann converter or Riemann harmonics:

Each non-trivial zero can be seen as a kind of oscillatory function, in such a way that:

That is, the prime counting function is approximately equal to the logarithmic integral and the correcting terms are given by the Riemann harmonics of the nontrivial zeroes of the Riemann zeta function.
To understand this, it is highly helpful to use an analogy from physics or music: think of the prime numbers as a sound wave, and the zeros of the zeta function as the individual frequencies (harmonics) that make up that sound.
When Riemann formulated his exact equation, he basically invented a Fourier transform for the prime numbers. Here is an intuitive breakdown of how those non-trivial zeros act as the correction terms.
- Shifting the Goal Slightly (For Simplicity)
Working directly with(which counts 1 for every prime) makes the exact math extremely clunky. To make the formula cleaner, mathematicians usually look at a related "weighted" prime-counting function called Chebyshev function, denoted as .
Instead of jumping up by 1 at every prime,
- The Explicit Formula
The exact formula (discovered by von Mangoldt, based on Riemann's work) for the weighted prime staircase is:
Here:
(rho) represents the non-trivial zeros of the Riemann zeta function. means we add up the contributions of an infinite number of these zeros.
This formula appears, roughly speaking, from the fact that $$\psi(x) = \frac{1}{2\pi i} \int_{c-i\infty}^{c+i\infty} \left( -\frac{\zeta'(s)}{\zeta(s)} \right) \frac{x^s}{s} ds$$
(see Perron's formula) together with the residue theorem.
Let's ignore the tiny trailing constants. The core of the equation is:
- Turning Zeros into Waves
How does a complex zero,, turn into a "correction" on a graph?
Complex numbers have two parts: a real part and an imaginary part. If the Riemann Hypothesis is true, every single non-trivial zero lies on the "critical line," meaning they all have a real part of exactly
So, we can write a zero as:
Using Euler's formula, an imaginary exponent translates directly into sine and cosine waves. So,
- The Magic of Constructive Interference
Each non-trivial zerogenerates a wave that oscillates around the main line.
- The height
of the zero determines the frequency of the wave (higher zeros oscillate much faster). - The real part
gives the wave its amplitude (since is just ).
When you subtract just the first zero's wave from the smooth line
- In the spaces between prime numbers: The peaks and troughs of all these infinite waves perfectly cancel each other out (destructive interference), keeping the graph perfectly flat horizontally.
- Exactly at a prime number
: All the waves suddenly align to peak at the exact same moment (constructive interference), creating a sharp, vertical jump upwards.
What If a Zero get out of control?
So, what would happen if one of these zeros (