So I'm gonna be talking about graphs of sequences and I'm gonna say [graff], I'm sorry, I've lived in the US for so long
I have to say [graff]. Now if you look at something like the squares. The squares go 1, 4, 9,
16 - blah, blah, blah. if you make a graph of them,
this is a discrete sequence, they're separate numbers. And I may as well start at 0. So 0,
the 0th term is 0, the 1th term is 1, the 2th term is 4. the third term is 9 and so on. So
what we get is something that looks like that, if we draw a continuous curve through it. If we plotted a thousand points
the dots would merge together and we'd get something that looks like that. This is a parabola.
Single dots, it looks like a continuous curve; parabola, you did it in high school - boring, boring, boring.
We're gonna do more interesting things. I'm going to show you some that you've never seen before. But before I do that
here's another example, the square root of n. If we look at the square root of 0 its 0,
1, square root of 2 is 1 point 4 1 4,
root 2 and
of course
they're not whole numbers. What I'm gonna plot in this picture is the nearest integer to the square root of n. It's not a continuous
curve anymore because I'm rounding it off to the nearest integer, so there are gaps. - (Brady: They're like clusters aren't they?)
Yeah, square root of 100, square root of 101, square root of 102;
that's all gonna round off to 10 so we can - around 100 they're all 10.
So that's another example of a pretty pedestrian graph.
I want to show you some more interesting sequences. Remember that movie
called Avatar. The hero Jake Sully
gets on the
Banshee for the first time, he links to it, and he tries to get the Banshee to fly and it doesn't work.
Here's a sequence that reminds me of that.
I call this
sequence: "fly straight dammit".
And the definition is this: we start off the first two terms are 1.
Okay, and now the rule kicks in, what is the rule? This is n and this is a of n.
Now, what's the next term? You look at the last term and n and you compare them.
Are they relatively prime? In this case they are, they don't have a common factor. Then what it is,
it's the previous term, a of n minus 1, plus n plus 1. So in this case, there's no common factor
so the next term would be 1 plus 2 plus 1, which is 4. What goes here?
Well, we look at 3 and 4, do they have a common factor? They do not.
So again, the next term is 4 plus 3 plus 1, it's 8. Now we look at this pair of terms.
What's the fourth term? We look at 4 and 8, aha, they have a common factor of 4. When that happens
we divide the previous term by that common factor.
So here the common factor is 4, 8 divided by 4 is 2. So,
a of n; the rule is it's either the previous term plus n plus 1, if
the greatest common divisor of a of n minus 1 and n
is equal to 1 - if they were relatively prime. Or
it's equal to a of n minus 1 over
gcd of n and a of n minus 1, if this
gcd is bigger than 1. - (Brady: So let me, let me see if I've understood it)
(So there's no common divisor there between 5 and 2 so our next number is 8.) - Okay
(Now there is a common divisor there, is it 2?) - Yes. - (So 8 divided by 2 - 4?) -Yes
(No common divisor so next number is 12.) - Yes
- (Common divisor there is 4.) - Yes. - (So the next number is 3?) - Yes!
- (We have a common divisor again, which is 3, so, it's 1?) - Yes
(Now we've got 10 and 1, so 12)
(There's no common divisor there is there, so 12.)
(No common divisor there, so now we jump up to 24)
And so on. When we look at the graph of that
it's just wild. It is totally random looking, random array of dots,
until we get to term six hundred and something. And at that point
Jake Sully
says to the demon "fly straight dammit". And from that point on,
you remember in the movie, the music is chaotic. The Banshee is tumbling, they're falling to the bottom of the cliff.
Whatever it is, but then suddenly the music calms down and they fly smoothly.
So what's happening is the situation changes when we get to a of 2m
equals 1. Here was a of 9, we got a 1 at the ninth step,
it's not until we get to term number six hundred and whatever it is
that we first get a 1 at an even term. And when that happens, let me show you what happens.
We'll have an even numbered term which is a 1. So there's n, then there's a of n.
Now, what's the next term? Well, it's gonna be term number 2m plus 1. And what's its value? There's no gcd here,
it's 1. The next term is the sum of this, plus this, plus 1 which is 2m plus 3. The next one,
it's 2m plus 2, the gcd is obviously 1, there's no common factor there,
so again we add. And we get 4m plus 6. Term number 2m plus 3,
ahh 2m plus 3, 4m plus 6;
gcd is 2m plus 3. We divide 2m plus 3 into that and we get 2. Good, ok,
let's get the next four terms.
So 2m plus 3 and the next term is going to be 2m plus 4, the gcd of 2 and
2m plus 4, it's 2. So we get to divide this 2 by 2 and we get 1, okay.
Let's keep going and you'll see the pattern right away. Now we get 2m plus
7, 2m plus 6 term;
again there's nothing so it's, it's 4m plus 6 plus 7 plus 1. And then 2m plus 7,
what is the gcd? Bingo! It's 2m plus 7,
we divide that into that and we get a 2. And then we continue, what we get is 1, 2m plus 11,
4m plus - this went up by 8,
it goes up by 8 again, then a 2. And so on. What happened is we had 4 nice numbers in a row,
which is what you see here,
there are actually two numbers together here and then that and that so with these numbers are on three straight lines.
(Brady: So although I can't see, they're not all 1s? - That's a double line. - (That's 2 1 2 1 2 1 down that, on that line?)
Exactly. Yes. - (Brady: And these are just those other numbers) - Yes
And what those numbers are is
we went from 2m plus 3 to 2m plus 7 to 2m plus 11,
we've added 4 and we've increased the value by 4 so it's slope 1. and this one we've gone up by 8,
so it's slope 2. So this is slope 1 and that's slope 2.
[otherworldly music]
So from then on the Banshee and Jake Sully fly, fly smoothly.
(Brady: It seems so arbitrary that we didn't hit that magic point until here, like it, you know, it was, it just)
(it wouldn't trigger it) - It's the magic of mathematics,
yes. It's just a strange fact about numbers. Some more! - (Brady: Another graph, another amazing graph.)
Another amazing graph.
So the next graph we look at the primes, we don't - but we don't just plot the primes. We write the primes in base 2,
reverse them, and subtract. So let me do it. The first prime is 2 which in binary is 1 0,
And we reverse it and we get 0 1, which is 1, and we subtract, and we get 1. So it's
p minus reverse p, in binary. Alright
next one is 3. Reverse it we get 1 1,
1 1 from 1 1, 3 minus 3 is 0. So the next term is 0. 5: 1 0 1, 1 0 1; 0.
7: 1 1 - it'll get more interesting in a minute, 0. Next prime is 11, now in binary
that's 1 0 1 1, when we reverse it we get 1 1 0 1 which is you know is 13. 11
minus 13 is minus 2. - (Brady: So the final term that we spit out, that's back in base 10?)
Yes. The next prime is 13,
well
that's just the other way round what we just did. 13 is 1 1 0 1,
reverse it we get 11, and so they gives us 2 when we subtract. The next one is 17
which is 1 0 0 0 1
and we reverse it, it's the same, and we get 0.
19, we get 1 0 0 1 1, aha, 1 1 0 0 1, 25, so it's minus 6.
After 19 what's the next prime?
23. When we reverse it we get 1 1 1 0 1,
which is,
29.
So 23 minus 29
seems to be minus 6 again, and so on.
That's the sequence. Take the binary representation of n, subtract its
reversal and we get a number, it may be negative, may be 0, may be positive. And what does the graph look like? It is amazing.
It's a series of
parallelograms. So these are parallelograms aligned along the x-axis. The parallelogram ends when we get to a
prime which is just under a power of 2.
The next one is bigger than a power of 2 and it starts another parallelogram, which starts off going down because the
1s are weighted towards the bottom. When we reverse it
the 1s have grouped at the top so we get negative numbers just after a power of 2. And we get the symmetry, just as you observed,
because quite often the reversal of a prime is another prime. It's not guaranteed,
but anyway, looks like that. Really amazing graph. This is just a simple graph of a sequence.
(Brady: I wouldn't have picked that one. That's amazing) - But beautiful - (Who found that? Who, who?)
I did.
(Brady: Oh right. I was going to say, what crazy person decided to graph that?)
Yeah, well I'd been graphing many sequences because it's easy to do. All you do is click 'graph'.
And in fact
we have a keyword in the OEIS for a sequence which is worth looking at. And the keyword is 'look'.
We have other keywords, keywords like 'core' for a core sequence and
'less' for a sequence that we don't like. Means - 'less' means we don't want any more sequences like this one,
thank you.
And if you see 'look' you
can click it and it will bring you up the graph immediately. And another four-letter
keyword, they're all four letters, is 'hear' H E A R which means click it and it sounds good,
when you listen to it.
(Brady: So Neil if I submit a sequence to the OEIS, and then you put it on there,)
(but I see 'less' written under it I know that I've picked a bit of a dud?) - Yes. Yes - (Okay) [laughs]
But you're lucky it didn't get rejected. - (Brady: Right)
This happens a lot and we are - it leads to no end of arguments.
People say "but this sequence is just like another sequence".
And you look at the other sequence and it says 'less' and then you can say that "you should have looked up what 'less' means".
Well, let's forget about 'less'. Neil will be back with more
interesting graphs or [graffs] in the next Numberphile video, including one that reminds him of Star Wars.
If you don't already
please consider subscribing to Numberphile and give that notification bell a bash to make sure you never miss an upload.
To sometimes see videos before they even go public, you can support us on Patreon where we occasionally do little sneak previews.
Thanks for watching and see you again soon.
[preview] So now the sequences. You take n,
you write it in base ten and you subtract the product of the nonzero digits...