isprime
primality test
Calling Sequence
Parameters
Description
Examples
References
isprime(n)
n
-
integer
The isprime command is a probabilistic primality testing routine. (See prime number.)
It returns false if n is shown to be composite within one strong pseudo-primality test and one Lucas test. It returns true otherwise.
If isprime returns true, n is very probably prime - see References section. No counterexample is known and it has been conjectured that such a counter example must be hundreds of digits long.
The Tabulate command can be used to display prime numbers in a grid. The following table highlights any prime numbers with a pink background.
Note that this procedure can be modified to show tables for various values of r and c.
Knuth, Donald E. The Art of Computer Programming. 2nd ed. Reading, Mass.: Addison-Wesley, 1997. Vol. 2 Section 4.5.4: Algorithm P.
Riesel, H. Prime Numbers and Computer Methods for Factorization. Basel: Birkhauser, 1994.
See Also
ithprime
nextprime
prevprime
type/prime
Download Help Document