DOCUMENTATION CENTER SEARCH
Mathematica
>
Number Theoretic Functions
>
Built-in
Mathematica
Symbol
Putting Constraints on Patterns
Types of Numbers
Integer and Number Theoretic Functions
Tutorials »
|
FactorInteger
Prime
NextPrime
Primes
PrimePowerQ
CoprimeQ
GCD
See Also »
|
Cryptographic Number Theory
Integer Functions
Number Recognition
Number Theoretic Functions
Number Theory
Prime Numbers
Testing Expressions
More About »
PrimeQ
PrimeQ
[
expr
]
yields
True
if
expr
is a prime number, and yields
False
otherwise.
MORE INFORMATION
PrimeQ
[1]
gives
False
.
PrimeQ
[-
n
]
, where
n
is prime, gives
True
.
PrimeQ
[
n
,
GaussianIntegers
->
True
]
determines whether
n
is a Gaussian prime.
PrimeQ
[
m
+
I
n
]
automatically works over the Gaussian integers.
Simplify
[
expr
Primes
]
can be used to try to determine whether a symbolic expression is mathematically a prime.
EXAMPLES
CLOSE ALL
Basic Examples
(1)
Test whether a number is prime:
In[1]:=
Out[1]=
In[2]:=
Out[2]=
Scope
(1)
Generalizations & Extensions
(1)
Applications
(3)
Neat Examples
(3)
SEE ALSO
FactorInteger
Prime
NextPrime
Primes
PrimePowerQ
CoprimeQ
GCD
TUTORIALS
Putting Constraints on Patterns
Types of Numbers
Integer and Number Theoretic Functions
RELATED LINKS
Implementation notes: Numerical and Related Functions
NKS|Online
(
A New Kind of Science
)
MORE ABOUT
Cryptographic Number Theory
Integer Functions
Number Recognition
Number Theoretic Functions
Number Theory
Prime Numbers
Testing Expressions
New in 1 | Last modified in 5
© 2008 Wolfram Research, Inc.