Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Primality Proving Package >

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.
  • ProvablePrimeQ should not be used as a replacement for PrimeQ, as PrimeQ is several orders of magnitude faster. Instead, use ProvablePrimeQ 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 p-1 method
"PollardRhoTest"Automaticwhether to use the Pollard Rho method
"TrialDivisionLimit"Automaticnumber of primes to use in trial division
"PrimeQMessages"Falsewhether progress is to be monitored
PrimeQ indicates that 1093 is prime:
ProvablePrimeQ 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]=
ProvablePrimeQ gives the same result, but it has generated a certificate:
In[3]:=
Click for copyable input
Out[3]=
ProvablePrimeQ works on arbitrarily large numbers:
ProvablePrimeQ automatically threads over lists:
Use the option "Certificate"->True to view the certificate directly:
A random prime:
Progress messages are printed with "PrimeQMessages" -> True:
Here is a random prime:
If ProvablePrimeQ has returned a result, use PrimeQCertificate to print the certificate:
With "Certificate"->True, ProvablePrimeQ repeats the Atkin-Morain primality test:
A certificate cannot be generated for -1, 0 or 1:
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team