In more detail
The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29; 2 is the only even one. 1 is not prime, a convention that keeps factorisation unique. Every whole number above 1 factors uniquely into primes: 360 = 2³ × 3² × 5. There are infinitely many primes, but they thin out: 25 below 100 and 168 below 1,000. To test a number by trial division you only need to try primes up to its square root, because any larger factor would pair with a smaller one.
Why it matters
Primes underpin public-key encryption such as RSA, because multiplying two large primes is easy while factoring the product is hard. Hash tables often use prime sizes to spread keys evenly. Prime factors also give the Greatest common factor (GCF) and least common multiple of two numbers directly.
Example
Is 221 prime? √221 ≈ 14.87, so test the primes 2, 3, 5, 7, 11 and 13:
221 / 2, 3, 5, 7, 11 → remainders 1, 2, 1, 4, 1
221 / 13 = 17 → 221 = 13 × 17, not prime
All primes above 3 have the form 6k ± 1 (e.g. 29 = 6 × 5 − 1, 31 = 6 × 5 + 1), but not every such number is prime: 25 = 6 × 4 + 1 = 5².
Common confusion
"Coprime" (relatively prime) describes a pair of numbers whose Greatest common factor (GCF) is 1, such as 8 and 15; neither number has to be prime.