up previous next
IsProbPrime

checks if an integer is a probable prime

Syntax
IsProbPrime(N: INT): BOOL

Description
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 when the argument is composite; however, if it returns false , we are certain that the argument is composite. Some people call it a "compositeness test".

Example
/**/  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

See Also