Test the primality certificate
MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
numlib::checkPrimalityCertificate tests the
certificate of primality returned by
numlib::proveprime. For large prime numbers,
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
In both cases, you do not need to use
to check the primality of the number 1299709. The function returns
the following sequence of lists. This sequence is the certificate
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
A list or a sequence of lists returned by