section_path: Analytic properties/Number of primes below a given bound
section_name: Number of primes below a given bound
paragraph_text: Number of primes below a given bound
  
  The prime-counting function π (n) {\displaystyle \pi (n)} is defined as the number of primes not greater than n {\displaystyle n}. For example, π (11) = 5 {\displaystyle \pi (11)=5}, since there are five primes less than or equal to 11. Methods such as the Meissel–Lehmer algorithm can compute exact values of π (n) {\displaystyle \pi (n)} faster than it would be possible to list each prime up to n {\displaystyle n}. The prime number theorem states that π (n) {\displaystyle \pi (n)} is asymptotic to n / log n {\displaystyle n/\log n}, which is denoted as
  
  and means that the ratio of π (n) {\displaystyle \pi (n)} to the right-hand fraction approaches 1 as n {\displaystyle n} grows to infinity. This implies that the likelihood that a randomly chosen number less than n {\displaystyle n} is prime is (approximately) inversely proportional to the number of digits in n {\displaystyle n}. It also implies that the n {\displaystyle n} th prime number is proportional to n log n {\displaystyle n\log n} and therefore that the average size of a prime gap is proportional to log n {\displaystyle \log n}. A more accurate estimate for π (n) {\displaystyle \pi (n)} is given by the offset logarithmic integral