scieee AI-readable full text Open interactive document viewer

A primality test for Kp^n+1 numbers

Grau, José María; Sadornil, Daniel; Oller Marcén, Antonio M.

Abstract

In this paper we generalize the classical Proth's theorem and the Miller-Rabin test for integers of the form N = Kpn +1. For these families, we present variations on the classical Pocklington's results and, in particular, a primality test whose computational complexity is Õ(log2 N) and, what is more important, that requires only one modular exponentiation modulo N similar to that of Fermat's test. Grau, José María; Oller Marcén, Antonio M.; Sadornil, Daniel

Full text

arXiv:1011.4836v3 [math.NT] 26 Apr 2011 A PRIMALITY TEST FOR Kpn+ 1 NUMBERS JOS´ E MAR´ IA GRAU AND ANTONIO M. OLLER-MARC´ EN Abstract. In this paper we generalize the classical Proth’s theorem for integers of the form N=Kpn+ 1. For these families, we present a primality test whose computational complexity is e O(log2(N)) and, what is more important, that requires only one modular exponentiation similar to that of Fermat’s test. Consequently, the presented test improves the most often used one, derived from Pocklington’s theorem, which usually requires the computation of several modular exponentiations together with some GCD’s. AMS 2000 Mathematics Subject Classification: 11Y11,11Y16,11A51,11B99 1. Introduction In 1877 P. Pepin (see [18]) presented the following result about the primality of Fermat numbers: Theorem 1 (Pepin, 1877).Let Fnbe the n-th Fermat number; i.e., Fn= 22n+1 with n > 1. Then, Fnis prime if and only if 3Fn−1 2≡ −1(mod Fn). Although this theorem has not certified the primality of any new Fermat prime (by 1877 the 5 Fermat primes were already known), it is the first result which leads to a deterministic primality test requiring only one modular exponentiation similar to that of Fermat’s test modulo N, thus of e O(log2N) complexity. One year after, using the same underlying ideas, Proth proved the following primality criterion for number of the form N=K2n+ 1, where Kis odd and K < 2n(Proth numbers) Theorem 2 (Proth, 1878).Let N=K2n+ 1, where Kis odd and K < 2n. If aN−1 2≡ −1(mod N) for some a∈Z, then Nis prime. The next important step is the following 1914 result by Pocklington (see [17]), which is the first generalization of Proth’s theorem suitable for numbers of the form N=Kpn+ 1: Theorem 3 (Pocklington, 1914).Let N=Kpn+ 1 con K < pn. If, for some a∈Z: i) aN−1≡1(mod N) ii) GCD(aN−1 p−1, N) = 1 Then, Nis prime. Proth and Pocklington results are still useful. In fact they are the base of the popular software created by Yves Gallot’s (Proth.exe) for the search of Proth and generalized Proth (N=Kpn+ 1) primes. Other software based in a variation of Pocklington’s Theorem presented by Brillhart, Lehmer and Selfridge (see [10] or [12]) is OpenPFGW with which some records have been broken in different families 1 2 JOS´ E MAR´ IA GRAU AND ANTONIO M. OLLER-MARC´ EN of integers. For instance, David Broadhurst has recently broken the record for the family N= 2 ·3n+ 1 (sequence A003306 in the OEIS) certifying primality for n= 1175232, a number with 560729 digits and the 87-th biggest known prime (see for instance http://primes.utm.edu/primes/lists/all.txt). An drawback of this software is that it usually requires the use of several bases and, consequently, the computation of several exponentiations modulo N. In recent times the most active researcher looking for primality criteria for numbers of the form N=Kpn+ 1 has been P. Berrizbeitia. Berrizbeitia and his collaborators have found very efficient criteria for this kind of numbers for a variety of primes p(see [5, 6, 7]). Even though similar criteria had been previously presented by H.C. Williams and his collaborators (see [23, 22]), the methodology used by Berrizbeitia et al. shows more clear and efficient. For these generalizations an analogous of Legendre symbol, the the m-th power residue symbol, has been used. It assumes values over the m-th roots of unity and it satisfies a higher order law of reciprocity. However, the use of the m-th power residue symbol present technical difficulties, mainly due to the fact that the ring Z[e2πi/m] is not a UFD in general. Other authors, such A. Guthmann (see [14]) and W. Bosma (see [9]), have also given generalizations of Proth’s theorem using similar techniques but limited to the case p= 3. Our main contribution is a primality criterion for integers of the form N= Kpn+ 1 with pbeing any prime and K < pn, using techniques similar to those in [13] for generalized Cullen Numbers (N=npn+ 1). These techniques do not require the use of any m-th power residue symbol or higher order law of reciprocity. In this way we have achieved an even more clear and efficient methodology than that of Berrizbeitia. In fact, our primality criterion requires only one modular exponentiation aN−1without a previous search of a suitable a. 2. A Generalization of Proth’s theorem The primality test which follows from Proth’s theorem is very useful since, if N=K2n+1 is a prime (Proth Prime), then half the values of asatisfy the condition of the theorem. In particular it is satisfied by those awhich are a quadratic nonresidue modulo N; i.e., such that the Jacobi symbol ( a N) = −1. This observation is captured in the following version of Proth’s theorem: Theorem 4 (Proth, 1878).Let N=K2n+1, where Kis odd and K < 2n. Assume that a∈Zis such that a N=−1, then: Nis a prime if and only if aN−1 2≡ −1(mod N). In spite of the various generalizations presented in the introduction, the most natural generalization of this theorem had not been yet exhibited. We do so in the following result. In what follows Φp(X) will denote the p-th cyclotomic polynomial. Theorem 5. Let N=Kpn+ 1, where pis a prime, K < pnand gcd(K, p) = 1. Assume that a∈Zis a p-th power non-residue, then: Nis a prime if and only if Φp(a N−1 p)≡0(mod N). Proof. If Nis a prime, then aN−1≡1 (mod N). Now, 0 ≡aN−1−1 = (aN−1 p− 1)Φp(aN−1 p) (mod N). Since ais a p-th power non-residue, then aN−1 p−16≡ 0 (mod N) and this implies, Nbeing prime, that Φp(aN−1 p)≡0 (mod N). A PRIMALITY TEST FOR Kpn+ 1 NUMBERS 3 Conversely, assume that Φp(aKpn−1)≡0 (mod N). Put X=aK, then Φp(Xpn−1)≡ 0 (mod N). It follows that Xpn≡1 (mod N). Now, let q≤√Nbe a prime divisor of N, then it also holds that Φp(Xpn−1)≡0 (mod q) and Xpn≡1 (mod q). Thus, the order of Xin Z∗ qis a divisor of pn, but if Xpj≡1 (mod q) with j < n would imply that p= Φp(1) ≡0 (mod q) which is clearly a contradiction. Consequently, the order of Xin Z∗ qis pn. It follows that pn|q−1 and pn< q ≤√Nand then p2n≤N=Kpn+ 1, so pn≤Ka contradiction.  The theorem above can be restated in the following way. Theorem 6. Let N=Kpn+ 1, where pis a prime and gcd(K, p) = 1. If pn> K, then: Φp(aN−1 p)≡0(mod N)⇔Nis prime and ais a p-th power non-residue modulo N. Proof. It is enough to observe that if Φp(aN−1 p)≡0 (mod N), then Nis prime (like in the previous proof) and a6≡ xp(mod N) for, if it was the case, then 0≡Φp(aN−1 p)≡Φp(xN−1)≡Φp(1) = p(mod N); a contradiction.  This result, like Proth’s theorem, is really useful since if Kpn+ 1 is prime, only 1 pof the possible choices for ais a p-th power residue modulo N. Nevertheless, the interest of this result is mainly theoretical as a genuine generalization of Proth’s theorem. An even more useful generalization, not requiring an adequate choice for a, will be presented in forthcoming sections. 3. A generalization of Miller-Rabin primality test The so-called Miller-Rabin probabilistic primality test [20] test applies to integers in the form N=K2n+ 1 (Kodd) and is based in Fermat’s little theorem and in the fact that, the only solutions of x2≡1 (mod p) (pprime) are x≡ ±1 (mod p). In fact we have the following (see [12, Theorem 3.5.1.]): Theorem 7. Let N=K2n+ 1 be prime. If a > 1, then one of the following holds: i) aK≡1(mod N). ii) There exists 0≤j < n such that (aK2j)≡ −1(mod N). This probabilistic test, in spite of being more demanding than Fermat’s test, presents many pseudoprimes (called strong pseudoprimes) and is specially unreliable if nis small. Nevertheless, for big values of n, as in the case of Proth numbers, the test is very reliable and, as we will see in the next section, it allows to certify the primality of the numbers that pass it. We must point out that the generalization of Miller-Rabin test is really simple, even though more than two decades passed by until the first publication in this direction. Berrizbeitia and Berry (see [4]) generalized the Strong Pseudoprime Test introducing the concept ω-prime to base aand more recent work by Berrizbeitia and Olivieri (see [8]) goes in the same direction. Nevertheless, we think that these works do not present a genuine generalization. In fact, Miller-Rabin test admits a very natural generalization for integers in the form N=Kpn+ 1 with pprime, K even and gcd(K, p) = 1. This generalization (that we shall call the p-Miller-Rabin test) is based in the following result: 4 JOS´ E MAR´ IA GRAU AND ANTONIO M. OLLER-MARC´ EN Theorem 8. Let pbe a prime number and Kbe and even number with gcd(K, p) = 1. If N=Kpn+ 1 is prime, then for every integer a > 1such that gcd(a, N) = 1 one of the following holds: i) aK≡1(mod N). ii) There exists 0≤j≤n−1such that Φp(aKpj)≡0(mod N). Proof. If Nis a prime, then aKpn≡1 (mod N). If aK6≡ 1 (mod N), let 1 ≤r≤n be the smallest integer such that aKpr≡1 (mod N). Then aKpr−16≡ 1 (mod N) and the primality of Nimplies that Φp(aKpr−1)≡0 (mod N) as in Theorem 6. It is enough to put j=r−1 to complete the proof.  Definition 1. Ap-strong probable prime to base ais a number satisfying conditions i) and ii) of Theorem 9 for some p, prime divisor of N−1. If it is in fact composite, we will say that it is a p-strong pseudoprime to base a. This generalization of Miller-Rabin test allows to choose the most appropriate prime factor of N−1 in which to base the test. In the case of generalized Proth numbers N=Kpn+ 1 it seems that the prime pshould be the most suitable choice; nevertheless, computational experiments reveal that the number of q-strong pseudoprimes does not depend significantly on the chosen divisor of N−1. Moreover, the classic Miller-Rabin test presents in general less pseudoprimes than the proposed generalization. Nonetheless, this new test can be modified to become a deterministic primality test for Proth numbers (K < 2n) and generalized Proth numbers (N=Kpn+ 1 with K < pn). This modification is the main contribution of this paper and will be developed in the following section. Also, since N−1 will have in general several prime divisors, it makes sense to combine the new test not only using different bases, but also using different prime divisors of N−1. This idea suggests the following definition. Definition 2. Ap-strong probable prime (resp. p-strong pseudoprime) to base a for every pprime divisor of N−1, will be denoted as a complete strong probable prime (resp. complete strong pseudoprime)to base a. Unfortunately, although the concept of complete strong probable prime is more subtle than that of p-strong probable prime, computational evidence suggest that it is more convenient to use the test combining different bases rather than different prime divisors of N−1. To illustrate this statement it is enough to point out that the smallest 2-strong pseudoprime to bases 2 and 3 is 1373653, while there are 10 complete strong pseudoprimes to base 2 smaller than that number; namely: 2047, 3277, 4033, 8321, 65281, 80581, 85489, 88357, 104653 and 130561. 4. A sufficient condition for the primality of generalized Proth numbers. We will now see that passing the p-Miller-Rabin test, together with a bounding condition on j(see Theorem 8), gives a sufficient condition for primality. Theorem 9. Let N=Kpn+ 1 where pis a prime and gcd(K, p) = 1. If there exists 1≤j≤nsuch that: i) Φp(2Kpj−1)≡0(mod N). ii) 2j > logp(K) + n. A PRIMALITY TEST FOR Kpn+ 1 NUMBERS 5 Then Nis prime. Proof. Put X= 2K, then Xpj≡1 (mod N). Let q≤√Nbe a prime divisor of N. It follows that the order of Xin Z∗ qis exactly pj. Consequently pj|q−1 and pj< q ≤√Nfrom which it follows that p2j< N =Kpn+ 1. Finally, if p2j≤Kpn then 2j≤logpK+n; a contradiction and the proof is complete.  Remark 1. The theorem above is still true if we replace 2 by any other base a. It is enough to put X=aKin the proof. Corollary 1. Let N=Kpn+ 1 where pis a prime number with gcd(K, p) = 1. Let us consider the sequence S0= 2K,Si=Sp i−1for all i≥1. If for some j > 1 2(logp(K) + n)it holds that Φp(Sj)≡0(mod N), then Nis prime. If we consider the case p= 2; i.e., the classical Proth numbers, then we get the following corollary. Corollary 2. Let N=K2n+1 with Kan odd integer. Let us consider the sequence S0= 2K,Si=S2 i−1for all i≥1. If for some j > 1 2(log2(K) + n)it holds that Sj≡ −1(mod N), then Nis prime. 5. Algorithm and Computational complexity Since 2004, when the polynomial time AKS algorithm was presented (see [2]), primality algorithms of general nature were ostracized. That was the case of the deterministic primality test running in (log n)O(log log log n)time presented by Adleman, Pomerance and Rumely (see [1]). This algorithm, later improved by Cohen and Lenstra (see [11]), is known as the APRCL algorithm. Nevertheless, and despite being one of the cornerstones of Computational Number Theory, AKS algorithm has not been very useful in practice. This is because numbers for which AKS algorithm is faster than the usual ones are beyond current computation capacity. Even the so-called practical versions of the AKS algorithm (see [3], for instance) are not fast enough. As a consequence, prime “hunters” focus in families of integers for which primality can be determined by useful algorithms. For restricted families of integers much faster algorithms are known, the most celebrated being the Lucas- Lehmer algorithm (see [16]), used for Mersenne Numbers, which runs in ˜ O((log n)2) time. Proth, in [19], gives an algorithm running also in ˜ O(log n)2) time, which applies to numbers such that ν2(n−1) >1 2log2nwhere 2ν2(m)is the biggest power of 2 dividing mand provided an integer ais given such that the Jacobi symbol a n=−1. Proth’s algorithm is not deterministic for every n. Later, Williams [24] or Konyagin and Pomerance [15] have extended these techniques to wider families of integers. Unless a surprising discovery is made, the computational complexity of any primality test has a lower bound given by the complexity of the modular exponentiation required by Fermat’s test. With this idea in mind, the best that a primality test for an integer Ncan do is to run in O(log2(N) log(log(N)) log(log(log(N)))) time. However, even for this complexity, there can be great differences between two different tests depending on the number of modular exponentiations aN−1required. Below we describe an algorithm implementing Corollary 1 which, in fact, requires just one modular exponentiation of the kind aN−1through nmodular exponentiations each of them of complexity O(log(N) log(log(N)) log(log(log(N)))). 6 JOS´ E MAR´ IA GRAU AND ANTONIO M. OLLER-MARC´ EN Algorithm. INPUT: K, p, n, a.; N:= Kpn+ 1. S0:= aK. STEP 1: If S0≡1 (mod N) then RETURN: “Nis a p-strong-probable prime to base a”. STOP. STEP 2: For i= 1 to n Si≡Sp i−1(mod N) If Si≡1 (mod N) and Φp(Si−1)≡0 (mod N) then Let j:=i. GOTO STEP 3 If Si≡1 (mod N) and Φp(Si−1)6≡ 0 (mod N) then RETURN: “Nis COMPOSITE” . STOP End RETURN: “Nis COMPOSITE”. STOP STEP 3: If 2j≤logpK+n then RETURN: “Nis a p-strong-probable prime to base a”. STOP. If 2j > logpK+nRETURN: “Nis PRIME”. STOP. Proposition 1. For N=Kpn+ 1 with fixed Kand p, the complexity of the algorithm above is ˜ O(log2(N). Proof. Only steps 1 and 2 cause complexity, since step 3 is obviously irrelevant. Complexity of steps 1 is that of the modular exponentiation aK(mod N). Taking into account that products modulo Ncan be performed by Schoenhage-Strassen algorithm (see [21]) with complexity: O(log(N) log(log(N)) log(log(log(N)))), this is the complexity of step 1. In step 2 nmodular exponentiation with the same complexity as in step 1 are carried out. Thus, since n= logp(N−1 K), the complexity of this step is: O(log2(N) log(log(N)) log(log(log(N)))). And, summarizing, the whole complexity is ˜ O(log2(N).  For generalized Proth numbers (K < pn). If we consider SJ:= aKpJwhere J:= jlogpK+n 2k, it is easy to see that if SJ6≡ 1 (mod N) then the algorithm always certifies the primality or compositeness of Kpn+ 1. In this case we can consider the following algorithm: Algorithm. INPUT: K, p, n, a.; N:= Kpn+ 1. J:= jlogpK+n 2k.SJ:= aKpJ. STEP 1: If SJ≡1 (mod N) then RETURN: “Nis a p-strong-probable prime to base a”. STOP. else RETURN: “Nwill be certified either as prime or composite”. STEP 2: For i=J+ 1 to n Si≡Sp i−1(mod N) If Si≡1 (mod N) and Φp(Si−1)≡0 (mod N) Then RETURN: “Nis PRIME” Else RETURN: “Nis COMPOSITE” . STOP End RETURN: “Nis COMPOSITE” . STOP A PRIMALITY TEST FOR Kpn+ 1 NUMBERS 7 We will now see that for moderately big values of n, the probability that the algorithm does not certify the primality of a prime of the form N=Kpn+1 without choosing more that one base is extremely small and that it decreases with p. This is not the case for the test based in Pocklington’s theorem since, regardless the value of n, the use of several bases to certify the primality of Nis quite frequent. To do so, we first present a quite well-known lemma. Lemma 1. If N=Kpn+ 1 is prime, the the number of ps-th powers modulo N (different from 0 and 1) is: N−1 ps−1 = Kpn−s−1. With the use of this lemma we can prove the following proposition. Proposition 2. Given a prime N=Kpn+ 1 (K < pn) and a random base 0< a < n, the probability that the algorithm returns “p-strong probable prime” is: Kpjlogp(K)+n 2k−1 Kpn−1. Proof. The algorithm returns “Nis p-strong probable prime” when J:= jlogp(K)+n 2k satisfies that aJ≡1 (mod N). This will happen if ais residual power of order n−J modulo N. But, by the previous lemma, the probability that this happens is: KpJ−1 N−2=Kpjlogp(K)+n 2k−1 Kpn−1.  Remark 2. For big values of nthe probability that a prime of the form N=Kpn+1 is certified as p-strong probable prime is about p−n/2. Steps 1 and 2 in the algorithm perform the computation of the power aN−1 (mod N) in a controlled way in the sense that if some power aKpi≡1 (mod N) the computation stops. Thus, we can say that the computational cost of the algorithm is that of one modular exponentiation of the kind aN−1carried out by nmodular exponentiations taking into account that: akpn= ((ak)p)p(n ···p. Moreover, for values of pwith “many” 1’s or “many” 0’s in its binary expansion (like for Mersenne or Fermat primes), the presented algorithm can use this fact to perform the p-th power in a faster way that with the standard repeat squaring technique; achieving an execution in half the time than the standard modular exponentiation. To sum up, the presented algorithm improves every primality test requiring more than the computation of a power of the kind aN−1(mod N) or similar. It also equals those requiring one such power, even performing better for some particular values of p. 8 JOS´ E MAR´ IA GRAU AND ANTONIO M. OLLER-MARC´ EN 6. Appeal to implementers Although the authors have not implemented the proposed algorithm with an appropriate technology, and using Mathematica R only primes up to 100000 digits have been tested, they are in condition to make some considerations that might encourage implementers to create a software based in this paper. Taking into account that our algorithm requires a number of computations similar to that of Fermat’s test (or even less) we have compared the time required to certify the primality of the four biggest known primes in the family N= 2 ·3n+ 1, recently found by David Broadhurst with the estimated time required by our algorithm. Of course, the runtime of OpenPFGW depends on the “lucky” choice of the bases used to perform Pocklington’s test (namely, the chosen base ashould satisfy gcd(aN−1 P− 1, N) = 1). OpenPFGW also fails when the tested number is a Fermat pseudoprime for several bases (with a resounding failure when it is a Carmichael number), since it is unable to quickly detect the compositeness of these numbers. However, our algorithm would require only one modular exponentiation of the kind aN−1, thus becoming preferable to any other algorithm for generalized Proth numbers. To be true, also our algorithm could require a second choice for the base. But this would happen, for n= 1175232 with probability about 8.25 ×10−280365. In the table below we show the bases used by OpenPFGW (Version 3.4.3) to certify the primality of each N(in one case in needed 7), the runtime in an Intel core2 Duo P7450 @ 2.13 GHz with 4Gb of RAM and the estimated runtime for our algorithm. We also show the ranking of the considered primes among the known primes up to date. All of them are among the 1000 bigger known primes, and the biggest one is among the 100 bigger ones and, remarkably, are among the very few big primes not belonging to the most investigated families: Mersenne, generalized Fermat, Cullen, Woodall, Proth, generalized Cullen and generalized Woodall. It seems to us that the families Kpn+ 1 have not been deeply investigated except for the case p= 2. N= 2 ·3n+ 1, n= 529680 1074726 1086112 1175232 Number of digits 252722 512775 518208 560729 Absolute Ranking 895-th 102-th 101-th 87-th Bases used by OpenPFGW 2,3 2,3,17,23,29,31,41 2 2,3,5 Runtime OpenPFGW (in s.) 1531. 21865. 3220. 14537 Estimated runtime our algorithm 766. 3124. 3220. 4845 We want to stress the importance of take advantage of the structure of Mersenne and Fermat primes in order to reduce the required time for the modular exponentiations in our algorithm. Consider for instance the search for primes of the form K·127n+ 1. Our algorithm requires to perform nmodular exponentiations of the kind b127. For each of them, performed by the standard repeated squaring algorithm 12 modular products are required, but considering that b127 =b128/b only 7 products and a division would be required; a 33% save. More generally, for p= 2s−1 (a Mersenne prime) only sproducts and a division will be required, while the standard method requires 2(s−1) products. Thus, asymptotically, one gets a 50% save. Moreover, even though pis not a Mersenne or Fermat prime, if there are many 1’s or 0’s in the binary expansion of pad hoc strategies can be developed A PRIMALITY TEST FOR Kpn+ 1 NUMBERS 9 in order to optimize the algorithm. This would be the case of primes of the form 2s±2t±1, for instance. Acknowledgments We are grateful to L. M. Pardo Vasallo for his help with computational complexity aspects. We are also grateful to David Broadhurst, who has helped us to better understand the working of OpenPFGW and whose search for primes of the form 2 ·3n+ 1 has allowed us to value our algorithm is a more appropriate way. References [1] Leonard M. Adleman, Carl Pomerance, and Robert S. Rumely. On distinguishing prime numbers from composite numbers. Ann. of Math. (2), 117(1):173–206, 1983. [2] Manindra Agrawal, Neeraj Kayal, and Nitin Saxena. PRIMES is in P. Ann. of Math. (2), 160(2):781–793, 2004. [3] Pedro Berrizbeitia. Sharpening “PRIMES is in P” for a large family of numbers. Math. Comp., 74(252):2043–2059 (electronic), 2005. [4] Pedro Berrizbeitia and T. G. Berry. Cubic reciprocity and generalised Lucas-Lehmer tests for primality of A·3n±1. Proc. Amer. Math. Soc., 127(7):1923–1925, 1999. [5] Pedro Berrizbeitia and T. G. Berry. Generalized strong pseudoprime tests and applications. J. Symbolic Comput., 30(2):151–160, 2000. [6] Pedro Berrizbeitia, T. G. Berry, and Juan Tena-Ayuso. A generalization of Proth’s theorem. Acta Arith., 110(2):107–115, 2003. [7] Pedro Berrizbeitia and Boris Iskra. Deterministic primality test for numbers of the form A2·3n+ 1, n ≥3 odd. Proc. Amer. Math. Soc., 130(2):363–365 (electronic), 2002. [8] Pedro Berrizbeitia and Aurora Olivieri. A generalization of Miller’s primality theorem. Proc. Amer. Math. Soc., 136(9):3095–3104, 2008. [9] Wieb Bosma. Cubic reciprocity and explicit primality tests for h·3k±1. In High primes and misdemeanours: lectures in honour of the 60th birthday of Hugh Cowie Williams, volume 41 of Fields Inst. Commun., pages 77–89. Amer. Math. Soc., Providence, RI, 2004. [10] John Brillhart, D. H. Lehmer, and J. L. Selfridge. New primality criteria and factorizations of 2m±1. Math. Comp., 29:620–647, 1975. [11] H. Cohen and H. W. Lenstra, Jr. Primality testing and Jacobi sums. Math. Comp., 42(165):297–330, 1984. [12] Richard Crandall and Carl Pomerance. Prime numbers. A computational perspective. Springer, New York, second edition, 2005. [13] Jos´e Mar´ıa Grau and Antonio M. Oller-Marc´en. An e O(log2n) time primality test for generalized cullen numbers. Math. Comp., to appear. [14] Andreas Guthmann. Effective primality tests for integers of the forms N=k·3n+ 1 and N=k·2m3n+ 1. BIT, 32(3):529–534, 1992. [15] Sergei Konyagin and Carl Pomerance. On primes recognizable in deterministic polynomial time. In The mathematics of Paul Erd˝os, I, volume 13 of Algorithms Combin., pages 176–198. Springer, Berlin, 1997. [16] ´ Edouard Lucas. Sur la recherche des grands nombres premiers. Assoc. Francaise p. l’Avanc. des Science. Comptes Rendus, (5):61–68, 1876. [17] H. C. Pocklington. The determination of the prime or composite nature of large numbers by fermat’s theorem. Proc. Cambridge Philos. Soc., 18:29–30, 1914. [18] Th´eophile P´epin. Sur la formule 22n+ 1. C. R. Acad. Sci. Paris, 85:329–331, 1877. [19] Fran¸cois Proth. Th´eor`emes sur les nombre premiers. C. R. Acad. Sci. Paris, 87:926, 1878. [20] Michael O. Rabin. Probabilistic algorithm for testing primality. J. Number Theory, 12(1):128– 138, 1980. [21] A. Sch¨onhage and V. Strassen. Schnelle Multiplikation grosser Zahlen. Computing (Arch. Elektron. Rechnen), 7:281–292, 1971. [22] H. C. Williams. A note on the primality of 62n+1 and 102n+1. Fibonacci Quart., 26(4):296– 305, 1988. [23] H. C. Williams and C. R. Zarnke. Some prime numbers of the forms 2A3n+ 1 and 2A3n−1. Math. Comp., 26:995–998, 1972.