Wednesday, 16 December 2020

How Many Primes Are There?

At first thought it might seem obvious that there is an unending supply of prime numbers.

If we think a little longer, a bit of doubt might intrude on our certainty. A small number like 6 has factors 2 and 3. There aren’t many more options to try as factors. Larger numbers like 720 have more numbers smaller than them, and that means more numbers which could be factors.

Let’s think about this another way. Every multiple of 2 is not a prime number, every multiple of 3 is not a prime number, every multiple of 4 is not a prime number, and so on. All these multiples are reducing the probability that a large number is prime.

We might be tempted to think that eventually prime numbers just fizzle out. Instead of relying on intuition, let’s decide the matter with rigorous mathematical proof.

Video: [youtube]

Slides: [pdf]


Proof There Are Infinitely Many Primes

A proof is not an intuition, nor is it a set of convincing examples. A proof is a watertight logical argument that leads to a conclusion we can’t argue with.

The proof that there is no limit to the number of primes is ancient and rather elegant, due to Euclid around 300 BC, and a nice one to have as our first example.

Let's start by assuming the number of primes is not endless but finite. If there are n primes, we can list them. 

p1,p2,p3,p4pn

We can create a new number x by multiplying all these primes together.

x=p1p2p3p4pn

This x is clearly not a prime number. It’s full of factors like p1 , p3 and pn.

Let’s make another number y in the same way, but this time we’ll also add 1.

y=p1p2p3p4pn+1

Now y could be a prime number, or it could not be a prime number.

These are the only two options for any positive whole number.

If y is prime then we have a problem because we’ve just found a new prime number which isn’t part of the original finite set p1,p2pn. How do we know it’s not part of the original set? Well y is bigger than any of the primes in the list because we created it by multiplying them all together, and adding 1 for good measure.

So perhaps y is not a prime. In this case, it must have factors. And the factors must be one or more of the known primes p1,p2pn. That means y can be divided by one of those primes pi exactly, leaving no remainder. Let’s write this out.

ypi=p1p2p3p4...pnpi+1pi

The first part divides neatly without a remainder because pi is one of the primes p1,p2pn. The second part doesn’t divide neatly at all. That means y can’t be divided by any of known primes. Which again suggests it is a new prime, not in the original list.

Both of these options point to the original list of primes being incomplete.

And that’s the proof. No finite list of primes can be a complete list of primes. So there are infinitely many primes.


A Common Misunderstanding

It is easy to think that p1p2p3p4pn+1 is a way of generating prime numbers. This is not correct. The proof only asks what the consequences are if p1p2p3p4pn+1 is prime, under the assumption that we have a limited list of primes p1,p2,p3,p4.pn.

We can prove that p1p2p3p4pn+1 is not always prime by finding just one counter-example. If we use prime numbers 2, 3, 5, 7, 11 and 13, we can see that 23571113+1=30031 which is not prime because 30031=59509.


No comments:

Post a Comment