up previous next
checks if an integer is a probable prime
IsProbPrime(N: INT): BOOL |
This function returns True if its integer argument passes a fairly
stringent primality test; otherwise it returns False. There is a very
small chance of the function returning True even though the argument is
composite; if it returns False, we are certain that the argument is composite.
Some people call it a compositeness test.
/**/ IsProbPrime(2);
true
/**/ IsProbPrime(1111111111111111111);
true
/**/ [N in 1..1111 | IsProbPrime((10^N-1)/9)]; -- only five values are known
[2, 19, 23, 317, 1031] -- next might be 49081
|