Sieve of Eratosthenes
List all primes up to N in near-linear time.
Primes in Bulk
Sometimes you need every prime up to N, not just one check. The Sieve of Eratosthenes finds them all in one sweep. 🧹
The Big Idea
Start by assuming every number is prime. Then cross out the multiples of each prime you find, leaving only true primes behind.