PrimeQCertificateCheck


gives True if cert is a valid certificate for the primality or compositeness of n, and False otherwise.

DetailsDetails

  • To use , you first need to load the Primality Proving Package using Needs["PrimalityProving`"].
  • recognizes whether cert is a primality or compositeness certification, and then uses the certificate to verify the assertion.
  • The certificate cert should match the integer n.

ExamplesExamplesopen allclose all

Basic Examples (3)Basic Examples (3)

In[1]:=
Click for copyable input

A certificate of primality:

In[2]:=
Click for copyable input
Out[2]=

Check:

In[3]:=
Click for copyable input
Out[3]=
In[1]:=
Click for copyable input

A certificate of compositeness:

In[2]:=
Click for copyable input
Out[2]=

Check:

In[3]:=
Click for copyable input
Out[3]=
In[1]:=
Click for copyable input

A certificate need not come from PrimeQCertificate. Here is the certificate generated by PrimeQCertificate for :

In[2]:=
Click for copyable input
Out[2]=

A different certificate asserting that is composite:

In[3]:=
Click for copyable input
Out[3]=

Check:

In[4]:=
Click for copyable input
Out[4]=
New to Mathematica? Find your learning path »
Have a question? Ask support »