if you want to select a random 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 ... I'm trying to work on a project, but this is the starting point .. :)
The number of primes less than n = 2 512 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%.
Probability Estimates
pi:
( log e)
:
8,58774 * 10 151 & pi; (2 512) < 8,93096 * 10 151
4/15 n (- 2, 3 5), :
8,58774 * 10 151/(4/15 2 512) < P < 8.93096 * 10 151/(4/15 2 512)
, .
? .
It sounds like home, so I suggest you create some 512-bit numbers and use some well-known simple tests to get an approximate answer heuristically.