Pocklington Primality Test
   HOME

TheInfoList



OR:

In mathematics, the Pocklington–Lehmer primality test is a
primality test A primality test is an algorithm for determining whether an input number is prime. Among other fields of mathematics, it is used for cryptography. Unlike integer factorization, primality tests do not generally give prime factors, only stating whet ...
devised by
Henry Cabourn Pocklington Henry Cabourn Pocklington FRS (28 January 1870, Exeter – 15 May 1952, Leeds) was an English physicist and mathematician. His primary profession was as a schoolmaster, but he made important contributions to number theory Number theory (or ...
and
Derrick Henry Lehmer Derrick Henry "Dick" Lehmer (February 23, 1905 – May 22, 1991), almost always cited as D.H. Lehmer, was an American mathematician significant to the development of computational number theory. Lehmer refined Édouard Lucas' work in the 1930s and ...
. The test uses a partial factorization of N - 1 to prove that an integer N is
prime A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways ...
. It produces a
primality certificate In mathematics and computer science, a primality certificate or primality proof is a succinct, formal proof that a number is prime. Primality certificates allow the primality of a number to be rapidly checked without having to run an expensive or un ...
to be found with less effort than the
Lucas primality test In computational number theory, the Lucas test is a primality test for a natural number ''n''; it requires that the prime factors of ''n'' − 1 be already known. It is the basis of the Pratt certificate that gives a concise verification that ...
, which requires the full factorization of N - 1.


Pocklington criterion

The basic version of the test relies on the Pocklington theorem (or Pocklington criterion) which is formulated as follows: Let N > 1 be an integer, and suppose there exist natural numbers and such that Then is prime. Note: Equation () is simply a
Fermat primality test The Fermat primality test is a probabilistic test to determine whether a number is a probable prime. Concept Fermat's little theorem states that if ''p'' is prime and ''a'' is not divisible by ''p'', then :a^ \equiv 1 \pmod. If one wants to tes ...
. If we find ''any'' value of , not divisible by , such that equation () is false, we may immediately conclude that is not prime. (This divisibility condition is not explicitly stated because it is implied by equation ().) For example, let N = 35. With a = 2, we find that a^ \equiv 9 \pmod. This is enough to prove that is not prime. Suppose is not prime. This means there must be a prime , where q \le \sqrt that divides . Since p > \sqrt N - 1 \ge q - 1, p > q - 1, and since is prime, \gcd = 1. Thus there must exist an integer , a multiplicative inverse of modulo , with the property that and therefore, by
Fermat's little theorem Fermat's little theorem states that if ''p'' is a prime number, then for any integer ''a'', the number a^p - a is an integer multiple of ''p''. In the notation of modular arithmetic, this is expressed as : a^p \equiv a \pmod p. For example, if = ...
This implies : 1 \;\; \equiv a^\pmod, by () since q \vert N :: \equiv (a^)^\equiv a^ \equiv a^\equiv (a^)^\pmod, :: \equiv a^\pmod, by () This shows that divides the \gcd() in (), and therefore this \gcd() \ne 1; a contradiction. Given , if and can be found which satisfy the conditions of the theorem, then is prime. Moreover, the pair (, ) constitute a ''primality certificate'' which can be quickly verified to satisfy the conditions of the theorem, confirming as prime. The main difficulty is finding a value of which satisfies (). First, it is usually difficult to find a large prime factor of a large number. Second, for many primes , such a does not exist. For example, N = 17 has no suitable because N - 1 = 2^4, and p = 2 < \sqrt-1, which violates the inequality in (); other examples include N = 19, 37, 41, 61, 71, 73, and 97. Given , finding is not nearly as difficult. If is prime, then by Fermat's little theorem, any in the interval 1 \leq a \leq N - 1 will satisfy () (however, the cases a = 1 and a = N - 1 are trivial and will not satisfy ()). This will satisfy () as long as ord() does not divide (N - 1)/p. Thus a randomly chosen in the interval 2 \leq a \leq N - 2 has a good chance of working. If is a generator mod , its order is and so the method is guaranteed to work for this choice.


Generalized Pocklington test

The above version of version of Pocklington's theorem is sometimes impossible to apply because some primes N are such that there is no prime p dividing N - 1 where p > \sqrt - 1. The following generalized version of Pocklington's theorem is more widely applicable. Theorem: Factor as , where and are relatively prime, A > \sqrt, the prime factorization of is known, but the factorization of is not necessarily known. If for each prime factor of there exists an integer a_p so that then ''N'' is prime. Let be a prime dividing and let p^e be the maximum power of dividing . Let be a prime factor of . For the a_p from the corollary set b \equiv a_p^ \pmod. This means b^ \equiv a_p^ \equiv 1 \pmod and because of \gcd = 1 also b^ \equiv a_p^ \not\equiv 1 \pmod. This means that the order of b \pmod is p^e Thus, p^e \vert (q - 1). The same observation holds for each prime power factor p^e of ''A'', which implies A \vert (q - 1). Specifically, this means q > A \ge \sqrt. If were composite, it would necessarily have a prime factor which is less than or equal to \sqrt. It has been shown that there is no such factor, which proves that is prime.


Comments

The Pocklington–Lehmer primality test follows directly from this corollary. To use this corollary, first find enough factors of so the product of those factors exceeds \sqrt. Call this product . Then let be the remaining, unfactored portion of . It does not matter whether is prime. We merely need to verify that no prime that divides also divides , that is, that and are relatively prime. Then, for every prime factor of , find an a_p which fulfills conditions () and () of the corollary. If such a_ps can be found, the Corollary implies that is prime. According to Koblitz, a_p = 2 often works.


Example

Determine whether : N = 27457 is prime. First, search for small prime factors of N - 1. We quickly find that : N - 1 = 2^6 \cdot 3 \cdot B = 192 \cdot B. We must determine whether A = 192 and B = (N - 1)/A = 143 meet the conditions of the Corollary. A^2 = 36864 > N, so A > \sqrt. Therefore, we have factored enough of N - 1 to apply the Corollary. We must also verify that \gcd = 1. It does not matter whether is prime (in fact, it is not). Finally, for each prime factor of , use trial and error to find an that satisfies () and (). For p = 2, try a_2 = 2. Raising a_2 to this high power can be done efficiently using
binary exponentiation Binary may refer to: Science and technology Mathematics * Binary number, a representation of numbers using only two digits (0 and 1) * Binary function, a function that takes two arguments * Binary operation, a mathematical operation that ...
: : a_2^ \equiv 2^ \equiv 1 \pmod : \gcd = \gcd = 27457. So, a_2 = 2 satisfies () but not (). As we are allowed a different for each , try a_2 = 5 instead: : a_2^ \equiv 5^ \equiv 1 \pmod : \gcd = \gcd = 1. So a_2 = 5 satisfies both () and (). For p = 3, the second prime factor of , try a_3 = 2: : a_3^ \equiv 2^ \equiv 1 \pmod. : \gcd = \gcd = 1. a_3 = 2 satisfies both () and (). This completes the proof that N = 27457 is prime. The certificate of primality for N = 27457 would consist of the two (p, a_p) pairs (2, 5) and (3, 2). We have chosen small numbers for this example, but in practice when we start factoring we may get factors that are themselves so large their primality is not obvious. We cannot prove is prime without proving that the factors of are prime as well. In such a case we use the same test recursively on the large factors of , until all of the primes are below a reasonable threshold. In our example, we can say with certainty that 2 and 3 are prime, and thus we have proved our result. The primality certificate is the list of (p, a_p)pairs, which can be quickly checked in the corollary. If our example had included large prime factors, the certificate would be more complicated. It would first consist of our initial round of s which correspond to the 'prime' factors of ; Next, for each factor of where primality was uncertain, we would have more , and so on for factors of these factors until we reach factors of which primality is certain. This can continue for many layers if the initial prime is large, but the important point is that a certificate can be produced, containing at each level the prime to be tested, and the corresponding s, which can easily be verified.


Extensions and variants

The 1975 paper by Brillhart, Lehmer, and Selfridge gives a proof for what is shown above as the "generalized Pocklington theorem" as Theorem 4 on page 623. Additional theorems are shown which allow less factoring. This includes their Theorem 3 (a strengthening of an 1878 theorem of Proth): : Let N-1 = mp where is an odd prime such that 2p+1 > \sqrt N. If there exists an for which a^ \equiv -1 \pmod, but a^ \not\equiv -1 \pmod, then is prime. If is large, it is often difficult to factor enough of N - 1 to apply the above corollary. Theorem 5 of the Brillhart, Lehmer, and Selfridge paper allows a primality proof when the factored part has reached only (N/2)^. Many additional such theorems are presented that allow one to prove the primality of based on the partial factorization of N - 1 and N + 1.The classical tests
/ref>


References

* Leonard Eugene Dickson, "History of the Theory of Numbers" vol 1, p 370, Chelsea Publishing 1952 * Henry Pocklington, "Math. Quest. Educat. Times", (2), 25, 1914, p 43-46 (Mathematical questions and solutions in continuation of the mathematical columns of "the Educational times".)


External links

*Chris Caldwell

at the
Prime Pages The PrimePages is a website about prime numbers maintained by Chris Caldwell at the University of Tennessee at Martin. The site maintains the list of the "5,000 largest known primes", selected smaller primes of special forms, and many "top twenty" ...
. *Chris Caldwell
"Primality Proving 3.2: n+1 tests and the Lucas-Lehmer test for Mersennes"
at the
Prime Pages The PrimePages is a website about prime numbers maintained by Chris Caldwell at the University of Tennessee at Martin. The site maintains the list of the "5,000 largest known primes", selected smaller primes of special forms, and many "top twenty" ...
. {{DEFAULTSORT:Pocklington Primality Test Primality tests