Lesson 11: Sieve of Eratosthenes

The Sieve of Eratosthenes is a method for finding all primes up to (and possibly including) a given natural. This method works well when is relatively small, allowing us to determine whether any natural number less than or equal to is prime or composite.

Open reading material (PDF)

CountNonDivisible

Calculate the number of elements of an array that are not divisors of each element.

Difficulty Level: Medium

CountSemiprimes

Count the semiprime numbers in the given range [a..b]

Difficulty Level: Medium