← Back to Games

🏰 Prime Castle Sieve Defense

Watch the Sieve of Eratosthenes eliminate composite numbers!

0
Primes Found
0
Composites Eliminated
0
Remaining
Current Wave
-
Ready to begin sieve...
Unchecked
Prime
Composite

📚 Sieve of Eratosthenes

Ancient algorithm to find all primes up to N:

  1. Start with all numbers 2 to N (unmarked = potentially prime)
  2. Find the smallest unmarked number (it's prime!)
  3. Mark all its multiples as composite (2p, 3p, 4p, ...)
  4. Repeat until you've processed all numbers up to √N
  5. All remaining unmarked numbers are prime! 🎉

Time Complexity: O(N log log N) - very efficient!