Indexing begins at one here. An implementation using zero-based array positions must subtract one. The index describes ordering among primes, whereas a prime gapmeasures the numerical distance between neighboring primes. For nonprime x, π(x) still counts primes up to x, but x itself has no prime index.