numlib::checkPrimalityCertificate

Test the primality certificate

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

numlib::checkPrimalityCertificate(certificate)

Description

numlib::checkPrimalityCertificate tests the certificate of primality returned by numlib::proveprime. For large prime numbers, the numlib::proveprime function generates certificates that provide all data you need for proving primality of a number by the Atkin-Goldwasser-Kilian-Morain algorithm. See Example 1.

For small prime numbers, numlib::proveprime does not return a certificate of primality. Instead, it returns TRUE. For nonprime numbers numlib::proveprime returns FALSE. In both cases, you do not need to use numlib::checkPrimalityCertificate.

Examples

Example 1

Use the numlib::proveprime function to check the primality of the number 1299709. The function returns the following sequence of lists. This sequence is the certificate of primality:

certificate := numlib::proveprime(1299709)

The certificate provides all data that you need for proving primality of 1299709 by the Atkin-Goldwasser-Kilian-Morain algorithm. You can substitute the numbers into the algorithm and verify the primality of the number. Alternatively, you can verify the certificate by using the numlib::checkPrimalityCertificate function:

numlib::checkPrimalityCertificate(certificate)

Parameters

certificate

A list or a sequence of lists returned by numlib::proveprime

Return Values

TRUE or FALSE

See Also

MuPAD Functions

More About

Was this topic helpful?