HomeScience GlossaryPrime Number Theorem: How Primes Thin Out Among the Integers

Prime Number Theorem: How Primes Thin Out Among the Integers

The prime number theorem states that the number of primes below any given integer n is approximately n divided by the natural logarithm of n. Proved in 1896, it connects prime distribution to the Riemann zeta function.

Share
Science Glossary · Explore this series
June 1, 2025
Updated April 4, 2026
Key Takeaways
  • Primes below n number approximately n/ln(n) | Hadamard and de la Vallee Poussin proved this independently in 1896 | The logarithmic integral Li(x) predicts prime counts within 0.003% at one billion | The theorem underpins RSA encryption security estimates

The prime number theorem states that the number of primes below any given integer n is approximately n divided by the natural logarithm of n. Proved independently in 1896 by Jacques Hadamard and Charles de la Vallee Poussin, it transformed the study of prime numbers from guesswork into precise asymptotic analysis.

Why It Matters

Prime numbers are the atoms of arithmetic. Every integer greater than 1 is either prime or a product of primes. Yet their distribution among the integers looks irregular, almost random.

The prime number theorem reveals that this apparent randomness follows a simple, predictable pattern at large scales.

Key figure

1896

Year independently proved by Hadamard and de la Vallee Poussin

That pattern matters well beyond pure mathematics. Modern encryption, including the RSA algorithm that secures most internet transactions, depends on the difficulty of factoring large numbers into their prime components. The prime number theorem quantifies how common large primes are, which directly informs how hard those factoring problems remain.

The theorem also sits at a crossroads in mathematics. Its proof required tools from complex analysis (the study of functions involving imaginary numbers) to answer a question about ordinary counting numbers. That unexpected connection opened an entire field: analytic number theory.

How It Works

The prime-counting function, written as pi(x), counts how many primes exist up to a given number x. The prime number theorem says that pi(x) is asymptotically equal to x/ln(x), meaning the ratio of pi(x) to x/ln(x) approaches 1 as x grows without bound.

A more accurate approximation uses the logarithmic integral, Li(x), defined as the integral from 2 to x of 1/ln(t). The French mathematician Adrien-Marie Legendre first conjectured the x/ln(x) form around 1798. Carl Friedrich Gauss, possibly even earlier, proposed Li(x) as the better estimate.

At x = 109, for instance, pi(x) = 50,847,534 while Li(x) predicts 50,849,235, an error of just 0.003%.

Key figure

0.003%

Error of Li(x) at one billion

Both Hadamard and de la Vallee Poussin proved the theorem by showing that the Riemann zeta function has no zeros on the line where the real part equals 1. The zeta function, introduced by Bernhard Riemann in an 1859 memoir, encodes information about prime distribution in its complex zeros.

In 1949, Atle Selberg and Paul Erdos produced "elementary" proofs that avoided complex analysis entirely, using only properties of logarithms and real-valued estimates. The word "elementary" here means free of complex-variable methods, not simple.

Key Context

The Riemann hypothesis, perhaps the most famous unsolved problem in mathematics, predicts the exact locations of the zeta function's zeros. If true, it would sharpen the prime number theorem's error term to pi(x) = Li(x) + O(sqrt(x) log x). The mathematician John Edensor Littlewood proved in 1914 that the difference between pi(x) and Li(x) changes sign infinitely often, with the first reversal estimated near x = 10316.

Mathematicians continue to find new proofs. As Quanta Magazine reported in 2020, multiple fundamentally different proof strategies now exist, each illuminating different aspects of prime distribution. Florian Richter of Northwestern University published a new elementary proof that emerged while working on extensions of the theorem to broader number-theoretic settings.

FAQ

Is the prime number theorem the same as the Riemann hypothesis?

No. The prime number theorem is a proved result about the approximate density of primes. The Riemann hypothesis is an unproved conjecture about where the Riemann zeta function's complex zeros lie. If the Riemann hypothesis is true, it would give a much tighter error bound for the prime number theorem.

How accurate is the approximation x/ln(x) for counting primes?

At small numbers the approximation is rough. At x = 1,000, pi(x) = 168 while x/ln(x) gives about 145, an error of roughly 14%. The logarithmic integral Li(x) performs much better: at x = 10^9, it predicts the prime count within 0.003% of the true value.

Does the prime number theorem have practical applications?

Yes. It underpins the security estimates for RSA and other public-key encryption systems, which rely on large prime numbers. The theorem tells cryptographers how densely primes are distributed at any given magnitude, informing decisions about key size and computational difficulty.

Why did the proof require complex analysis?

The original 1896 proofs by Hadamard and de la Vallee Poussin used properties of the Riemann zeta function, which is defined over the complex numbers. Showing that its zeros avoid the line Re(s) = 1 was the key step. Elementary proofs found in 1949 by Selberg and Erdos avoided complex analysis, demonstrating alternative routes to the same conclusion.

Sources

Related Reading

riemann hypothesis
Riemann Hypothesis: The Conjecture That Controls Prime Numbers
Mersenne Primes
Mersenne Primes: The Largest Primes Ever Found
Prime Numbers
Prime Numbers: Definition, Properties, and Why They Matter
Fermat's Last Theorem
Fermat's Last Theorem: The 358-Year Proof

Fact Check: Claim-by-Claim Verification Verified

All 16 claims verified across Claude and Perplexity sonar-pro-search. One soft claim about proof count softened from "at least seven" to "multiple fundamentally different."

1 Supported
Primes below n approximate n/ln(n)
Standard statement of the prime number theorem confirmed by Wikipedia and MathWorld.
2 Supported
Proved 1896 by Hadamard and de la Vallee Poussin
Both independently proved it in 1896 using Riemann zeta function properties.
3 Mostly supported
RSA encryption depends on prime distribution
PNT quantifies prime density informing key sizes; practical crypto uses additional refined bounds.
4 Supported
Proof used complex analysis for number theory
1896 proofs applied zeta function (complex) to pi(x), birthing analytic number theory.
5 Supported
pi(x) asymptotically equals x/ln(x)
lim pi(x)/(x/ln(x)) = 1 as x approaches infinity.
6 Supported
Li(x) defined as integral from 2 to x of 1/ln(t)
Standard definition; offset Li(x) sometimes used but definition as stated is correct.
7 Supported
Legendre conjectured x/ln(x) form around 1798
Legendre proposed his form in 1798 per Wikipedia PNT history.
8 Supported
Gauss proposed Li(x) as better estimate
Gauss conjectured pi(x) ~ li(x) around 1792-1793 in private notes.
9 Supported
pi(10^9) = 50,847,534; Li error 0.003%
Exact: pi(10^9) = 50,847,534; Li(10^9) - pi(10^9) = 1,701 (~0.00334%).
10 Supported
Proofs showed zeta has no zeros on Re(s)=1
Hadamard and de la Vallee Poussin proved zeta(s) nonzero for Re(s) = 1.
11 Supported
Riemann introduced zeta function in 1859 memoir
Riemann's 1859 paper linked zeta zeros to prime distribution.
12 Supported
Selberg and Erdos produced elementary proofs in 1949
Independent elementary proofs in 1949 avoiding complex analysis per Columbia historical account.
13 Supported
RH would sharpen error to O(sqrt(x) log x)
Von Koch (1901) showed RH implies this bound.
14 Supported
Littlewood 1914: pi(x)-Li(x) sign changes infinitely
Proved infinitely many sign changes; first reversal estimated near 10^316.
15 Supported
Multiple fundamentally different PNT proof strategies exist
Quanta Magazine (2020) discusses ongoing re-proofs.
16 Supported
Richter published new elementary proof
Florian Richter (Northwestern) published elementary PNT proof per arXiv.

Sources used for verification

Share
Related Articles
AI In Science Connects the Dots, But Only In Fields That Are Fragmented

An analysis of 80 million papers shows AI boosts originality where knowledge is scattered and connections are weak, but contributes little novelty in structured science.

"Keep Humanity Safe From AI," Urges Pope Leo XIV

Pope Leo XIV's first encyclical reaches the same verdict on AI as the labs building it, then parts ways over the meaning of human limits.

AI Solves Erdős Math Problem: What's Next for AI in Mathematics?

An AI solved an 80-year-old Erdős math problem by walking a path mathematicians had collectively avoided.

Is AI Making You Dumber? Not If You Challenge It

Cognitive debt is the cost of letting AI think for you. New research shows the difference between healthy and harmful AI use comes down to one habit.