Primality Proving Package 内置符号

# PrimeQCertificate

 PrimeQCertificate[n] gives a certificate that n is prime or that n is composite.
• PrimeQCertificate uses the Pratt certificate and the Atkin-Morain certificate for primality.
• A certificate of compositeness is a list of 3 integers, either {a, n-1, n} or {a, 2, n}, with .
• A prime p always satisfies ap-11 mod p. The certificate {a, n-1, n} can be used to show that n is composite by demonstrating that an-11 mod n.
• Any number a whose square is 1mod n for n prime must satisfy a±1 mod n. The certificate {a, 2, n} can be used to show that n is composite by demonstrating that a±1mod n and a21 mod n.
• A certificate of primality consists of a recursive list of certificates which prove that n is a prime if one or more smaller numbers are prime as well.
 例   (2)
Needs["PrimalityProving`"]
A certificate that can be used to prove that 1093 is a prime:
 Out[2]=
The same certificate can be obtained by using ProvablePrimeQ with the option "Certificate"->True:
 Out[3]=

Needs["PrimalityProving`"]
A certificate that can be used to prove that 1093 3511 is composite:
 Out[2]=
The output is a list of 3 integers that indicate 1093 3511 is composite, and that it violates Fermat's little theorem for primes, 2p-11 mod p if p is prime:
 Out[3]=