primality test - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Group Theory : Numbers : Prime : isprime

isprime - primality test

Calling Sequence

isprime(n)

Parameters

n

-

integer

Description

• 

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.

Examples

isprime1

false

(1)

isprime2

true

(2)

isprime17

true

(3)

isprime21

false

(4)

isprime11!+1

true

(5)

isprime230330+7

true

(6)

See Also

ithprime, nextprime, prevprime, type[prime]

References

  

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.


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam