structural:summarization
Algorithms for evaluating π (x)

A simple way to find π (x), if x is not too large, is to use the sieve of Eratosthenes to produce the primes less than or equal to x and then to count them.

A more elaborate way of finding π (x) is due to Legendre (using the inclusion–exclusion principle): given x, if p, p,…, p are distinct prime numbers, then the number of integers less than or equal to x which are divisible by no p is

(where ⌊ x ⌋ denotes the floor function). This number is therefore equal to

when the numbers p, p,…, p are the prime numbers less than or equal to the square root of x.