Mathematica 9 is now available

Documentation / Mathematica / Built-in Functions / Programming / Tests /

PrimeQ

FilledSmallSquare PrimeQ[expr] yields True if expr is a prime number, and yields False otherwise.

FilledSmallSquare PrimeQ[1] gives False.

FilledSmallSquare PrimeQ[-n], where n is prime, gives True.

FilledSmallSquare PrimeQ[n, GaussianIntegers->True] determines whether n is a Gaussian prime.

FilledSmallSquare PrimeQ[m + I m] automatically works over the Gaussian integers.

FilledSmallSquare Simplify[expr Primes] can be used to try to determine whether a symbolic expression is mathematically a prime.

FilledSmallSquare See Section 2.3.5, Section 3.1.1 and Section 3.2.4.

FilledSmallSquare Implementation Notes: see Section A.9.4.

FilledSmallSquare See also: FactorInteger, Primes.

FilledSmallSquare Related package: NumberTheory`PrimeQ`.

FilledSmallSquare New in Version 1.

Further Examples



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.