Prime Numbers
The codes that protect online banking and private messages are built from enormous
prime numbers — special numbers that stubbornly refuse to be broken into
smaller factors. Before we can see why they are so useful, let us meet them properly.
A prime number has exactly two
factors:
1 and itself, and nothing else divides into it evenly. That
word exactly is doing all the work — not three factors, not one, but precisely
two.
A number with more than two factors is called composite instead. Take
12: it splits into 1, 2, 3, 4, 6 and
12 — six factors in all — so it is composite. Compare that with
7, whose only factors are 1 and
7: that is a prime.
The smallest primes are 2,\; 3,\; 5,\; 7,\; 11,\; 13,\; 17,\; 19,\; \dots
They never run out, but they do get rarer as the numbers grow — and there is no simple rule for
when the next one will appear, which is part of what makes them so fascinating to mathematicians.
See it as rectangles
Here is the picture that makes it click. Take n dots and try to arrange
them into a full rectangle with more than one row. The number of rows and the
number of columns are always factors of n, because rows times
columns equals the total.
-
A composite number always makes a proper rectangle. For example
12 = 3 \times 4, so 12 dots fill a tidy
3-by-4 block — those sides,
3 and 4, are two of its factors.
-
A prime number stubbornly refuses. Try as you might,
7 dots only ever line up as a single straight row,
1 \times 7 — never a real rectangle — because
1 and 7 are its only factors.
So here is a test you can see: if the dots can only ever make a thin
1 \times n line, the number is prime. If they can be packed into a
chunkier rectangle, it is composite.
Try it yourself. Press Refresh for a brand-new number between
2 and 20: the dots pack into the fullest
rectangle they can. A single line means prime; a chunky block means composite.
Here is the same idea as an animation. Press play, then replay — each time it tries a different
small number, so you watch some fill a rectangle and others fall into a single lonely row.
Two numbers everyone trips over
1 is not prime. It has only a single factor —
just 1 itself — and a prime needs exactly two. So the primes
begin at 2, not at 1.
And 2 is the only even prime. Every other even number
— 4, 6, 8, 10, \dots — can be split into two equal rows, so it always
has 2 as an extra factor and is composite. After
2, every prime is odd.
The two traps that catch everybody:
- 1 is not prime. It has only
one factor, and a prime needs exactly two. So the smallest
prime is 2.
- 2 is prime even though it is even. "Even" does
not mean "not prime" — it just means divisible by 2, and for
2 that divisor is itself. It is every other even
number that gets an extra factor.
Three worked examples
-
5: try to share 5 dots into rows — you
only ever get a single line of five. Factors: 1 and
5. Prime.
-
9: the dots snap into a neat 3 \times 3
square. Factors: 1, 3 and 9 — three of
them. Composite. (A common trap: 9 is odd, but odd
does not mean prime!)
-
11: no rectangle works — only a row of eleven. Factors:
1 and 11. Prime.
You have 7 cookies and you want to lay them out in tidy equal rows on
a plate. Two rows? One row gets four, the other three — not equal. Three rows? Same problem. The
only way to make every row equal is one single row of seven (or seven rows of one). That "you
just can't split it evenly" feeling is exactly what makes 7 prime.
Now try 12 oranges in a box. Suddenly you have choices:
2 rows of 6,
3 rows of 4, or
4 rows of 3 — all perfectly even. Each
arrangement shows off a different pair of factors. A number that can be boxed up so many ways is
the very opposite of prime: it is richly composite.
Khan Academy explains prime numbers here: