Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Number Theory > Prime Numbers > Prime >
Mathematica > Mathematics and Algorithms > Mathematical Functions > Number Theoretic Functions > Prime Numbers > Prime >

Prime

Prime[n]
gives the n^(th) prime number.
  • Prime automatically threads over lists.
The first 20 primes:
The billionth prime:
Plot the sequence:
The first 20 primes:
In[1]:=
Click for copyable input
Out[1]=
 
The billionth prime:
In[1]:=
Click for copyable input
Out[1]=
 
Plot the sequence:
In[1]:=
Click for copyable input
Out[1]=
Some symbolic operations can be done with Prime[n]:
TraditionalForm formatting:
Differences between the first 100 primes:
Plot of the first 50 primes modulo 6:
Fraction of the first million primes greater than 3 of the form :
With the exception of 2 and 3, all primes are of the form :
The n^(th) prime compared with an estimate:
An approximation to the zeta function:
Construct prime Euclid's numbers:
PrimePi is effectively the inverse of Prime:
New in 1
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF