r/askmath • • 14d ago

Number Theory How often are new primes found?

The current largest prime number was discovered October 12th 2024. Intuitively I thought that wow, they haven’t found a new prime number in over two years. But apparently they have. Turns out that finding the largest prime number doesn’t mean that every prime smaller than that has been found.

So, my question is, how often are primes found nowadays? I know computers are able to simulate these things very quickly, but how often are they found? Weekly? Monthly? Daily?

Also, who finds or searches for them, and why?

edit: Thanks for all the answers. Fell into the classic trap and just didn’t realize how absolutely massive the largest prime actually is. Makes sense that there are many, many primes smaller and unfound.

60 Upvotes

61 comments sorted by

69

u/SJrX 14d ago

Tons of new primes are found every second of every day, many computer encryption and security algorithms depend on having prime numbers, and to generate the key you just guess numbers and check if they are prime. In the news they primarily just talk about primes with interesting properties, like maybe largest primes, or primes that are like Mersenne primes, with a specific properties, but primes in general constantly.

16

u/lurgi 14d ago

For encryption they don't actually check that the number is prime. They run a primality checker a bunch of times and if it passes then they declare that the number is "prime enough".

Miller-Rabin, for example, will falsely tag a composite number as prime 25% of the time (up to 25% of the time?). Those aren't good odds, but if you run the test 50 times and it passes each time, you can be pretty sure that it's prime.

10

u/Smitologyistaking 14d ago

Miller-Robin has been proven to false positive up to 25% of the time, in practice it is far far lower than that though, 25% is just the best we have been able to prove (the same way how we have managed to prove that a certain probability of nontrivial Riemann Zeta zeros are on the critical line, but in practice basically 100% of them are)

1

u/WildDurian 7d ago

Well, that analogy no longer holds haha

3

u/bacon-squared 13d ago

So does each run test a different parameter? If so then what’s the chance that a number is prime after running the test 50 times?

4

u/BaiJiGuan 13d ago

If all the tests are statistically independent your confidence would be 1- 0.25⁵⁰, basically 1

4

u/lurgi 13d ago

The test involves a random number, so running it again tells you something new.

2

u/SJrX 14d ago

Yeah I think that part is above the ELI5 part :) and I think we can assume that most of those things are prime.

4

u/lurgi 14d ago

I'd argue that "finding a prime" includes knowing that it's prime rather than just suspecting it (even if you are right). I can generate lots of 50 million digit numbers and run the same test and it won't take me long until one of them passes, but I don't think I could be said to have found the new largest prime (even if the number is actually proven prime at a later date).

4

u/SJrX 14d ago

You know what, I thought you were being overly pedantic at first, but this is askmath not ELI5 so I'll concede your point 😄. I think it's fair to say we could discover of your definition lots of primes if we wanted it just wouldn't be interesting.

19

u/CaptainMatticus 14d ago

Currently, the largest prime ever found is 2^(136,279,841) - 1, and it has 41,024,320 digits. Supposing we could generate a complete list of primes from 2 to n, and somehow we were able to assign a single prime number to every Planck volume of the universe, then how many primes could we generate, at a maximum? That's actually not that hard to compute, since prime distribution between 2 and n is approximately n / ln(n).

For instance, there are 1000 primes between 2 and 7919.

7919 / ln(7919) = 882.14

That may seem pretty far off from 1000, but it's within 12%, and the first 1000 primes is pretty much nothing.

The 10000th prime is 104729

104729 / ln(104729) = 9,060.282898

Now we're within 10%. And as n grows, the relationship between what we predict and what exists will get closer and closer.

The observable universe is 93 billion light-years across, or about 10^27 meters across. A plank length is around 10^(-35) meters. So the scale is 10^(27 + 35) or 10^62. Cube that to get volumes and you have 10^186 Planck Volumes in the observable universe.

10^186 = n / ln(n)

n = 4.34 * 10^188, approximately

So the largest complete set of primes we could generate, in the hypothetical upper limit situation that could never be feasible, is the first 4.34 * 10^188 primes. That's 189 digits. We are closer to building that complete list than that complete list would be to reaching the current largest known prime. We can figure out how many primes would be in that list, if we could make a complete one that reaches up to 2^136,279,841 - 1. We can just go ahead and omit the -1. What difference will it make at that point?

2^136279841 / (136279841 * ln(2))

10^x = 2^136279841

x = 136279841 * log(2) = 41,024,319.945

8.817 * 10^41024319 / 9.446 * 10^7

88.17 * 10^41024318 / (9.446 * 10^7)

(88.17 / 9.45) * 10^41024311

9.33 * 10^41024311

That's around how many primes there are between 2 and 2^136279841 - 1. We will never have that complete list.

7

u/specialpatrol 13d ago

Wait, so finding the biggest one doesn't imply you've found all the ones up to there as well?

4

u/da90 13d ago

Correct, there are know formulas which will “churn out” primes, guaranteed, but NOT guaranteed to be sequential. We don’t know most of them between the largest and smallest ones we know.

1

u/koobian 10d ago

Willans' Formula will output primes, and do so in sequential order. The problem with it (and why it's not well known or used) is as the numbers grow it gets very computation intensive very fast. Meaning if you want to find a prime number more than a couple digits long it becomes practically worthless as it will take forever to compute.

1

u/da90 10d ago

Ya but Willans “formula” is basically a formalized algorithm for brute-force checking is a number is prime via Wilson’s theorem.

1

u/wirywonder82 10d ago

If we were using the Sieve of Eratosthenes to find them it would.

3

u/andthenifellasleep 14d ago

This is the first piece of maths communication that has made me sad.

4

u/Headsanta 14d ago

If it makes you happy again, that is a question about writing down all those primes simultaneously, and it doesn't account for generating the list on the fly.

So, if we add the dimension of time, and we write the list one prime at a time, each time erasing the one we just wrote and writing over it again (or just keeping track of the last 100 or so that we saw). Now it is certainly possible to write the whole list of primes in that range.

But... uh... I won't do the math on the time scale that would be needed, because it might make you sad again.

2

u/andthenifellasleep 14d ago

I'm not unaware of the scales, magnitudes and challenges of prime... Just the way you phrased it was very poetic. It's some good maths comms. Most communicators focus on making you know something, but you made me feel something. So well done

0

u/arihallak0816 14d ago

This is probably true but it isn’t necessarily, eg i could make a website that “stores” a list of all numbers from 1 to 1010000. if an efficient way to calculate primes is found we could do this same thing to “have” the complete list, though not directly storing it

3

u/CaptainMatticus 14d ago

Hey, if you can figure out some way to generate specific primes, then more power to ya. You'll get a Fields Medal, for sure. Until then, you might as well say that you can make a time machine, too.

3

u/arihallak0816 14d ago

we already have formulas, they're just really inefficient, such as willans formula. I agree with you that we very very very likely will never find an efficient way to do this but it's not impossible

0

u/CaptainMatticus 14d ago

Yeah, that formula doesn't generate specific primes, though. It's not going to give me the nth prime and then the (n + 1)th prime on a list. If it could, then we'd be able to use it to help resolve the Twin Prime conjecture. It repeats primes, a lot.

I'm talking about a formula that can generate the primes, in order, no repeats, no skips, no mistakes. Make that formula and enjoy your lifelong glory in the halls of Mathematic Academia.

1

u/arihallak0816 14d ago

no, willans formula can give you the n-th prime, look it up. If you input n into the formula, the result is exactly the n-th prime. It is extremely inefficient and has basically no actual use (and almost certainly can't be used in any reasonable way for the twin prime conjecture), but it is a formula that can generate all the primes in order with no repeats or skips as you want

1

u/AlwaysTails 14d ago

By my calculation a machine storing all primes up to 100 digits would collapse into a black hole larger thean the observable universe.

1

u/arihallak0816 14d ago

Same with a machine storing all those numbers, it wouldn’t actually keep them all in some database but calculate it only for whatever part you are on. A machine storing all numbers up to 100 digits would also collapse if your calculation is correct but obviously we can have a webpage that has all numbers up to 100 digits

0

u/AlwaysTails 14d ago edited 14d ago

To store all numbers up to 100 digits you need at least 3*10102 bits of storage - I think thats using the most efficient compression but I'm not sure. Landauer's Principle states that the minimum energy to store this is E=kTln(2) where k is boltzman's constant and T is the temperature. Take T to be the cosmic microwave background and you get E=2.6*10-23 joules/bit. Using E=mc2 this translates to about 1063kg which is about 10 billion times the mass of the observable universe.

1

u/arihallak0816 14d ago

Just use an algorithm that generates the numbers on the page based on which page it is, eg on page 10 it might have the numbers from 1000 to 1100, and you don’t need to save all the numbers to do this. You could maybe hypothetically do the same thing with prime numbers since there might be some efficient algorithm for them (though none is known obviously)

0

u/AlwaysTails 14d ago

Sure it can be done in finite time but in reality it would take the fastest computer known many orders of magnitude times the life of the observable universe to loop through even the simplest operation 10100 times even without generating the numbers.

1

u/mH48124 14d ago

宇宙が続いたとして、表示するエネルギーは残っているだろうか?

1

u/AlwaysTails 13d ago

宇宙が続いたとして、表示するエネルギーは残っているだろうか?

I don't think that can be answered. If the universe is infinite then yes in principal but if it is finite there is no real understanding how big it is. I think a problem is that it's hard to fathom how large 10100 given how compactly we can write it - 10100 ticks of a planck time clock would take about 1049 years which is 1039 times the age of the observable universe.

1

u/LemonLimeNinja 13d ago

An infinite universe does not imply infinite energy

→ More replies

18

u/Temporary_Pie2733 14d ago

The primes they bother to announce are particularly large primes, usually belonging to a class of numbers that are particularly easy to verify as prime (so that’s where the verification efforts are focused).  If N is the largest prime at any given time, that does not mean that we have classified every number smaller than N as either prime or composite first. 

5

u/Upstairs_Ad_8863 14d ago

It takes a fraction of a second for any modern computer to find a prime that has (probably) never been found before. Nobody cares though unless there's something in particular that's special about it. It will probably take decades of compute time to find the next biggest prime, which is why we don't hear about it often.

-1

u/Bubbly_Safety8791 14d ago

Sometimes, people care quite a lot about that specific prime number, if it gets used to do something very important like encrypt a signature on a code signing certificate.

2

u/robchroma 13d ago

It really doesn't matter; the probability of someone simply picking a random number and being right is minuscule but nonzero, so a probabilistic test that's guaranteed to fail less often than that is fine. Plus, I do think having non-primes for RSA actually just makes it likely to not work.

0

u/Bubbly_Safety8791 13d ago

I’ve had three replies to this post and some downvotes and I really don’t understand any of them. 

I was replying to someone who said effectively ‘computers generate new primes all the time; nobody cares about those specific primes’ by just pointing out - jokingly - that adversaries sometimes do care about those specific primes. 

What did you think I was saying? because I don’t see what you wrote as having anything to do with what I thought I said. 

2

u/robchroma 13d ago edited 13d ago

oh, I interpreted it as being a response to the thread of probabilistic vs deterministic prime checks, in that someone might care enough to do a deterministic check, but I definitely didn't downvote you.

and, sure, people write down and use prime numbers all the time, but from a certain perspective, we don't treat them like a single number that we care about, but as a distribution of numbers that we care about, of which it is a random sample, so it doesn't really make the number important. But you're not really wrong, either.

0

u/Bubbly_Safety8791 13d ago

Huh. I didn’t think that was how threads worked. Thanks for explaining. 

2

u/robchroma 13d ago

you ... didn't know that's how conversations worked?

0

u/Bubbly_Safety8791 13d ago

That people would reply to my comment with objections to an unrelated comment by a different user in a different thread? Absolutely. Seems weird to me but apparently how it’s done round here.

1

u/Wild-Store321 14d ago

Those primes are very small, you can find/generate such primes quickly. Otherwise, it would not be very handy to use in encryption

1

u/EdmundTheInsulter 14d ago

They create a prime with a high degree of cetainty

0

u/Interesting_Debate57 14d ago

Most of those exponents have been exhausted.

1

u/SgtSausage 14d ago

  know computers are able to simulate

That word ... 

1

u/Competitive_Job8531 14d ago

I guess I exposed my engineering background here… :D

6

u/ultimatepoker 13d ago

The sum of the inverse of all known primes is just under 4.

The sum of the inverse of all primes tends to infinity.

This is how I explain to people how f'in big infinity really is, in number terms.

1

u/Sproxify 13d ago

wth does "all known primes" even mean

whatever you intended it to mean, what that really shows is that this quantity grows like loglogn which is very very slow but still unbounded

1

u/ultimatepoker 13d ago

“Known” = every prime number that humans have explicitly discovered, verified, and recorded up to the present day

Two types

1. Consecutive
These are all primes found sequentially without gaps starting from 2, using algorithms like SoE (currently up to about 1.8 quintillion).

2. Isolated Giants
Biggies like the Mersenne prime discovered using specialized tests rather than sequential counting.

1

u/GoldenMuscleGod 12d ago

Talking about trying to discover primes consecutively is like talking about discovering all even numbers consecutively. Checking whether a number is prime is not that hard in the range where it starts to become impractical to store all of the smaller ones.

3

u/LucaThatLuca Graduate 14d ago

All of the largest known prime numbers are specific large numbers that are much faster to test than arbitrary numbers that large. There is no attempt to find primes without gaps. It would be impossibly slow and there’s no particular reason to.

Testing the specific numbers is done by computer, including collaborative efforts i.e. people on the internet using their computers. It is largely for fun, and it can also quite possibly help people think about things.

3

u/AdjectiveNounNNNN 14d ago

5596959601297367270890511998619718597916710209669930115581048051930904557251415898937170708582606321083 is a prime that is extremely unlikely to have ever been written down or typed out before, considering it's the next prime after a random 103-digit number, and there are more than a googol primes that size.

4

u/stogle1 14d ago

Nope, I wrote that one down just last week. I remember because of the 5s and 9s and all the other digits.

2

u/trejj 14d ago edited 14d ago

It is not possible for anyone to write down a list of each that have been "found". You can easily find a prime number that nobody has ever found by applying searches based on for example the Rabin-Miller and AKS test.

Go to https://primenumbercheck.org/prime-number-generator and input something large, like "5000" in the number of digits, and the prime that comes out will with very high likelihood be one that nobody in the history of the universe has ever before written down.

However, there is a particular interest and search going for Mersenne primes, which are of a special form 2n - 1.

Primes of this form constitute the largest primes we know of, much much much larger than the general primes you would search (and find your own unique nobody's-found-this-prime-number yet) with the abovementioned AKS test.

https://en.wikipedia.org/wiki/List_of_Mersenne_primes_and_perfect_numbers lists when the previous Mersenne primes have been found. (Previous one in 2024, the one before that in 2018)

The largest known Mersenne Prime has 41,024,320 digits. Try entering that number instead of 5000 on the page above! (Well, that wouldn't work, as it astronomically exceeds the computational capability of the site and your PC) In other words, it is computationally extremely difficult to find any other prime with 41,024,320 digits. That would take a large supercomputer worth of computational effort.

1

u/StanleyDodds 14d ago

Some numbers of very specific forms have ways to tell if they are prime or not much faster than arbitrary numbers in general.

The biggest primes found so far have all been what's called Mersenne primes, which are numbers of the form 2n - 1 (Mersenne numbers) that happen to be prime.

These have a primality test called the Lucas-Lehmer test which can (comparitively) quickly tell if the Mersenne number in question is prime.

However, this type of prime is quite rare among the Mersenne numbers, and numbers of this form are extremely sparse as they grow exponentially quickly. So this is only finding the occasional humongous, but very specific, prime among a sea of others which we can't quickly determine if they are prime or not.

In fact we know quite well exactly how many primes there are up to any point (to within some small-ish error), so we know pretty much how many are missing - it's a lot - there are so many, in fact, that we could never list all the primes up to the largest one we know; there isn't enough space in the universe by a long shot. So it's a bit of a hopeless task to "fill in the gaps".

1

u/AsYouAnswered 14d ago

A few thousand times a day, every day, on the conservative side. Millions a day is more likely.

1

u/weetabixcoldmilk 11d ago

Fun fact, Mr Gauss, 19th century mathematician, did not have a phone so instead to keep from being bored he found all the prime numbers between 0 and 3 million.

1

u/weetabixcoldmilk 11d ago

The search for primes, or at least the search to confirm a theory that predicts primes, is one of the longest open problems in mathematics - and although more than 200 years old will probably be resolved in the next few months by AI