Prime-counting function

The values of π(n) for the first 60 positive integers

In mathematics, the prime-counting function is the function counting the number of prime numbers less than or equal to some real number x.[1][2] It is denoted by π(x) (unrelated to the number π).

A symmetric variant seen sometimes is π0(x), which is equal to π(x) − 12 if x is exactly a prime number, and equal to π(x) otherwise. That is, the number of prime numbers less than x, plus half if x equals a prime.

  1. ^ Bach, Eric; Shallit, Jeffrey (1996). Algorithmic Number Theory. MIT Press. volume 1 page 234 section 8.8. ISBN 0-262-02405-5.
  2. ^ Weisstein, Eric W. "Prime Counting Function". MathWorld.