commands → primecount

primecount(A)

The primecount command computes the number of primes less than or equal to A.

Examples

primecount(100);
	25

primecount(10^6);
	78498

Algorithm

The computation uses a modified Meissel method.

References

Link to the prime counting function on Wikipedia