PrimeGen

PrimeGen uses the Miller-Rabin Test as implemented by Victor Shoup's NTL to generate probable primes. The length of the primes is only limited by available memory.

The Miller-Rabin Test provides a probabilistic determination of the primality of any positive integer. Increasing the number of trials involved in the test decreases the probability of the test being wrong. If the test says that a number is not prime, then it is always correct. But if the test says that a number is prime, there is a probability it is wrong. For 30 trials that probability is less than about 8.7e-19 ((1/4)^30). Use "Miller-Rabin tests #" to change the "30" default.

If you wish to find if a single number is prime, enter the number in Starting Number. Leave EndNumber and Number of Primes blank. Click the Calculate button. A yes or no will appear to the right of Prime? in the upper left.

Now enter 12345678987654321 for the Starting Number. Enter 12345678987654421 for the End Number. Click the Calculate button. The Primes should display:

12345678987654373
12345678987654377
12345678987654401
12345678987654407
12345678987654409

Note the 5 displayed in Number of Primes.

Now clear the End Number and enter 10 in Number of Primes. Click the Calculate button. The Primes should display:

12345678987654373
12345678987654377
12345678987654401
12345678987654407
12345678987654409
12345678987654547
12345678987654553
12345678987654559
12345678987654563
12345678987654583

Clear the Starting Number and put 1000000 as the End Number. Click the Calculate button. An Alert box should appear asking if you wish to generate about 78000 primes. You can then click either the Yes or No button.


Dr. Robert M. Delaney
Emeritus Professor of Physics
Saint Louis University
delaneyrm@earthlink.net
delaneyrm@mac.com