5

So I've read about the latest largest prime number discovery (M74207281), but I find it hand to understand what's the big deal because using Euclid's proof of the infinitude of primes we can generate primes as large as we want.

I'll be happy to know what I'm missing

Shailesh
  • 3,908
Alex L
  • 187
  • 1
    Theoretically, yes. On the practical side, Euclid does not tell you how to construct large primes. They have great practical value. – abatkai Jan 24 '16 at 11:59
  • 1
    Euclid's proof tell you how to construct new prime: In order to create new one, you multiple all the primes and add 1. –  Jan 24 '16 at 12:04
  • 7
    $23571113+1 = 59 509$. – Oliver Braun Jan 24 '16 at 12:07
  • I see - that's where I got it wrong: I though that the proof creates all the primes, but actually it works on a subset of primes ([2,3], [2,3,7], [2,3,7,43], etc.)

    Thanks!

    – Alex L Jan 24 '16 at 12:14
  • But still, using Euclid induction (Euclid–Mullin sequence) one can find prime number as big as he like, so my question remains... – Alex L Jan 24 '16 at 12:18
  • 2
    @AlexL It's not true actually. It's true that $p_1\cdots p_n+1$ is a prime if we assume $p_1,p_2,\dots,p_n$ are the only primes that exist. If you don't assume that the proof that it's prime breaks down. So since there are infinitely many primes you cannot assume $p_1\cdots p_n+1$ is always prime and in fact it usually isn't. – Gregory Grant Jan 24 '16 at 12:21
  • 1
    There is a BIG difference between FINDING big primenumbers and GENERATING big prime numbers, the former is (cu)cumbersome which is why it's a big deal, while the latter, cannot be done as prime numbers don't adhere to an exact sequence or the likes, known as of yet. – Zelos Malum Jan 24 '16 at 12:24
  • @AlexL A recurrences for the primes that is possible to program in a spreadsheet without any number theoretic software at all can be found in my answer here: http://math.stackexchange.com/a/164829/8530 You don't even need the modulo function if you program it in Microsoft Office Excel. So in that sense there are as you say simple algorithms to find primes (all of them) but the computational cost is enormous and it requires to generate all the prime from 1 to n. – Mats Granvik Jan 24 '16 at 14:05
  • @abatkai while large primes (say with thousands of digits) are useful primes that large (with millions of digits) are not really useful as far as I know. – quid Jan 24 '16 at 14:22

6 Answers6

10

The short answer is: this isn't actually a big deal. It's a bit like finding another digit of $\pi$ - scientific journalists love writing articles about it, but it doesn't have that much significance.

That's not to say it's easy to generate the next largest prime. But the difficulties are all in the computer science, not the mathematics. The algorithm that falls out of Euclid's proof works like this: make a list $p_1, \ldots, p_n$ of all primes that you can, form $k = p_1 \cdot \ldots \cdot p_n + 1$, and compute the prime factorization of $k$. The prime factorization is guaranteed to contain a prime which wasn't on your original list.

However, this algorithm starts to become intractable computationally before too long: multiplying the known primes together, let alone factoring their product plus 1, starts to exceed the capabilities of modern computers long before you find primes which compete with the latest records.

A better idea is to look for really big numbers which you have reason to hope are prime and then try to check that they really are prime. A good collection of numbers to look at are the Mersenne numbers, i.e. numbers of the form $2^n - 1$. It's much easier to compute Mersenne numbers than it is to, say, multiply the first ten thousand prime numbers together, so you only have to test if the Mersenne numbers are prime. This is still really hard (the best primality testing algorithms are only so fast), but as computers get faster they can handle bigger numbers. Indeed, the reason the latest number is called $M74207281$ is that the number is:

$$2^{74207281} - 1$$

So there were no mathematical breakthroughs here - just getting more mileage out of a familiar algorithm. It's not clear to me that there were even any computer science breakthroughs; as far as I know they just use the same old primality testing algorithm on a faster computer. But there was something shiny and new for the journalists.

Paul Siegel
  • 9,467
  • 5
    It is also worth mentioning that testing primality of Mersenne primes is faster than testing primality of generic number of that size. – Wojowu Jan 24 '16 at 12:56
4

It is true that the fact that a new largest known prime was identified is not much of a theoretical advance as it is well known there are infinitely many ones. And, theoretically there are even relatively simple procedures to find ever more primes.

However, one is so far out that doing it in practice is hard and if it succeeds it is thus of some news value. That being said, I think it is fair to say it is not something that leads to major excitement in the math community, since it is something that is expected to happen from time to time. Yet the process of searching still has some actual merit. I think the project GIMPS that found it does a good job at explaining it (from Announcement January 7, 2016):

While prime numbers are important for cryptography, this prime is too large to currently be of practical value. However, the search itself does have several practical benefits. Historically, searching for Mersenne primes has been used as a test for computer hardware. Earlier this month, GIMPS' prime95 software and members of a German computing community uncovered a flaw in Intel's latest Skylake CPUs. Prime95 has also discovered hardware problems in many individual's PCs.

Moreover, this newly found prime as most largest known primes is a Mersenne prime, that is a prime of the form $2^n -1$ and it is not known if there are infinitely many primes of this form. Now, it is expected there are infinitely many Mersenne primes, so this is also not that big a surprise, but still it is interesting.

quid
  • 42,835
3

TL;DR Euclid's proof guarantees that there will be a larger prime than the largest yet known, but does not appear to be a particularly efficient way of actually finding one.

As for why we would want to actually find a larger prime than any yet known: because it's there?


Reading one of the comments, I notice that you have heard of the Euclid-Mullin sequence, $$ a_n = \mathrm{lpf}\left(1+\prod_{k=1}^{n-1}a_k\right). $$

The right-hand side of this equation contains the famous formula from Euclid's proof of the infinitude of primes.

But it also applies the "$\mathrm{lpf}$" function to this formula, and there's the rub. That's the "least prime factor" function, and it not only requires you to factorize a very large number, it also requires you to determine whether the factors you have found are prime.

So the way to find a new world's largest prime using Euclid's proof would be as follows:

  1. Collect together all the known primes.

  2. Multiply all the known primes together (not a small task; some of these primes run into millions of digits).

  3. Add one.

  4. Test the resulting number from the previous step to determine whether it is prime.

  5. If the result of step 4 is that the number is prime, skip ahead to step 8. But very likely the number is not prime, and you must continue to step 6.

  6. Use the results of step 4 to write a factorization of the number from step 3. Insert those factors in a list of unique factors found in this step.

  7. Remove one number from the list in step 6, and return to step 4, using this number as the new input to step 4.

  8. Compare the prime number found in step 5 to the list of known primes that you last used in step 2. If your prime is larger than any of the previously-known primes, congratulations, you have found the new world's largest prime number! But it is very likely that your new prime will fit in one of the many huge gaps in the sequence of previously-discovered primes; in that case, add the new prime to the list of known primes, and then either return to step 7 (if there are still numbers in the list from step 6) or start the process over from step 2.

The reason this is so complicated is that Euclid's formula does not directly produce a new prime; rather, it gives you a number whose prime factors are guaranteed to be new. You still have to test the number for primality and (very likely) factorize it somehow in order to find one of these new primes.

Moreover, if you collected together all the $N$ known primes, they are not the first $N$ primes; there are enormous tracts of relatively "unexplored territory" between the end of the largest "first $M$ primes" table and the largest known Mersenne prime. So after some amount of primality-testing and factorization applied to the number you got from Euclid's formula, you may well find that all the new primes it produced fell into the gaps in the list of known primes. Eventually, if you reapply the formula often enough, you will find a new largest prime, but how many iterations will that take? It could take a very, very long time before you find any new primes that don't just fill in the huge gaps between the already-known ones.

In contrast, testing new candidates for a Mersenne prime has a low probability of success each time, but relatively efficient ways to confirm success when it occurs; and when it succeeds it is practically guaranteed to be a new world's record. (The only way it wouldn't be a new record is if some other computer was concurrently testing an even larger Mersenne prime.)

David K
  • 108,155
2

As Euclid has proven there are infinitely many primes. But until now there is no simple (i.e. "polynomial") procedure that generates arbitrarily large primes at leisure.

The "prime records" we see now and then are very special primes, having a sophisticated number theoretic structure. Given such a record prime $p_*$ it would be computationally unfeasible nowadays to find the next larger prime.

  • What do you mean by "polynomial"? There are algorithms that are (or at least are assumed to be, which is the same for actually computing the primes) that are polynomial time algorithms to find the next prime or a prime of a given size. (I agree it is not feasible but not because it is not "polynomial".) – quid Jan 24 '16 at 14:01
  • @quid: I don't think so. See the status of Tao's polymath project no. 4 here: http://polymathprojects.org/category/finding-primes/ – Christian Blatter Jan 24 '16 at 14:06
  • I am aware of this. Please note my first parenthetical. – quid Jan 24 '16 at 14:09
  • @quid : The current best deterministic algorithms for finding a prime of size $k$ are $O(\mathrm{e}^{k/2+o(1)})$, which is not polynomial in $k$. An example of an $O(\exp(k/2))$ algorithm is starting with $10^k$ and testing successive odds for primality (and getting this fast estimate used RH up until the end of the '90s). If you have a deterministic polynomial time method then some fame and probably a little fortune await. – Eric Towers Jan 25 '16 at 04:12
  • @EricTowers we are talking sideways. The algorithm: On input $n$ test if $n$ is prime, if yes stop else test $n+1$ will (except well known conjectures are completely off) stop after something like $(\log n)^2$ iterations. And testing primes is polynomial, even proved to be so, too. Thus this algorithm will find a prime in something like $(\log n)^{8}$. Using your parametrization this would be $k^8$. Now it is true we do not know how to prove that it stops after $(\log n)^2$ iterations as our estimates for prime gaps are not good enough, but for practical problem this is irrelevant. – quid Jan 25 '16 at 10:56
  • We start it and when it stops it stops. Whether or not we know a priori when it will stop in the worst case does not simplify the computational task of actually finding the prime and thus is not really relevant in this context. Put differently, if tomorrow somebody would announce the estimate $(\log n)^9$ for maximal prime gaps then the algorithm would be proved to be polynomial. Do you believe the task of finding primes of the size we are talking about would be significantly simplified by this? @EricTowers – quid Jan 25 '16 at 11:03
  • @quid : I'm not interested in religious bounds, only provable bounds. – Eric Towers Jan 25 '16 at 14:06
  • @EricTowers fine, but proved bounds are irrelevant to the question of the difficulty of actually finding a prime, which is the subject here. Mentioning "polynomial" is a red herring and even misleading as there is a procedure that in all likelihood is polynomial, and a proof of the algorithm being polynomial would not in itself affect the task at all. Again if tomorrow somebody would annouce a proof that prime gaps are poly (log n) we'd know the deterministic algo we can already use is a poly time algo but it wouldn't change the task at all. Thus the mention of "polynomial" is misleading. – quid Jan 25 '16 at 14:16
  • @quid : And if tomorrow someone produced a proof that the time is exponential and that the density of examples increases as $k \rightarrow \infty$, the proven bound would still stand and yours would not. I'll stick with true facts instead of wishful thinking. – Eric Towers Jan 25 '16 at 19:18
  • @EricTowers I am not sure what exact claim you want to make on what somebody might prove. But as I tried to explain all this is not really relevant to my point, which is rather the other way round. Namely, that even if we had that result proving the algorithm is polynomial it would still be not feasible (if it is not feasible now). Therefore mention of "polynomial" is besides the point and designed to create and/or reinforce misconceptions. Despite that I had upvoted the answer right away, but I think it would be better without the '(i.e. "polynomial")' which anyway does not add much. – quid Jan 25 '16 at 20:10
1

Not all numbers of the form $p\#\pm1$ are prime.

See Prime Pages, The Ten Largest Known Factorial/Primorial Primes

for a list of the largest known of these.

JMP
  • 22,637
1

It's not true that $p_1\cdots p_n+1$ is always prime. It's true that $p_1\cdots p_n+1$ is a prime if we assume $p_1,p_2,\dots,p_n$ are the only primes that exist. BUT, if you don't assume that then the proof that it's prime breaks down. So since there are infinitely many primes you cannot assume $p_1\cdots p_n+1$ is always prime and in fact it usually isn't. And in fact
$2∗3∗5∗7∗11∗13+1=59∗509$ is an example (thanks Oliver Braun).

Gregory Grant
  • 15,324
  • 5
  • 38
  • 63
  • That is correct, but if we use Euclid–Mullin sequence, we can find prime number as large as we like – Alex L Jan 24 '16 at 12:24
  • @GeoffRobinson It's not strange, it's just the contradiction that is the basis of Euclid's proof of the infinitude of primes - which is (recall) a proof by contradiction. – Gregory Grant Jan 24 '16 at 12:26
  • @AlexL Sure in principle you can, but you can't in practice, because you have to factor a large number to find it. So that's no better than saying you can always find a prime as large as you want using Euclid's algorithm. Sure you can, but it might take longer than the life of the universe with today's compute power. – Gregory Grant Jan 24 '16 at 12:28
  • 1
    @AlexL The point is not that there's a prime that big but that we could actually find it. Because using the simple minded algorithms we could never find one that big. You can only get your hands on one that big if you do something clever - like search for Mersenne primes. – Gregory Grant Jan 24 '16 at 12:30
  • @GeoffRobinson It says if $p_1,\dots,p_n$ are the only primes, then $p_1\cdots p_n+1$ must also be prime because every number is then a product of $p_1,\dots,p_n$, yet $p_1\cdots p_n+1$ is not divisible by any of $p_1,\dots,p_n$ because if it were then $p_1\cdots p_n+1=p_ir$ for some $r$ and then $p_i$ divides $1$. Yet it's not one of the $p_1,\dots,p_n$ - contradiction. So I'm not sure what we're arguing about here. – Gregory Grant Jan 24 '16 at 12:36
  • @Gregory You mean that trying to find Mersenne prime (and check for its factorization) is easier than using Euclid–Mullin sequence where we don't have to check to factorization but only to multiply? – Alex L Jan 24 '16 at 12:37
  • 1
    @AlexL Basically yes, Euclid Mullin only defines a sequence theoretically but it doesn't give you an efficient way to actually write down the terms of the sequence. While Mersenne gives you a specific very efficient algorithm for determining whether some types of integers are prime. Using any other known algorithm for finding primes it would have taken an astronomical amount of time to find a prime that large. That's the reason it's news. Keep in mind that even though Mersenne is efficient, most numbers of that form are not prime so it can still take years to find one. – Gregory Grant Jan 24 '16 at 12:43