Discover prime numbers with the Sieve of Eratosthenes and primality testing
The Sieve of Eratosthenes is an ancient algorithm for finding all prime numbers up to a given limit. It works by:
All remaining unmarked numbers are prime!
The tool uses trial division: testing if the number is divisible by any integer from 2 to √n.
Why √n? If n = a × b where both a, b > √n, then a × b > n, which is impossible. So at least one factor must be ≤ √n.
Prime factorization breaks a number down into its prime factors. Every integer > 1 can be uniquely expressed as a product of primes.
Example: 60 = 2² × 3 × 5
This is called the Fundamental Theorem of Arithmetic.
By definition, a prime number must have exactly two distinct positive divisors: 1 and itself.
The number 1 only has one divisor (itself), so it doesn't meet this criterion. This definition makes many theorems and formulas work correctly.