[0:00] I have a story to tell you about prime [0:01] numbers which I think is pretty [0:04] interesting and it's a new way of [0:06] looking at primes. I it's ridiculous to [0:08] say there's anything new about primes, [0:10] but you'll see. I'm going to um start by [0:14] remarking that primes are both very [0:16] irregular and very irregular. They're [0:18] irregular because when you look at where [0:21] the primes are on the number line, they [0:23] grow like weeds. Every so often there's [0:26] a weed, a prime number, and then there's [0:27] a gap and then there's another weed. On [0:29] the other hand, if you look at the [0:31] picture in the large between one and a [0:34] million, say the mathematical notation [0:38] for that is pi of n. Pi of a million is [0:40] the number of primes between 1 and n. [0:43] Look at the the primes between one and [0:46] 50,000. How many are there? And it sort [0:49] of looks like this. [0:53] Rather surprisingly, when you get up to [0:55] 50,000, [0:58] it's basically a straight line. So, [1:00] they're not that irregular. The famous [1:03] mathematician said, "This is one of the [1:06] most astonishing things in mathematics, [1:08] the smoothness of this function pi of [1:11] n." What it is, pi of n is very close to [1:16] n / log n. And that really is [1:18] astonishing when you consider how [1:20] irregular they are at the beginning. [1:22] This line, it's not straight. It's not [1:24] n. It's n over log n. But log n changes [1:27] very slowly when you So when you draw [1:30] this, it looks pretty straight. There's [1:32] a slight droopiness to it. Neil, does it [1:34] astonish you? Because primes are so [1:36] fundamental, right? They're these [1:37] fundamental important things. And I know [1:40] like they do seem a little random at the [1:44] start, but wouldn't something so [1:45] fundamental, wouldn't it make sense that [1:47] it was really simple and elegant? [1:52] >> Why don't I think it's remarkable? Why [1:55] log of n of all things? You know, why [1:58] not [2:00] square root of n say? Why log? I mean, [2:04] log is one of those transcendental [2:08] functions. It's a surprise. It looks [2:11] pretty linear. So I thought to myself, [2:14] how linear is it? What if we really [2:16] tried to put straight lines through the [2:19] primes? So what I want to do is look at [2:23] points where the xycoordinates [2:26] the x coordinate is going to be um k [2:31] and the y coordinate is going to be the [2:33] kith prime prime k. [2:39] So it's begin going to begin the first [2:41] prime is two. So the first point on this [2:44] graph is going to be 1 comma 2. The [2:46] second prime is three. So it's going to [2:49] be 2 comma 3 and then the third prime is [2:51] five and we get 3a 5 and so on. I want [2:54] to look at those points and see how [2:56] linear they are. All right. So I've made [2:59] a piece of graph paper here going 0 1 2 [3:02] 3 and so on. And here's the prime. So [3:06] the first prime is two. So that means we [3:08] put a point at the coordinates 1 comma [3:12] 2. That's called a prime point. The [3:15] second prime is three and it's the point [3:18] 2a 3. Then five then 7 then 11 then 13 [3:24] 17 [3:26] 19 [3:28] and then the next one is 23 and then 29 [3:31] and so on. There are the prime points [3:33] and what I want to know is how close are [3:36] they to being on straight lines. I'm [3:38] going to define a sequence which is the [3:40] number of lines we need to cover the [3:43] first n primes with the smallest number [3:45] of lines. So let me just do it and [3:47] you'll see. So what's what's a of one? [3:49] How many lines do we need to cover the [3:51] first prime? We need one line. It can be [3:53] anywhere you want. Just put it through [3:54] that. So if n is one, the number of [3:57] lines is one. What if n is two? We want [3:59] to have a line through the first two [4:01] primes. All right. I'll put a line. It [4:03] goes through that point and that point [4:04] as a straight line. One line is enough. [4:07] two primes. I need one line. What about [4:09] three primes? Dot dot dot. I want to [4:12] have a line. There's no line that goes [4:14] through those three points. Obviously, I [4:17] need two lines to cover the three [4:19] points. What about uh four primes? 357. [4:22] 357 are in a straight line. So, I can do [4:25] four primes with two lines. What about [4:28] five primes? I can do with two lines. I [4:30] use one line to cover three, five, and [4:33] seven. and another line to cover two and [4:38] 11. [4:38] >> Oh, that the line doesn't don't have to [4:40] touch each other, right? [4:41] >> They can touch each other. [4:43] >> They don't have to join. It doesn't have [4:44] to. [4:45] >> They don't have to connect. No, they're [4:46] line segments. You just put them down. [4:48] And of course, there could be primes way [4:50] out here on the on the line. We'll worry [4:53] about that later. I'm just trying now to [4:55] cover the primes with as few lines as [4:58] property. I'm I'm getting lines of [4:59] primes. How many do we need? How many [5:02] lines do we need? All right. So I did [5:04] with uh with five. 1 2 3 4 5. What if we [5:06] have one more? The line through those [5:08] two does not go through that one. So I [5:11] think we're going to need another line [5:12] for six primes. We need three lines [5:15] >> as we get higher and higher. This line [5:17] here you used for example to join um [5:20] three, five, and seven. Later on [5:24] >> there may be a better way to do it. [5:25] >> You might not that line might not exist. [5:27] >> That's right. Yeah. Yeah. I mean the [5:28] line exists but we don't need to use it. [5:30] We're looking for the best way to cover [5:33] the primes with straight lines. This is [5:35] actually a famous uh an example of a [5:38] famous computer science problem which is [5:39] called set cover. You you you want to [5:42] cover you you've got your set of objects [5:45] and you've got a set of things you can [5:47] use to cover them and you want to find [5:48] the optimal the smallest subset of your [5:52] objects to cover the things you're [5:54] trying to cover. Here we're trying to [5:56] cover the primes and we're using lines. [5:59] Is this like a mathematical thing or is [6:00] this a game? Like [6:02] >> it's a mathematical thing. It's a deadly [6:04] serious thing. Oh yes. [6:06] >> Deadly serious. [6:07] >> No. Well, not deadly serious. No, [6:08] there's no money at stake. There's no no [6:10] lives at stake. [6:11] >> But it's a re It's a legit It's real. [6:13] It's It's hardcore math. [6:14] >> It's hardcore and it's new. The first [6:16] time we need three lines is for the for [6:19] six primes. When we get to seven primes, [6:23] we want to cover 1 2 3 4 5 six seven. We [6:25] want to go all the way out to here. And [6:26] we can do it if we're clever with three [6:29] lines. We can repeat lines through a [6:32] point. And that and that is no. So seven [6:34] primes we can do with three lines. [6:37] >> Apparently you can look it up in this [6:38] thing called the online encyclopedia. [6:40] >> You certainly can. Yeah, it's sequence A [6:44] 373813. You can look it up. So as I [6:46] said, this is something that computer [6:49] science people will say, "Ah, set cover. [6:52] I can do that." It's it's one of those [6:54] NPcomplete problems. So, it's not going [6:56] to be easy to solve, but they do have [6:59] good computer programs for attacking it. [7:12] And my friend Ma Max Alex ran his [7:17] program ran set a good set cover program [7:21] up to 410 [7:23] primes. It looks like this. And more [7:26] precisely, here it is. And you can see [7:31] it's increasing and it's a bit [7:33] irregular. There are long flat [7:35] stretches. And you get a long flat [7:37] stretch when you get a really good line [7:40] that has a lot of primes on it. You [7:42] don't you can just as we saw here, you [7:44] don't have to increase. [7:46] >> Or do they have names? Are they like [7:47] called golden lines or [7:49] >> No. No, they don't. [7:50] >> They're like a seam of gold. They they [7:52] are like a seam. [7:55] A quick footnote. Since we filmed this, [7:57] Max Alex save has calculated the lines [8:00] required all the way out to the 861st [8:03] prime. The plot looks like this. And [8:05] there are two really interesting golden [8:07] lines here and here. There are 48 [8:13] consecutive primes that can be covered [8:15] by 68 lines. Then a whopping streak of [8:19] 112 primes can be covered by 69 lines. [8:24] But after that, nothing Max has found [8:26] has come even close. [8:29] And there's no reason to be found for [8:32] this golden sweet spot [8:36] that the sequence increases. It looks to [8:40] me like it's roughly linear. I suspect [8:42] it's actually about going like x over [8:45] log x because that's in the nature of [8:47] the game. But there are long stretches [8:49] where you get a really good line that [8:52] covers a lot of primes. And so you don't [8:54] have to increase the number of lines [8:56] until you get to the next awkward prime. [8:59] And it looks like that. So [9:02] >> that's a good name. An awkward prime. An [9:04] awkward. [9:05] >> An awkward prime is a prime that causes [9:07] a step up. [9:08] >> A step up. Yes. They're the awkward [9:10] primes. Yes. Good. Yes. [9:12] >> Can we can we have that name? [9:13] >> All right. Sure. And the these [9:15] >> Can you put is Can you put that in the [9:17] OEIS? [9:17] >> I think. Yeah. [9:18] >> And will you call them awkward primes? [9:20] >> Yeah. Sure. Sure. Okay. [9:22] >> That's on tape now. That's on tape. [9:25] >> An awkward prime causes a step up in the [9:28] number of lines needed in your little [9:30] line game here. [9:32] >> Well, another footnote. You just [9:34] witnessed the birth of the awkward [9:36] primes. Here they are highlighted on the [9:39] original sequence. there in the blue. [9:44] And here it is, perhaps the most awkward [9:46] prime of them all. The one that ends [9:47] that whopping streak of 112 primes in a [9:51] row that can be covered by 69 lines. The [9:54] party pooper prime. And here they are, [9:57] their very own entry in the online [9:58] encyclopedia of integer sequences. [10:01] Amazing. I'm a very proud co-father. [10:07] >> Got so many questions coming into my [10:09] head. [10:10] >> Yeah. Yeah. Like what's the longest line [10:12] for each number of primes? What's the [10:14] longest line that's got three primes on [10:16] it and four primes on it? And [10:17] >> I'm coming to that. [10:20] >> Like that Robert Graves poem about the [10:23] Welsh the creatures that came out of the [10:25] sea in Harl. [10:29] >> That's a different story. [10:30] >> Okay. [10:32] But the last line is, "Ah, but I was [10:34] coming to that." [10:38] >> Puzzle alert, people. Puzzle alert. The [10:42] diabolical geniuses over at Jane Street [10:44] have cooked this one up to test your [10:46] number skills. This is what it looks [10:48] like. There are more details over on [10:51] their site and via the links below. It [10:53] is a doozy. For those who don't know, [10:55] and there can't be many number file [10:57] viewers who don't, Jane Street is our [10:59] channel sponsor. They're a quantitative [11:01] trading firm with offices in New York, [11:03] London, Hong Kong, Amsterdam, Singapore. [11:06] They use techniques from machine [11:08] learning, distributed systems, [11:10] programmable hardware, statistics to [11:12] trade on markets around the world. And [11:14] when they aren't doing that, well, they [11:17] don't mind a puzzle or two. In fact, [11:19] there's a whole puzzle page on their [11:21] site, which I've linked to down below. [11:23] And while you're there, check out all [11:25] the open rolls at Jane Street they're [11:26] currently hiring for. Even though [11:28] they're a financial firm, they don't [11:30] expect you to have a background in [11:32] finance or any specific field really. [11:34] They're just looking for smart people [11:36] who enjoy solving interesting problems. [11:39] Now, why don't you go try those puzzle [11:41] links? [11:45] It's not just it's the concatenation, [11:48] the stringing together of all the [11:50] chunks. This whole thing is the [11:53] sequence. And what we're drawing [11:55] actually is a pin plot officially. [11:58] There's one other sequence I've seen in [12:00] the past. This was Yan Ritz Van X [12:04] sequence that I did a video for you [12:06] about. The Van X, the famous Van X [12:10] sequence.