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 >
Mathematica > Mathematics and Algorithms > Mathematical Functions > Number Theoretic Functions >
Prime Numbers
The primes have been a focal point for investigations of numbers for more than two millennia. Mathematica implements state-of-the-art algorithms for handling both primes and the advanced mathematics that has grown up around their study. Use Prime to quickly find the billionth prime, or Zeta to get empirical evidence related to the Riemann hypothesis.
Generating Primes
Prime the nth prime number
NextPrime next, previous, etc. prime
RandomPrime pick a random prime
PrimePi the number of primes up to n
Zeta Riemann zeta function
ZetaZero zeros of the zeta function
LogIntegral  ▪ RiemannR  ▪ RiemannSiegelZ  ▪ PrimeZetaP  ▪ ...
Primality Testing
PrimeQ test if a number is prime
PrimePowerQ test if a number is a prime power
CoprimeQ test if numbers are coprime
Theorems & Equations
Primes the domain of primes
Reduce reduce equations over the primes
FindInstance find Diophantine solutions over the primes
FullSimplify simplify assuming numbers are prime
Factoring
FactorInteger find the factors of an integer
PrimeNu number of distinct primes
PrimeOmega number of primes including multiplicities
TUTORIALS
MORE ABOUT
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team