PrimeQCertificateCheck


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

更多信息更多信息

  • 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.

范例范例打开所有单元关闭所有单元

基本范例 (3)基本范例 (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 »