It's a little bit like Pascal's triangle or it's in that kind of similar vein where we're going to
have these rows of numbers and each row depends on what happened in the previous. In the first
row I just write 1, 1. Then for the next row every time an adjacent pair of numbers adds up
to 2 I'm going to insert that in between them. So I'm going to take a 2 and kind of put it in
between those two 1s. And so for the third row every time two numbers add up to 3 and
they're next to each other I'll insert that 3. So this will look like 1; because 1 plus 2 is 3
I insert a 3 in there. I keep that 2, 2 plus 1 is 3 so I insert a 3 in there and then I keep
that 1. So each one it has all of the numbers from the previous sequence we're just inserting
n for the nth row at various points. So for the next one I insert a 4 whenever
adjacent numbers add to 4; so I'll have 1, insert the 4 before the 3 and we'll kind of
go through the only other spot to insert is between that other 3. So I have the 2,
I have the 3, insert a 4, and then 1. I'll keep going for a couple more rows just to see it.
Between the 1 and the 4 I'm going to have to insert a 5, but also between the 2s and the
3s I'm going to have to insert a 5. So I'll take 1, 5, and then 4, 3, 5; keep that 2,
another 5; 3, 4 insert my last 5 and then a 1. For good measure I'll just do one more. Between
the 1 and the 5 that adds up to 6, uh none of the next adjacent ones seem to add up to 6
so the only other one I have to add is at the end. So this grows by a smaller amount. Now someone
comes along and they're just asking questions about this, what are the patterns I can observe
in this Pascal-esque pyramid; and if they just count how many elements are there in each row
they'd say this one has two numbers in its row, this one has three numbers, this one here has
five numbers, seven, eleven, thirteen. And so you're compelled to ask, okay how- is this- - (Brady: Prime numbers!)
Yeah and, you know, I could say is there any reason that we should expect prime numbers from this? You know
is- this is just a completely random tower, you know is there any reason we might expect prime numbers?
And I could say, actually this isn't as random a tower as you might think, it's related to these
things called Farey sequences, where if I want to write out what are all of the rational numbers
where the biggest possible denominator is 1 that sits somewhere in the interval from 0 to 1 there's
really only two rational numbers available - I can have 0 which I could write a 0 over 1 or
1, which is 1 over 1. And if I say, okay what are all the rational numbers in that interval? You know,
kind of the unit interval from 0 to 1 with a denominator that is at most 2. And you can say,
well I've got those those two that I already had, but now could also include 1/2 into those. And
so you know kind of might mark 1/2. And what if we allow the denominator to get as big as 3?
And he said, well in that case I can have all of the ones that I previously had but also 1/3
is available, and 1/2, and also 2/3 is available. And I'm writing them in the order that
they would show up on the number line so I'm kind of sorting them from least to biggest. You can show
actually that this sequence here of this Farey sequence, all of the rational numbers maximized by
a certain denominator, is exactly the same as what we were doing up here. All of the denominators on
the bottom correspond to one of the rows up here. And there's a kind of cute reason for it, but when
you have a sequence of three different rational numbers in this Farey sequence- so I'll just do one
more row to kind of see like where does 1/4 or the fourths fit in. We've got 0 over 1,
1/4 is going to fit in here between that and 1/3 then we've got 1/2, then 1/3 and then
3/4 comes up there, and then 1. If we just look at three adjacent elements - so maybe a
take these here. Note if I add up the numerators of the two on the outside, and then if I add up the
denominators also, so I add up the 2 and the 4, 2 + 4 and I make a fraction out of those,
in this case that's the same as 4/6 which is the same as 2/3. This way of combining rational
numbers where I add the numerators and add the denominator; it has a fancy name, it's called the
mediant. It's kind of like what a- what someone who hasn't yet learned about fractions might think you
do when you're supposed to add two fractions. It's not a wholly useless operation, it always gives
you something that's between those two. And in fact in these Farey sequences it'll always be
the case that the mediant of two that are offset gives you the one that sits in between. You can
kind of see the connection between this and the pyramid because you need the denominators to add
up so every time you're squishing in, you say hey I'm going to introduce the possibility that 5 is a
denominator. The only way that that could happen is if it's two neighbors had denominators that
added up to 5. So you look in the previous sequence, that corresponds to all the previous
rational numbers, and you say, hey when are those two denominators going to add up to 5? That's
where I need to insert one. But it looks so much pure and pristine when we have this pyramid and
I don't mention that it's related to rational numbers. So you might say, oh it's kind of a
natural object and if you think hard about when do certain rational numbers come up? The amount
that you're adding has a lot to do with the number of factors of that. For example, this next time when
I'm adding 1/5, I actually know we're going to get a lot more numbers because 5- we have to
add 1/5, 2/5, 3/5, 4/5 - none of those reduce. Whereas when I add 6 it's
not that we're going to add 1/6, 2/6/ 3/6, 4/6 because 2/6 is already accounted
for, 3/6 is always accounted for. So there's some you know loose connection to the idea of
how divisible is the next number and things like that. - (Priminess is in there.) - Priminess is in there right? So we might expect.
(So the million dollar question - does this thing keep spitting out prime numbers?)
Sadly, um, the pattern actually breaks. And there's a there's a little hint to when it breaks too um so
I'll do a couple more rows. We should expect that we need to insert numbers corresponding to 1/7, 2/7,
3/7, 4/7 - all of these because none of these fractions reduce I'm expecting.
(So you're using what we learned there to help guide you here now.) - I know that I'm going to be
inserting six different 7ths basically. And so this is now interesting, we count how many
are there, we've got- oh we should know it's going to be 13 plus 6. So on the one
hand the pattern continues, but on the other hand uh you know there's a little chink in the armor
because 17 is sitting here just kind of wondering why it's been left out of the club. - (Yeah this is a-)
(this is a worrying sign.) - It's a worrying sign but it does actually continue. The faster way to do
this - rather than inserting them all like this - I can now ask, you know, how many 8ths are we
going to be adding? How many reduced fractions are there with an 8? And the reduced fractions with
8 are basically just all the odd numbers. So there's four that I should be adding so I kind
of know that the next one is going to get me to 23 regardless of how many I insert in there. And
then 9, similar. So 1/9, 2/9, 3/9 is not reduced but 4/9, 5/9. 6/9 is reduced so I won't include
it. 7/9 and 8/9. People who are curious, the- the number that we're counting here,
all of the basically numerators that don't share any divisors with a denominator would be called
the Euler totient function of your number 9. And that's basically counting how many numbers
are there like this, numbers less than 9 that don't share any factors with it. So here we know
that we would be adding 6 and that gets us to 29, which again feels pretty good, um and then in
terms of 10; you know the Euler totient function of 10 saying, hey how many numbers up to 10 uh don't
share any factors with it? It's actually only four, you can see this with 1/10, 2/10 isn't
good, 3/10 is good, 4/10 no good, 5/10 no good, 6/10 no good. All of
those reduce. 7/10 and 9/10. These- I mean you can kind of know this because these are
the last digits you would expect of prime numbers, all the other- there's only four digits available.
So if we add 4 to this that's when- that's when it properly breaks. - (It broke. It properly broke.)
Properly broke. And in this case uh, you know in our previous example we could do a little
bit of analysis to say, oh well you know it was necessarily indivisible by 2, 3 and 5 so there's
a good reason. As far as I can tell this is just a meaningless coincidence, um this is a good example
of uh Richard Guy's strong law of small numbers because as we go through these first few numbers
we can have a little bit of a sense that there's a likelihood they'd coincide with primes. Because
it starts with 2, and then you add 1 to it, and then thereafter you're always adding an even number so
you're either- you know, typically adding a 2 or a 4 or maybe a 6 in there. And so you're getting
things that are odd. And so if you think of it as a probabilistic process you kind of guaranteed not
to hit any even numbers so that gives you a little something and when the numbers are so small; if
you're an odd number, you know, it's not guaranteed that you're prime but it's more likely. It's
like 50% more likely you will be. - (So we're playing around in this part of the number line where the)
(primes are still pretty dense?) - Exactly yeah. And so you're likely to see these sorts of patterns that
um just they just don't hold that long. There's plenty of things like this actually where I think
when we do pencil and paper intuition building, it's common to just deal with smaller numbers,
and you know the thing that someone might want to take away is understand: is there a way that small
numbers are not representative of the larger numbers? And for instance, how many primes are
there between 0 and 100? It's about 25% of them. That's a very atypical part of the number line,
right, because you go out to any other part and uh it's many fewer that are there. - (It's like if you)
(watch Hollywood movies you would think everyone on Earth is really good looking.) - Exactly, yeah, yeah.
If uh if prime numbers are like the sexiest numbers available, right, that part of the number
line right towards the beginning that is your A-list actor group right? And even if you're in
your triple digit numbers, that's like your B-list actor group, still not representative. And so it can
be good to form conjectures but unless there's an actual reason- I mean the vague connection,
I'm like oh something prime-y is happening here because we're counting number of divisors. You
know, you'd want something like that to have some teeth to it. Even before you attempt a proof you
sort of want to believe that the pattern is true and that there might be a reason for it because
that informs how you might pursue that proof and what uh what tactics and properties you
would want to isolate. - (Presumably there are some patterns and things that can hold for a very very)
(long time, they're quite dangerous?) - Yes, yes, there is a another prime number related pattern that
uh takes quite a quite a bit longer to break. - And you guessed it, we're going to show that to you in
the third and final video of this little trilogy with Grant Sanderson. All the links to the videos
are down in the description along with links to Grant's own A-list mathematics channel: 3Blue1Brown.
You can also check out a podcast we recorded with Grant, there'll be a link down in the description,
plus more videos with him and all sorts of other stuff you might like to watch.