= Prime-counting function
{title2=$\pi(x)$}
{wiki}
The <prime-counting function> $\pi(x)$ counts the <prime numbers> not exceeding a real bound $x$:
$$
\pi(x)=\#\{p\leq x:p\text{ is prime}\}.
$$
Thus $\pi(10)=4$, $\pi(11)=5$ and $\pi(12)=5$. It is a nondecreasing <step function> with a jump of one at each <prime number>, and $\pi(x)=0$ for $x<2$.
Computing one large value is different from listing every <prime number> below it. A <number-theoretic sieve> can do both up to a moderate bound; <Legendre prime-counting formula> and the <Lehmer prime-counting algorithm> instead organize counts of allowable factors. The <Prime number theorem> describes the long-term scale $\pi(x)\sim x/\log x$, rather than exact individual jump locations.
Back to article page