Today we're gonna look at the fact that all prime numbers, when you square them, are one more than a multiple of 24.
Which - a lot of people don't believe it,
you were shocked when I first told you about this. You were, you were beside yourself because people think the prime numbers haven't got a pattern and
I get a lot of emails from people saying "Oh, I found a pattern in the prime numbers" I'm like, yes,
there are loads of patterns in the prime numbers. Including this one which we'll test!
So, Brady, what prime number should we do with the black sharpie?
(Brady: Let's do 17.)
7- ahh, okay, 17 squared equals - oh for crying out loud-
Okay, so it's gonna be- - (Brady: Oh you wanted a small one!) - No I can do this 'cause squared's gonna be 170
plus seven times that which is gonna be 70 plus
49. Okay, so, just off the top of my head,
what was that? I'm sorry. Seven, eight, twelve, thirteen - okay, I think it's roughly -
that's not right. 17 times 17 equals
289 - I was right, I doubted myself.
And so I'm saying that's one more than a multiple of 24. And so we can split that apart because we've got 240
hidden in there plus 49 left over. And that's one more than
48, which is a multiple of 24
and so this whole thing here is gonna be, it's 12 times 24 plus 1.
So I argue any prime number you give me, if you square it
you'll get some multiple of 24 plus 1 on the end. - (Brady: 5) - 5 is 25,
that's one more than 24 - you could have opened with that Brady, but no! We do 17 first.
It doesn't work if you go back up and do 2 or 3. So 2 or 3 don't work. - (Brady: Too small.) - Too small.
And - I mean I argue that they're not real prime numbers,
I call them the subprimes, so I would like to ignore those for the purpose of this.
They don't work but everything 5 onwards this always works. But we should prove it right - you don't take my word for these things and
so it comes down to - when I first saw this, first of all
I was amazed. And then I was like, well hang on. There must be a reason why there's this pattern. I was like, well hang on,
there are loads of patterns in the prime numbers.
So there's a nice one involving multiples of 6, and because 24 is a multiple of 6
I was like, you know what, that might be something to do with it.
So I'm gonna very quickly list out a number line.
Okay, so we got those and then let's find our favourites - the primes;
we've got the subprimes hanging out down here, and then we've got the real primes. There's five there, seven there,
11, 13, 17, 19,
and so on. And you go, right where are the multiples of six? There's multiple of six there. It's six. Oh look at that,
there's a prime on either side of it, right? So those two are on either side of a multiple of six.
There's the next multiple of six - look at that! There's a prime on both sides of it,
nothing else in between. Next multiple of six over there, look at that. There's a prime on each side of it.
So the primes are always above and below all the multiples of six. Except it doesn't always work.
So if I kept going with the number line, I stopped at 19. So 23 is a prime,
25 is not a prime. There is our next multiple of six, and only on one side
do we get a prime. 25 is not. Up until now
they have all been, and the reason this one isn't is 5 finally caught up with us.
So 5 is prime but then every 5th number isn't. 10s not, 15s not, 20s not - boom.
So that's knocked this one out.
The moral of story is not that there's something magical about the primes and they happen to always be above and below every multiple of
6, it's just that's the only place they can be. So here's a multiple of 6 and here's the next one,
they can't be at
the even points in between, because we know primes can't be even. So
immediately it knocks out these two and it can't be the number in between because it's a multiple of 3.
Number between each multiple of 6 is a multiple of 3.
So it can't be on any of these which is why it has to be above or below a multiple of 6.
It's just a fancy way of saying
primes don't have 2 or 3 as a factor. And
they're, so they're constrained to those. And so people are happy if you say all primes are odd - ignoring the small ones, right?
And that's just because - that's just another way of saying primes haven't got 2 as a factor.
If you say all primes are 1 more or less than multiple of 6, everyone's like wow!
But all we're saying is they haven't got 3 as a factor! And then when we say all primes squared
give you one more than a multiple of 24, it's a variation on this. It just looks more impressive.
And so the way - I'll show you is the way I first worked it out when I came across it, right? 'Cause I was like, right I'm going
to prove this.
(Phone ringing)
Delivery
So here's what I did. I said any prime number other than two or three, is it either gonna be some multiple of six
plus one, or some multiple of six minus one?
So every k we can put in one of these two categories. And so my thought was I'll just square these and show they're both
one more or one less than a multiple of
24, but then they didn't work, it got really really complicated. So I had another cheating moment when I realised
this k here is either going to be odd or even.
So that k is either gonna equal, let's use m this time, 2m. Or
it's gonna equal - this is or - 2m+1.
It's either even or odd. And so I can split each of these into their two options.
So this one is either gonna be, if I put 2m in there,
it's gonna be 12m plus one, or if I put in 2m plus one, it's going to be 12m
plus seven. And then down here that's either going to be, put in 2m,
that's gonna be 12m minus one or it's gonna be 12m
plus 5, okay.
So now I know every single prime number falls into one of these four categories.
And so then I went through and I took each of these and
squared them to see what happens when you square. Now this is not
exhaustive, like an exhaustive proof where I've checked every single option,
I've just taken all the options and put them into four categories and now I'm going to check each of the categories separately.
So let's do them quickly. m squared plus two times that time- this one's
144m - someone will correct me if I'm wrong!
...minus...2 times it...times 20...plus 25.
Okay. So what we have to do now is show that every single one of these is a multiple of 24 plus 1. And the
first one's reasonably straightforward because that's a multiple of
24, because that's 12 squared, so that's 6 times 24. So we actually put 24
outside of - that's gonna be 6m squared
plus m plus
1. So multiple of 24 plus 1. This one is 24 outside of, again 6m squared
plus seven m
plus two, plus one. So what I've done there's that 48 - sorry, that 49 - I've realised is 48 plus 1,
and so the 2 24s is the 48 plus the one on the outside.
Yeah, same deal again, 24 outside 6m squared minus one plus one.
Oh sorry, minus m. And
finally 24 outside of 6m squared
plus
5m plus 1 plus 1. So there! I've taken every single prime showing that it must be in one of two categories,
above or below a multiple of six,
each of those has to be one of two categories if that multiple six is even or odd.
Those four categories cover every single prime,
I've then expanded them out and shown that if you square them you get some number times 24 - multiple of 24 - plus one,
which proves it right? It's a slightly clever
exhaustive proof where I've put it in categories, and I've dealt with the categories one at a time.
I was so pleased when I got to the end of this, I was like yep!
I knew it had something to do with being one or more one less than a multiple of six. I did some algebra,
I worked it out, I showed some friends of mine and one of them said: why didn't you do it the easy way?
And I was like, ahh,
you know me. I like to do some algebra- what easy way? So it turns out there's an easier way to do this.
So I did it this way, this is mine. I love it. My friend Paul said look, all you're doing is you're looking at p squared
minus 1 and asking is that a multiple of 24? Every prime squared, subtract 1, is it a multiple 24?
Okay, p squared minus 1;
you may remember this from school or you could still be in school and you see that and immediate you think, well that's
difference of two squares. That's p minus 1,
p plus 1. If it's been a while since you did this at school
you can just double-check that. If you multiply these out you'll get back to p squared minus 1.
So what we really want to know is, is this a multiple of 24? Well, what can we say about this?
Well on the number line that's gonna go - over here we're gonna have the number 1 less than p, p minus 1. Here
we're gonna have the prime p and then above it we're gonna have the prime p plus 1.
So actually we've got three consecutive numbers here. And
the prime in the middle hasn't got any factors. So we know every second number is a multiple of 2.
So because these are in a row
we know either those two are a multiple of 2, or that one's a multiple of 2. And this can't be a multiple of 2;
we know p is not even because it can't have 2 as a factor.
So both of these numbers have to have a - they're both multiple of 2.
These are both even numbers. And in fact because they're two consecutive even numbers, one of them,
we don't know which, one of them is a multiple of 4. So either this one's a multiple of 2,
this one's a multiple of 4, or that one's 4 and that one's 2, right? But we know when we multiply them together
the combined total will be a multiple of 8. So now we know this, it is a multiple of
8 because it's two even numbers either side of a prime. And one's 4, one's 2. We have to get 8. Now
we've also got three numbers in a row and
every batch of three numbers, one of them has to be a multiple of 3, every third number is a multiple of 3.
Again it's not the middle one, because we know that one there is not a
multiple of
3. Because it can't have 3 as a factor, it's a prime,
so one of these has to be a multiple of 3. Again, we don't know which but when we multiply them together the total
must be a multiple of 3. So we also know that is definitely a multiple of
3. And if something is definitely a multiple of 3, it's definitely a multiple of 8, it is a multiple of
24. And so that's it - just because the two numbers are either side of a prime, if you multiply them together you get a number
which is a multiple of 24. And actually we've not really used the fact that
this is a prime. All we've used is the fact that it's not even and it's not a multiple of 3.
So what we've actually managed to prove, is that all numbers
which don't have two or three as a factor, if you square them you get a number
which is one more than a multiple of 24, and that all the ones either side of every single six. So
what we've actually managed to prove is both:
all primes are on either side of
a multiple of six, and if you square any number on either side of a multiple of six
you always get a number which is one more than a multiple of 24. And that is one of my favourite prime patterns.
(Brady: You said that your friend's)
(one there was easier, it certainly is prettier and it uses less ink,)
(but I'm not sure that would have been easier to have come up with.)
That's very true. So I'm using easier probably in a strictly
mathematical sense where I guess easier - I'm kind of using it to mean less
turning of the handle. Arguably, you're right. This one is
easier
because there's not a lot of creativity. I can say that - it's my proof, I can say it.
All I've done is just chunked it into predictable categories and then turned the algebraic handle and
tidied it up, and that's my response.
Whereas this one, once you've got it it's easier to follow,
but it wasn't easier to come up with. So I guess I'm saying it's easier from looking at it in hindsight, not easier
coming up with it creatively in the first place. But
mathematicians love a creative proof, right? And so the more creative you have to be coming up with the proof,
normally the more impressive
mathematicians consider that proof.
I like to think here on Numberphile we go pretty deep into our topics, but I'm also aware sometimes
you want to go even deeper, really dive in. Today's episode sponsor,
The Great Courses Plus, is superb for that. These on-demand videos cover everything from,
yes, mathematics, through to other things like looking after your dog or playing chess.
Your teachers are going to be experts from all over the world, leading universities, places like that; and there are over
10,000 video courses to choose from.
Now when I'm going through the site I've got bit of a weakness for videos about Egypt, Egyptology.
This one here: decoding the secrets of Egyptian hieroglyphs, this is definitely one to have a look at. It's presented by Professor Bob Brier
who's one of my favourite Egypt explainers,
he's great. And he's gonna have you writing in hieroglyphs before you know what's happening. Although somehow
I doubt that's the actual rosetta stone behind him - I certainly hope it's not. Now for a free trial go to
TheGreatCoursesPlus.com/numberphile
That should be written on the screen beneath me, and there's also a link down in the video description where you can find
more information.
Oh by the way, that prime number squaring stuff
you just saw Matt talking about? That's just one page among hundreds in Matt's book: Things to Make and Do in the Fourth Dimension.
I'll also include a link to that
underneath in the description.