Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

random a 512-bit integer N that is not a multiple of 2, 3, or 5

if you are to choose a random a 512-bit integer N that is not a multiple of 2, 3, or 5 What is the probability that N is prime? i don't know the algorithm behind this one... i'm trying to work on a project but this is the starting point.. :)

like image 471
user597861 Avatar asked Dec 15 '25 13:12

user597861


2 Answers

The number of primes less than n=2512 is approximately n/log(n). The number of numbers you are considering is 4/15*n, so the probability you are looking for is 15/(4*log(n)), which is about 1 %.

like image 109
Sven Marnach Avatar answered Dec 17 '25 09:12

Sven Marnach


Probability bounds

You may use the following inequality for the prime pi function:

enter image description here

(Where log is taken in base e)

So:

8.58774*10151 < π(2512) < 8.93096*10151

And as you are only leaving alive 4/15 n numbers (because of killing he multiples of 2, 3 and 5), te probability is bounded by:

8.58774*10151/(4/15 2512) < P < 8.93096*10151/(4/15 2512)

Or:

0.010507 < P < 0.010687

Which is a nice, pretty tight bound.

like image 37
Dr. belisarius Avatar answered Dec 17 '25 07:12

Dr. belisarius



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!