This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

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