Category
Level
The Sieve of Eratosthenes marks multiples of each prime to find all primes up to n in O(n log log n) time.