Mathematics & Logic · Numbers & patterns
Prime numbers
Primes can't be split into smaller factors, and every whole number is built from them in exactly one way. See how to find them, why they never run out, and why online security relies on them.

What you will learn
- Tell a prime from a composite number by whether it splits into smaller whole-number factors
- Explain why each whole number above 1 has exactly one prime factorization, and why that keeps 1 off the list
- Run the sieve of Eratosthenes and explain why crossing out multiples leaves only primes
- Explain why testing divisors up to a number's square root is enough to show it's prime
Lesson 1 of 4 · 4 min
Why every whole number is built from primes
Take 12 square tiles. You can lay them as a 3 by 4 rectangle or a 2 by 6 one. Now try 13 tiles. The only shape that works is a single row.
That's the difference between the two kinds of number. A prime number is a whole number above 1 that can't be written as two smaller whole numbers multiplied together. 13 is prime. 12 is a composite number, because 3 x 4 makes it.
So a prime is a number of things you can't share into equal groups. You can't split 13 cookies into equal boxes unless you use one box, or give each cookie its own box.
Break 60 down. Say you start with 6 x 10. Then 6 is 2 x 3 and 10 is 2 x 5, so you get 2 x 2 x 3 x 5. Start instead with 4 x 15, and you land on the same four primes.
That always happens. The fundamental theorem of arithmetic says every whole number above 1 is a product of primes in exactly one way, apart from the order. Euclid's Elements contained the pieces, and Carl Friedrich Gauss gave the proof in 1801.
So primes work like atoms for multiplication. Each number has its own prime recipe, and no two numbers share one.
Try to recallWhy do mathematicians leave 1 off the list of prime numbers?
Every whole number above 1 has exactly one prime factorization. If 1 were prime, you could tack on as many 1s as you liked, so every number would have endless factorizations. Calling 1 a unit keeps the rule true.
A prime is a number that won't split into smaller factors. Every other whole number above 1 is built from primes in exactly one way, and that's why 1 sits outside the list.
Lessons in this topic
Why every whole number is built from primes
See what makes a number prime, and why each whole number above 1 breaks into primes in only one way.
How to find primes without checking everything
Use an ancient sieve to list primes, and learn why testing a number only takes divisors up to its square root.
Why the primes never run out
Follow Euclid's 2,300-year-old argument that there's always another prime, and see how primes grow sparser as numbers grow.
How primes guard secrets, and what no one can prove
See why multiplying two big primes is easy but undoing it is hard, and meet the twin prime question that's still open.
Three quick stories from this topic
The largest known prime
The largest known prime has over 41 million digits
It's 2 multiplied by itself 136,279,841 times, minus 1, found in October 2024 on thousands of rented cloud graphics chips. As of November 2026 nobody has found a bigger one.
No largest prime
Euclid proved around 300 BC that the primes never end. So a record is only ever the largest known prime, waiting to be beaten.
Why this kind of number
Numbers one less than a power of 2 have a fast special test for primality. That's why most record primes take this form.
When 1 was a prime
Printed tables listed 1 as a prime number as recently as 1956
Derrick Norman Lehmer's 1914 table of primes up to ten million began with 1. Mathematicians only agreed in the 20th century to call 1 a unit instead.
What changed minds
If 1 were prime, every number would have endless prime breakdowns, like 2 x 1 x 1 x 1. Leaving it out keeps the rule that each number factors in one way.
An older debate
Most early Greeks didn't treat 1 as a number at all. Some Roman-era writers didn't count 2 as prime either.
The 17-year code
A 129-digit code number posed in 1977 wasn't cracked until 1994
About 1,600 computers belonging to volunteers worked together to split it into its two primes. The hidden message read "The Magic Words are Squeamish Ossifrage."
Where it came from
The challenge appeared in Scientific American in August 1977, the year RSA encryption was published.
Why it took so long
Multiplying two primes is quick, but recovering them from the product is slow. RSA security rests on that difference.
Sources
- Prime number, Wikipedia
- Fundamental theorem of arithmetic, Wikipedia
- Largest known prime number, Wikipedia
- GIMPS Project Discovers Largest Known Prime Number, Great Internet Mersenne Prime Search (Mersenne Research, Inc.)
- RSA numbers, Wikipedia




