此为 Mathematica 7 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.1)

PrimeQCertificateCheck

PrimeQCertificateCheck[cert, n]
gives True if cert is a valid certificate for the primality or compositeness of n, and False otherwise.
  • PrimeQCertificateCheck 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.
Needs["PrimalityProving`"]
A certificate of primality:
In[2]:=
Click for copyable input
Out[2]=
Check:
In[3]:=
Click for copyable input
Out[3]=
 
Needs["PrimalityProving`"]
A certificate of compositeness:
In[2]:=
Click for copyable input
Out[2]=
Check:
In[3]:=
Click for copyable input
Out[3]=
 
Needs["PrimalityProving`"]
A certificate need not come from PrimeQCertificate. Here is the certificate generated by PrimeQCertificate for 3837523:
In[2]:=
Click for copyable input
Out[2]=
A different certificate asserting that 3837523 is composite:
In[3]:=
Click for copyable input
Out[3]=
Check:
In[4]:=
Click for copyable input
Out[4]=