next | previous | forward | backward | up | top | index | toc | home

isPrime -- whether a integer, polynomial, or ideal is prime

Synopsis

Description

i1 : isPrime 91

o1 = false
i2 : isPrime 101

o2 = true
i3 : isPrime 31991

o3 = true
i4 : isPrime 32003

o4 = true
i5 : ZZ/2[t];
i6 : isPrime(t^2+t+1)

o6 = true
i7 : isPrime(t^2+1)

o7 = false
This function can be used to determine whether an ideal in a polynomial ring is prime.
i8 : 
               R = QQ[a..d];

Caveat

At the moment, for integers larger than 2^31-1 it checks for divisibility by small primes, and then applies a strong pseudoprimality test (Rabin-Miller) to the base 2.

See also

Ways to use isPrime :