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.

4 short lessons · about 16 minutes · 5 sources · updated November 2026

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

Before you readHow many different sets of primes multiply to make 60, if you ignore the order?

Correct.Not quite. The answer is One.

Only one. 60 is always 2 x 2 x 3 x 5, however you start, and this lesson shows why that one-way breakdown holds for every whole number.

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.

Check yourselfWhich of these numbers is prime?

Correct.Not quite. The answer is 53.

53 has no factors other than 1 and itself. Both others look prime but split, because 51 is 3 x 17 and 57 is 3 x 19.

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

  1. 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.

    Essentials · 4 min

  2. 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.

    Essentials · 4 min

  3. 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.

    Deeper · 4 min

  4. 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.

    Deeper · 4 min

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

  • Percentages and why the base matters

    See why a 20% fall takes a 25% rise to undo, why 5% to 10% is both five points and a doubling, and why you can't average two percentages.

    4 lessons · 21 min

  • When the average is the wrong summary

    When one number stands in for a whole set, which number you pick changes the story. Mean, median and mode tend to pull apart when the shape is lopsided.

    4 lessons · 20 min

  • Fractions and decimals

    A fraction is a number, a division and a share all at once. See why adding needs a common denominator and multiplying doesn't, and why some fractions become decimals that never end.

    4 lessons · 16 min

  • Logarithms, where one step means ten times as much

    A logarithm counts how many times you multiplied. See how that makes earthquake magnitudes, orders of magnitude and half-lives work, and why a scale built this way is easy to misread.

    4 lessons · 22 min

  • Newton, Leibniz and the invention of calculus

    Two men built calculus independently in the late 1600s, and their followers fought over the credit for decades. See what each found, what thinkers in Greece and India had done before, and whose notation won.

    4 lessons · 16 min

  • What a function is, and why it can't always run backward

    A function is a rule that gives each input exactly one output. See why two inputs can share an output, where a formula stops applying, and why working back from an output can fail.

    4 lessons · 17 min

All mathematics & logic topics · Take the quiz