Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Formula Manipulation > Assumptions and Domains > Primes >

Primes

Primes
represents the domain of prime numbers, as in xPrimes.
  • xPrimes evaluates only if x is a numeric quantity.
  • Simplify can be used to try to determine whether an expression corresponds to a prime number.
  • The domain of primes is taken to be a subset of the domain of integers.
The number is a prime:
Fermat's little theorem:
Find primes satisfying an inequality:
The number is a prime:
In[1]:=
Click for copyable input
Out[1]=
 
Fermat's little theorem:
In[1]:=
Click for copyable input
Out[1]=
 
Find primes satisfying an inequality:
In[1]:=
Click for copyable input
Out[1]=
Test domain membership of a numeric expression:
Make domain membership assumptions:
Specify the default domain for Reduce and FindInstance:
TraditionalForm formatting:
Wilson's theorem :
A list of twin primes:
Check:
Simplifications involving prime numbers:
Primes represents the set of positive integers that are prime:
PrimeQ gives True if an integer, positive or negative, is prime:
PrimeQ returns True for explicit numeric primes and False otherwise:
Element remains unevaluated when it cannot decide whether an expression is a prime:
New in 4
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF