PrimeQ

PrimeQ[expr]

yields True if expr is a prime number, and yields False otherwise.

Details and Options

Examples

open allclose all

Basic Examples  (1)

Test whether a number is prime:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Scope  (1)

Generalizations & Extensions  (1)

Applications  (3)

Neat Examples  (3)

See Also

FactorInteger  Prime  NextPrime  Primes  PrimePowerQ  CoprimeQ  GCD  MersennePrimeExponentQ

Tutorials

Introduced in 1988
(1.0)
| Updated in 2003
(5.0)