Exercise 1004Combinatorics › Inclusion-exclusionL1Added 3 Nov 2026
The sieve of Eratosthenes as IE
#IE#sieve#primes
Statement
Use IE to count primes up to .
Hint
Apply the sieve: exclude multiples of (primes up to ), then handle the primes separately.
Show solutionHide solution
Solution
Multiples of up to . From IE: .
Not divisible. integers not divisible by up to : .
Primes. Excluding , and adding : primes.
Conclusion. .