Largest Known Prime

BobTPH

Joined Jun 5, 2013
11,466
When will end? Oh, never mind.

Suppose there is a largest prime. Multiply together all the primes and add 1. So, the remainder when divided by any prime is 1. Oh, that means it is prime.

I love that elegant proof.
 

wayneh

Joined Sep 9, 2010
18,089
Isn't a big part of cryptography based on the difficulty of factoring large (potential) primes? Does the identification of more and more primes make cryptography more difficult? I know just enough to ask stupid questions.
 

WBahn

Joined Mar 31, 2012
32,707
Isn't a big part of cryptography based on the difficulty of factoring large (potential) primes? Does the identification of more and more primes make cryptography more difficult? I know just enough to ask stupid questions.
These are pretty much unrelated. For RSA-4096, you need two primes that are each roughly 2048 bit long. That equivalent to about 617 decimal digits. So anything we do related to primes that have tens of millions of digits has no direct bearing. Which is not to say that studying them might not result in a deeper theoretical understanding of primes and their behaviors which might, in turn, inform what we know about prime numbers used for practical applications.
 

Thread Starter

joeyd999

Joined Jun 6, 2011
6,204
For RSA-4096, you need two primes that are each roughly 2048 bit long.
Logical follow-up question: how many primes exist that are "roughly" 2048 bits long?

There should be at most 2 primes that are equidistantly closest to 2^2048 - 1.
 

WBahn

Joined Mar 31, 2012
32,707
Logical follow-up question: how many primes exist that are "roughly" 2048 bits long?

There should be at most 2 primes that are equidistantly closest to 2^2048 - 1.
There are a LOT of them.

The prime counting function π(N), is the number of prime numbers less than or equal to N.

A commonly-used approximation to it is N/ln(N).

So the number of primes that are representable as 2048-bit numbers is about (2^B)/(B·ln(2)) and if you subtract the number that are representable as 2047-bit numbers you find that about half of them require the full 2048 bits. So there are about 2^2036 2048-bit primes to choose from. Since there are only about 2^265 elementary particles in the known universe, we are not likely to run out of them any time soon.

When prime numbers are needed, a common approach is to just randomly pick the interior bits and force the first and last bits to be set. Then test if it is prime or not. If it's not, pick again. At 2048 bits, you have about a 1 in 700 chance of getting a prime. This is high enough that generating two random primes for RSA can be done in an acceptable amount of time (a handful of seconds on typical machines) and you are virtually guaranteed that no other key generator has ever produced either one of those values, or ever will again, provided you are using an even halfway decent pseudorandom function to generate the bits in your primes.
 

MrAl

Joined Jun 17, 2014
13,667
Pure math is a welcome distraction, sometimes.

On the other hand...
Yeah I know I was kind of kidding around and I even mess around with math constants now and then myself. I've calculated pi to millions of digits, but never needed it except in one program I did, but then I only needed about 10000 digits that was well enough.

It just strikes me something what some people do all day when there are so many important problems in the world today that involve actual human life and just general well-being. Then again maybe some of those problems have no good solution.
 

Thread Starter

joeyd999

Joined Jun 6, 2011
6,204
Some even just because of those said solutions, or should I say those so-called solutions...
The Law of Unintended Consequences.

Some think it's better to be seen doing something, regardless of the outcome.

In those cases, it's better to just find new primes.
 
Top