The prime counting function, which counts the number of primes less
than or equal to a given value.

INPUT:

x - a real number

prime_bound - (default 0) a real number < 2^32, prime_pi will
make sure to use all the primes up to prime_bound (although,
possibly more) in computing prime_pi, this can potentially
speedup the time of computation, at a cost to memory usage.

Draw a plot of the prime counting function from xmin to xmax.
All additional arguments are passed on to the line command.

WARNING: we draw the plot of prime_pi as a stairstep function with
explicitly drawn vertical lines where the function jumps. Technically
there should not be any vertical lines, but they make the graph look
much better, so we include them. Use the option vertical_lines=False
to turn these off.

Legendre’s formula, also known as the partial sieve function, is a useful
combinatorial function for computing the prime counting function (the
prime_pi method in Sage). It counts the number of positive integers
\(\leq\)x that are not divisible by the first a primes.

INPUT:

x – a real number

a – a non-negative integer

OUTPUT:

integer – the number of positive integers \(\leq\)x that are not
divisible by the first a primes

Legendre’s formula, also known as the partial sieve function, is a useful
combinatorial function for computing the prime counting function (the
prime_pi method in Sage). It counts the number of positive integers
\(\leq\)x that are not divisible by the first a primes.

INPUT:

x – a real number

a – a non-negative integer

OUTPUT:

integer – the number of positive integers \(\leq\)x that are not
divisible by the first a primes