Prime

Prime[n]

gives the n^(th) prime number.

Details

  • Prime[1] is 2.
  • Prime automatically threads over lists.

Examples

open allclose all

Basic Examples  (3)

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]=

Scope  (2)

Applications  (5)

Properties & Relations  (2)

See Also

NextPrime  RandomPrime  MersennePrimeExponent  FactorInteger  PrimeQ  PrimePi  Primes  PrimeZetaP  PerfectNumber

Tutorials

Introduced in 1988
(1.0)