next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Macaulay2Doc :: isPrime

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

Synopsis

Description

ZZ/2[t];
isPrime(t^2+t+1)
isPrime(t^2+1)
isPrime 101
isPrime 158174196546819165468118574681196546811856748118567481185669501856749
isPrime 158174196546819165468118574681196546811856748118567481185669501856749^2

Since factor returns factors guaranteed only to be pseudoprimes, it may be useful to check their primality, as follows.

f = factor 28752093487520394720397634653456
peek'_2 f
first \ toList f
isPrime \ oo
This function can be used also to determine whether an ideal in a polynomial ring is prime.
R = QQ[a..d];
I = monomialCurveIdeal(R,{1,5,8})
isPrime I

Primality testing for integers is handled by pari.

See also

Ways to use isPrime :