= Prime index
{title2=$\pi(p_n)=n$}
The <prime index> of a <prime number> $p$ is its position in the increasing <sequence> $p_1=2,p_2=3,p_3=5,\ldots$. Thus the index of $11$ is $5$, and the <prime-counting function> satisfies $\pi(p_n)=n$.
Indexing begins at one here. An implementation using zero-based array positions must subtract one. The index describes ordering among <primes>, whereas a <prime gap> measures the numerical distance between neighboring primes. For nonprime $x$, $\pi(x)$ still counts primes up to $x$, but $x$ itself has no <prime index>.
Back to article page