Operate on prime numbers, check and prove primality


MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

To convert a MuPAD notebook file to a MATLAB live script file, see convertMuPADNotebook. MATLAB live scripts support most MuPAD functionality, although there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

MuPAD Functions

isprimePrimality test
ithprimeI-th prime number
nextprimeNext prime number
prevprimeNext smaller prime
numlib::checkPrimalityCertificateTest the primality certificate
numlib::OmegaNumber of prime divisors (with multiplicity)
numlib::piNumber of primes up to a given bound
numlib::proveprimePrimality proving using elliptic curves
numlib::primedivisorsPrime factors of an integer


Primes and Factorizations

Prime numbers are positive integers larger than 1 that have only two positive integer divisors: 1 and the number itself.