What is a Prime Number?
A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. The fundamental theorem of arithmetic states that every natural number greater than 1 is either a prime number or can be uniquely represented as a product of prime numbers.
Core Definitions
Numbers with exactly 2 factors. (e.g., 2, 3, 5, 7, 11, 13...)
Numbers with more than 2 factors. (e.g., 4, 6, 8, 9, 10, 12...)
Sieve of Eratosthenes
One of the most efficient ways to find all primes up to a specific limit. The process involves:
List all numbers from 2 up to your limit.
Start with 2, mark all its multiples as not prime.
Move to the next unmarked number (3) and mark its multiples.
Repeat until the square of the current number exceeds the limit.