Amazing Graphs - Numberphile

Video Statistics and Information

Video
Captions Word Cloud
Captions
so I'm gonna be talking about graphs of sequences and I'm gonna say graph I'm sorry I've lived in the US for so long I have to say graph 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 then separate numbers and I have as well start at 0 so 0 the 0 this term is 0 the once term is 1 the tooth comb is for 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 plot it a thousand points the dots would merge together and we'd get something that looks like that this is a parabola single darts 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 felt like clusters oh 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 a hundred when they're all at 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 Scully 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 damn it and the definition is this we start off the first two terms of one okay and now the rule kicks in what is the rule this is N and the ze'ev n yeah what's the next term you look at the last term and in and you compare them are they relatively prime in this case they are they don't have a common factor and 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 & 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 & 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 so that let me let me see if I have understood it so there's no common divisor there between 5 & 2 yeah our next number is 8 okay now there is a common divisors are there is it - yes so 8 divided by 2 4 yes no common divisor so next number is 12 yes common divisor there is 4 yes 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 2044 and so on where 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 jakesully says to the demon fly straight damn it 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 comes down and they fly smoothly so what's happening is this situation changes when we get to a of two M equals one here was a of nine we got a one at the ninth step it's not until we get to term number six hundred and whatever it is that we first get a one at an even term and when that happens let me show you what happens we'll have an even numbered term which is a one so there's n then there's a of n now what's the next term well it's gonna be term number two n plus one and what's its value there's no GCD here it's one the next term is the sum of this plus this plus 1 which is 2 n plus 3 the next one it's 2 n plus 2 the GCD is obviously 1 there's no common factor there so again we add and we get 4 M plus 6 term number 2 n plus 3 ah 2 M plus 3 4 M plus 6 GCD is 2 n plus 3 we divide 2 M plus 3 into that and we get 2 good ok let's get the next four terms so 2n plus 3 and the next term is going to be 2n plus 4 the GCD of 2 & 2 M plus 4 it's - 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 to M plus 7/2 M plus 6 term again there's nothing so it's it's 4 M plus 6 plus 7 plus 1 and then 2 M plus 7 what is the GCD bingo it's 2 M plus M we divide that into that and we get a 2 and then we continue what we get is 1 to M plus 11 for M plus this went up by 8 it goes up by 8 again in 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 so although I can't see then almost a double line that's 2 1 2 1 2 1 down that on that line exactly yeah yes and these are just those other numbers yes and what those numbers are is we went from 2 n plus 3 to 2 M plus 7 to 2 M plus 11 we've added 4 and we've increased the value by 4 slope 1 and this one we've gone up by 8 so it's slope - so this is slope 1 and that slope to it so from then on the Banshee and jakesully fireflies smoothly 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 treat us the magic of mathematics yes it's just a strange fact about numbers some more amazing crap the next graph we look at the primes we don't but we don't just plug the primes we write the primes in base to reverse them and subtract so let me do it the first prime is 2 which in binary is 1 and we reverse it and we get more 1 which is 1 and we subtract and we get 1 so it's p- 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 v 1 a 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 so the final term that we spit out that slack in base 10 yes and the next prime is 13 well that's just the other way round what we just did it 13 is 1 1 0 1 reverse it we get 11 and so they gives us to when we subtract the next one is 17 which is 1 0 0 0 1 and we reverse it it's the same when we get 0 19 we get 1 0 0 1 1 uh-huh 1 1 0 0 1 25 so it's minus 6 after 19 was some X 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 may be negative may be 0 may be positive and 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 two the next one is bigger than a power of two and it starts another parallelogram which starts off going down because the ones are weighted towards the bottom when we reverse it the ones have grouped at the top so we get negative numbers just after a pair of two and we get the symmetry just assume surf because quite often the reversal of a prime is another prime it's not guaranteed but anyone who looks like that really amazing graph this is just a simple graph of a sequence wouldn't pick that one that's amazing but beautiful who found that I did yeah well I've 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 O a is for a sequence which is worth looking at and the key word 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 and they're all four letter is here HEA a are which means click it and it sounds good when you listen to it so Neil if I submit a sequence to the oais and then you put it on there but I see less written under I know that it picked liver dead yes yes okay but you're lucky it didn't get rejected 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 at what less means well let's forget about less Neil we'll be back with more interesting graphs or graphs 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 so now the sequences you take em we write it in base ten and you subtract the product of the nonzero digits [Music]
Info
Channel: Numberphile
Views: 503,198
Rating: 4.9514627 out of 5
Keywords: numberphile, graphs, neil sloane
Id: pAMgUB51XZA
Channel Id: undefined
Length: 12min 36sec (756 seconds)
Published: Thu Aug 08 2019
Reddit Comments

Amazing graphs, how sweet their bounds

That graced this wretch like me,

Whose points once lost and now patterns found,

And lines as far as I see...

I find the "fly straight, dammit!" function especially interesting to me how the points went from disordered to ordered at n=638. Right at the instant!

Edit: Extended the "Amazing Graphs" poem.

👍︎︎ 16 👤︎︎ u/ComprehensiveRule8 📅︎︎ Aug 08 2019 🗫︎ replies

I'm wondering how the binary reversal graph could be used to predict intervals where the next primes could be hiding.

👍︎︎ 4 👤︎︎ u/SomeFokkerTookMyName 📅︎︎ Aug 08 2019 🗫︎ replies

Somewhat coincidentally, around a fortnight ago I was looking at the look keyword and came across https://oeis.org/A229037. I've been playing around with related sequences, one extended to include negative numbers and the other using a different algorithm for generating nonaveraging sequences. I'm probably going to make a post on this some time and submit to the OEIS.

👍︎︎ 3 👤︎︎ u/thewrongrook 📅︎︎ Aug 09 2019 🗫︎ replies

I love numberphile! They make math so entertaining!

👍︎︎ 2 👤︎︎ u/trashman253 📅︎︎ Aug 09 2019 🗫︎ replies

In case you want to play with the graph, initial values and the conditions for the "Fly Straight, Dammit!":

import matplotlib.pyplot as plt


# calculates gdc but you can choose to return whatever you like, like the mcm for example
def gdc(a, b):
    while b: a, b = b, a % b
    return a


# the sequence itself, you can also choose to alter the definition of the sequence here
def seq(n, ant):
    factor = gdc(n, ant)
    return 1 if n < 2 else ant // factor if factor > 1 else ant + n + 1


# how many terms + 1 to generate, 1021 will generate 1020 terms
limit = 1021
# initial value, for practical purposes it is the term in position -1
valorAnt = 1
# list that stores the values
secuencia = []

# loop that loads the values into the list
for i in range(limit):
    secuencia.append(seq(i, valorAnt))
    valorAnt = secuencia[-1]

# Keep both on to plot it as both points and a continuous line
plt.plot(list(range(limit)), secuencia, "ro", markersize=0.5) # To plot it as points
plt.plot(list(range(limit)), secuencia, linewidth=0.5) # To plot it as a continuous line
plt.show()

print(secuencia) # just to show the values as text
👍︎︎ 1 👤︎︎ u/CarlosFFM 📅︎︎ Aug 13 2019 🗫︎ replies
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.