Decoded logoDecoded
Mathematics, AI & the Nature of Reality

LEARN

Prime Numbers 101

A beginner-friendly introduction to prime numbers, why they matter, and why mathematicians are still fascinated by their distribution.

Type
Explainer
Difficulty
Beginner
Length
9 min read

What is a prime number?

A prime number is a whole number greater than 1 that has exactly two divisors: 1 and itself. The number 7 is prime because nothing divides it evenly except 1 and 7. The number 8 is not, because 2 and 4 divide it as well. Numbers that are not prime are called composite.

One small rule catches people out: 1 is not prime. It has only a single divisor, itself, not two. Keeping 1 out of the club turns out to matter enormously, as the next section shows.

The building blocks of integers

Primes are often called the atoms of arithmetic. Take any whole number bigger than 1 and you can build it by multiplying primes together. 12 is 2 x 2 x 3. 30 is 2 x 3 x 5. 91, which looks like it might be prime, is really 7 x 13.

Every composite number is just a particular recipe of primes. That is why primes feel fundamental: they are the pieces that cannot be broken down any further, and everything else is assembled from them.

The Fundamental Theorem of Arithmetic

This idea has a formal name: the Fundamental Theorem of Arithmetic. It says that every whole number greater than 1 can be written as a product of primes in exactly one way, ignoring the order of the factors.

The uniqueness is the powerful part. There is no second, secret way to factor 12 into primes. This is also why 1 is excluded from the primes: if 1 counted, you could write 12 as 2 x 2 x 3, or 1 x 2 x 2 x 3, or 1 x 1 x 2 x 2 x 3, and the 'exactly one way' promise would collapse.

How are primes distributed?

Here is where primes get mysterious. As you count upward, they gradually thin out. There are plenty of primes below 100, fewer in each block of a hundred as you climb, and long stretches of composite numbers in between. Yet Euclid proved over two thousand years ago that they never run out: there are infinitely many primes.

So primes are both endless and increasingly rare, and they do not follow an obvious pattern. You cannot write a simple formula that spits out the next prime. The Prime Number Theorem, proved in 1896, gives the big-picture trend: near a large number n, primes appear roughly once every ln(n) numbers. It describes the fog, but not exactly where each tree stands.

Why the distribution is still an open question

The Prime Number Theorem tells us how densely primes are packed on average, but not how much the real count wobbles around that average. Understanding the size of that wobble, the error term, is one of the deepest unsolved problems in mathematics. In the episode, Professor Murty describes the distribution of primes as a question mathematicians are still actively working to understand, and his own research in number theory lives in exactly this territory.

A first look at the Riemann Hypothesis

In 1859, Bernhard Riemann connected the primes to a single object from calculus called the zeta function. He noticed that the exact rhythm of the primes, how tightly they hug the average predicted by the Prime Number Theorem, depends on where that function equals zero.

The Riemann Hypothesis is the claim that all of these important zeros line up neatly along one vertical line. If it is true, the primes are as evenly behaved as they could possibly be. If it is false, they hide surprises. More than 160 years later, no one has proved it, and it remains one of the most famous open problems in all of mathematics. You do not need the machinery to take away the headline: the precise pattern of the primes is still, genuinely, unknown.

From pure curiosity to cryptography

For centuries, prime numbers were studied for their own sake, with no thought of use. Then modern cryptography arrived. Much of the security that protects online banking and private messages rests on a simple asymmetry: multiplying two enormous primes together is easy, but taking the result and finding the original primes again is, so far, extraordinarily hard.

That gap between easy-to-do and hard-to-undo is what keeps encrypted data safe. It is a striking example of a theme raised in the episode: mathematics pursued out of pure curiosity can turn out, decades or centuries later, to underpin the everyday machinery of the world.

THINK IT THROUGH

Five questions to check your understanding and stretch it a little further.

  1. Why does excluding 1 from the primes make the Fundamental Theorem of Arithmetic simpler to state?
  2. Show that 91 is not prime by finding its prime factors. What made it look prime at first glance?
  3. Euclid proved there are infinitely many primes. Why is it surprising that something infinite can also become steadily rarer as you count upward?
  4. The Prime Number Theorem predicts the average spacing of primes. Why is knowing the average not the same as knowing exactly where each prime falls?
  5. Cryptography relies on multiplication being easy and factoring being hard. What might happen to online security if someone found a fast way to factor large numbers?
All Episode 3 resourcesListen to the episode →