资 源 简 介
Test for Prime Numbers
Summary
This project encompasses 5 different tests for primality. The methods implemented are Miller-Rabin, Miller-Rabin Deterministic, Solovay-Strassen, Fermat’s Primality Test and a Brute Force method. In addition to the 5 primality tests, the program is also capable of finding the closest integer to a given upper bound. The largest number it is capable of handling is a 2147483647 bit integer.
Primality Tests
Miller-Rabin
This primality test is a probabilistic primality test that has a degree of certainty of 4^(-k) where k is the number of unique witnesses less than n-1. This primality test is very fast and very accurate. This is the default primality test for the project.
Miller-Rabin Deterministic
A variation on the Miller-Rabin test, it uses an unproven conjecture for finding deterministically if the number in question is prime.