This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

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


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