Prime Area: the 1/ln x curve

The Prime Number Theorem says primes are distributed with density 1/ln x. So the area under 1/ln x between two numbers should be close to the actual number of primes between them. Pick a range and watch it.

Why this works

xπ(x) — real primesLi(x) = ∫ 1/ln t dtLi(x) − π(x)

Legendre's guess x/ln x was only an approximation; the better estimate is the logarithmic integral Li(x) = ∫₀ˣ dt/ln t. The area between two numbers — not the height of the curve — is what counts primes. (Actual π(x) is computed by a sieve in your browser.)