Function Repository Resource:

PrimeQCertificateCheck

Source Notebook

Test if a certificate can be used for ascertaining the primality or compositeness of a number

Contributed by: Wolfram Research

ResourceFunction["PrimeQCertificateCheck"][cert,n]

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

Details and Options

ResourceFunction["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.

Examples

Basic Examples (3) 

A certificate of primality:

In[1]:=
ResourceFunction["PrimeQCertificate"][1093]
Out[1]=

Check:

In[2]:=
ResourceFunction["PrimeQCertificateCheck"][%, 1093]
Out[2]=

A certificate of compositeness:

In[3]:=
ResourceFunction["PrimeQCertificate"][3837523]
Out[3]=

Check:

In[4]:=
ResourceFunction["PrimeQCertificateCheck"][%, 3837523]
Out[4]=

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

In[5]:=
c1 = ResourceFunction["PrimeQCertificate"][3837523]
Out[5]=

A different certificate asserting that 3837523 is composite:

In[6]:=
c2 = {1488665, 2, 3837523}
Out[6]=

Check:

In[7]:=
ResourceFunction["PrimeQCertificateCheck"][c2, 3837523]
Out[7]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Version History

  • 1.0.0 – 19 April 2019

Related Resources

License Information