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

ProvablePrimeQ

ProvablePrimeQ[n]
gives True if n is provably prime, and False otherwise.
  • When ProvablePrimeQ[n] returns True, then n is prime based on the Pratt certificate of primality or the Atkin-Morain certificate of primality.
  • should not be used as a replacement for PrimeQ, as PrimeQ is several orders of magnitude faster. Instead, use to certify the results of PrimeQ when needed.
  • The following options can be given:
"SmallPrime"1050lower bound for using the Atkin-Morain test
"Certificate"Falsewhether to print a certificate
"PollardPTest"Automaticwhether to use the Pollard method
"PollardRhoTest"Automaticwhether to use the Pollard method
"TrialDivisionLimit"Automaticnumber of primes to use in trial division
"PrimeQMessages"Falsewhether progress is to be monitored
PrimeQ indicates that 1093 is prime:
gives the same result, but it has generated a certificate:
Needs["PrimalityProving`"]
PrimeQ indicates that 1093 is prime:
In[2]:=
Click for copyable input
Out[2]=
gives the same result, but it has generated a certificate:
In[3]:=
Click for copyable input
Out[3]=
works on arbitrarily large numbers:
automatically threads over lists:
Use the option True to view the certificate directly:
A random prime:
Progress messages are printed with -> True:
Here is a random prime:
If has returned a result, use to print the certificate:
With True, repeats the Atkin-Morain primality test:
A certificate cannot be generated for -1, 0 or 1: