PrimeQ
PrimeQ[
expr
] yields True if expr is a prime number, and yields False otherwise.
PrimeQ[1] gives False. PrimeQ[-
n
], where n is prime, gives True. PrimeQ[
n
,
GaussianIntegers->True] determines whether n is a Gaussian prime. Simplify[
expr
Primes] can be used to try to determine whether a symbolic expression is mathematically a prime. See The Mathematica Book on the web:Section 2.3.5, Section 3.1.1 and Section 3.2.4. Implementation Notes on the web: see Section A.9.4. See also: FactorInteger, Primes.
Further Examples
|
|
|
|
 |
|
|