Prime number theorem

π(x) ~ x / ln(x). More precisely: Li(x) is better approximation. Riemann hypothesis controls error.

Advertisement

Legendre's formula

π(x) = π(√x) - 1 + Φ(x, √x) where Φ counts numbers ≤ x coprime to first primes.

Advertisement

Meissel-Mertens

Improved recursion. Deleglise-Rivat: O(x^(2/3) / log² x) time, O(x^(1/3)) space.

Complexity

Best known: O(x^(2/3+o(1))). Enables π(10^25) computation.