MathorynMathematical Formula Database

Number Theory

Prime Number Theorem

The prime number theorem says that the number of primes up to xx is asymptotically x/ln⁡xx/\ln x, so primes become rarer roughly like 1/ln⁡x1/\ln x. It is used to estimate how many primes lie below a bound and the typical gap between primes.

π(x)∼xln⁡x\pi(x)\sim\frac{x}{\ln x}
LaTeX\pi(x)\sim\frac{x}{\ln x}

Variables

π(x)\pi(x)
number of primes ≤ x
ln⁡x\ln x
natural logarithm
∼\sim
ratio tends to 1 as x grows

Example

Estimate π(1000)\pi(1000).

  1. 1000ln⁡1000=10006.9078\frac{1000}{\ln1000}=\frac{1000}{6.9078}.
  2. The true count is 168168.

Answer: Estimate ≈144.8\approx144.8 versus 168168 actual primes.

Related formulas