## Some Primality Testing Algorithms (1993)

Venue: | Notices of the AMS |

Citations: | 3 - 0 self |

### BibTeX

@ARTICLE{Pinch93someprimality,

author = {R.G.E. Pinch},

title = {Some Primality Testing Algorithms},

journal = {Notices of the AMS},

year = {1993},

volume = {40},

pages = {1203--1210}

}

### OpenURL

### Abstract

We describe the primality testing algorithms in use in some popular computer algebra systems, and give some examples where they break down in practice. 1 Introduction In recent years, fast primality testing algorithms have been a popular subject of research and some of the modern methods are now incorporated in computer algebra systems (CAS) as standard. In this review I give some details of the implementations of these algorithms and a number of examples where the algorithms prove inadequate. The algebra systems reviewed are Mathematica, Maple V, Axiom and Pari/GP. The versions we were able to use were Mathematica 2.1 for Sparc, copyright dates 1988-1992; Maple V Release 2, copyright dates 1981-1993; Axiom Release 1.2 (version of February 18, 1993); Pari/GP 1.37.3 (Sparc version, dated November 23, 1992). The tests were performed on Sparc workstations. Primality testing is a large and growing area of research. For further reading and comprehensive bibliographies, the interested re...

### Citations

687 |
Mathematica-a system for doing mathematics by computer. 2nd ed
- Wolfram
(Show Context)
Citation Context ...he Mathematica version 2 number theoretic functions are reviewed by Wagon [47] (who discusses version 1 functions in [46] x1.1). The Mathematica built-in primality test PrimeQ is described briefly in =-=[48]-=- (first edition) PrimeQ[expr] yields True if expr is a prime number and yields False otherwise. and less tersely in the on-line documentation PrimeQ[expr] yields True if expr is a prime number, and yi... |

273 |
The Art. of Computer Programming - Seminumerical Algorithms, vol.2
- Knuth
- 1981
(Show Context)
Citation Context ...lity testing is a large and growing area of research. For further reading and comprehensive bibliographies, the interested reader could consult the works of Bressoud [13], Brillhart et al [14], Knuth =-=[27]-=-, Koblitz [28], Ribenboim [43][44] or Riesel [45]. 2 Primality tests The first and most obvious test is trial division: that is, given an integer n, try all integers from 2 up to p n to see whether an... |

225 |
Riemann’s hypothesis and tests for primality
- Miller
- 1975
(Show Context)
Citation Context ...1)=2 j \Sigma1 mod n. This further requirement we call the Fermat--Euler test (although the result was already known to Fermat): Lehmann [29]. Iterating, we arrive at the strong or Miller--Rabin test =-=[30]-=-[31][42]. Write n \Gamma 1 = 2 r s, where s is odd. For base a, form the Miller--Rabin sequence a s ; a 2s ; : : : ; a 2 r\Gamma1 s j a n\Gamma1 2 ; a 2 r s j a n\Gamma1 mod n 1 Students of the Englis... |

198 |
Probabilistic Algorithm for Testing Primality
- Rabin
- 1980
(Show Context)
Citation Context ...Sigma1 mod n. This further requirement we call the Fermat--Euler test (although the result was already known to Fermat): Lehmann [29]. Iterating, we arrive at the strong or Miller--Rabin test [30][31]=-=[42]-=-. Write n \Gamma 1 = 2 r s, where s is odd. For base a, form the Miller--Rabin sequence a s ; a 2s ; : : : ; a 2 r\Gamma1 s j a n\Gamma1 2 ; a 2 r s j a n\Gamma1 mod n 1 Students of the English legal ... |

175 | Elliptic Curves and Primality Proving
- Atkin, Morain
- 1993
(Show Context)
Citation Context ...cribed depends on the factorisation of n \Gamma 1. In cases where this is difficult, one can work in a suitable quadratic extension (as in the Lucas method) and instead try to factorise n + 1. Morain =-=[6]-=-[7][32][33] suggested replacing these multiplicative groups by the group of points on an elliptic curve modulo n, which can have any order between n + 1 \Sigma 2 p n when n is prime. The order of this... |

149 |
The Book of Prime Number Records
- Ribenboim
- 1988
(Show Context)
Citation Context ...owing area of research. For further reading and comprehensive bibliographies, the interested reader could consult the works of Bressoud [13], Brillhart et al [14], Knuth [27], Koblitz [28], Ribenboim =-=[43]-=-[44] or Riesel [45]. 2 Primality tests The first and most obvious test is trial division: that is, given an integer n, try all integers from 2 up to p n to see whether any are factors of n. If one is ... |

97 |
R.S.: Axiom: The Scientific Computation System
- Jenks, Sutor
- 1992
(Show Context)
Citation Context ...e the anomalies in ProvablePrimeQ are being looked into (the one has been fixed already)." 9 The Axiom prime? function The Axiom package IntegerPrimesPackage includes the function prime? describe=-=d in [25]-=- x9.30.2, p.384, as The operation prime? returns true or false depending on whether its argument is a prime. There is greater detail documented in the source code: prime?(n) returns true if n is prime... |

94 |
Maple V Language Reference Manual
- CHAR, GEDDES, et al.
(Show Context)
Citation Context ... [5][3][4], Bleichenbacher [10][11], and Davenport [20][21]. 5 7 The Maple isprime function Maple V provides a function isprime, (also invoked as type/primeint). The Maple V language reference manual =-=[16]-=- x1.2, p.7 simply asserts that Maple can test integers for primality. The Maple library reference manual [17] x2.1.164, p.120 and the on-line documentation state isprime (n, iter) The function isprime... |

87 |
Every prime has a succinct certificate
- Pratt
- 1975
(Show Context)
Citation Context ...quire a certificate that the factors of n \Gamma 1 are themselves prime and so the certification will be recursive: Atkin has called this "Downrun". Verification of the certificate is fast: =-=see Pratt [41]-=-. This proof method works well on numbers of special form, for example, n \Gamma 1 = 2 r s with s ! 2 r . Suppose that a 2 r\Gamma1 j \Gamma1 mod n. Then if n is composite, take p to be the smallest p... |

78 | C.: There are infinitely many Carmichael numbers
- Alford, Granville, et al.
- 1994
(Show Context)
Citation Context ...Gamma1 j 1 mod n for every base a which is coprime to n. Such an n is called an absolute Fermat pseudoprime, or a Carmichael number, and it has recently been proved by Alford, Granville and Pomerance =-=[1]-=- that there are infinitely many Carmichael numbers --- see Granville's survey article [22] . Carmichael numbers are of course less numerous than Fermat pseudoprimes to any fixed base: letting C(X) den... |

75 |
Prime Numbers and Computer Methods for Factorization
- Riesel
- 1994
(Show Context)
Citation Context ...rch. For further reading and comprehensive bibliographies, the interested reader could consult the works of Bressoud [13], Brillhart et al [14], Knuth [27], Koblitz [28], Ribenboim [43][44] or Riesel =-=[45]-=-. 2 Primality tests The first and most obvious test is trial division: that is, given an integer n, try all integers from 2 up to p n to see whether any are factors of n. If one is found, then n is co... |

73 |
Explicit bounds for primality testing and related problems
- Bach
- 1990
(Show Context)
Citation Context ...e.) Miller [30][31] observed that a theorem of Ankeney [2] could be applied to turn the strong test into a conditional polynomial-time characterisation of primes: the quantitative version due to Bach =-=[8]-=- states that provided a suitable generalisation of the Riemann hypothesis (GRH) holds, a number n is prime iff it passes the strong test to all bases a with 1 ! as2(log n) 2 . If one does not assume t... |

40 |
Factorization and Primality Testing
- Bressoud
- 1989
(Show Context)
Citation Context ...ormed on Sparc workstations. Primality testing is a large and growing area of research. For further reading and comprehensive bibliographies, the interested reader could consult the works of Bressoud =-=[13]-=-, Brillhart et al [14], Knuth [27], Koblitz [28], Ribenboim [43][44] or Riesel [45]. 2 Primality tests The first and most obvious test is trial division: that is, given an integer n, try all integers ... |

36 |
The distribution of quadratic residues and non-residues
- Burgess
- 1957
(Show Context)
Citation Context ... generalisation of the Riemann hypothesis (GRH) holds, a number n is prime iff it passes the strong test to all bases a with 1 ! as2(log n) 2 . If one does not assume the GRH then a result of Burgess =-=[15]-=- implies that testing up to n :134 is sufficient. In the opposite direction, it follows from the result of Alford, Granville and Pomerance [1][22] that there are infinitely many numbers which are stro... |

33 |
The least quadratic non residue
- Ankeny
- 1952
(Show Context)
Citation Context ...it passes the strong test to at most 1=4 of the bases a mod n. (Thus composite numbers can be detected in random non-deterministic polynomial time.) Miller [30][31] observed that a theorem of Ankeney =-=[2]-=- could be applied to turn the strong test into a conditional polynomial-time characterisation of primes: the quantitative version due to Bach [8] states that provided a suitable generalisation of the ... |

33 |
Average Case Error Estimates for the Strong Probable Prime Test
- Damgård, Landrock, et al.
- 1993
(Show Context)
Citation Context ...ion on the input numbers n. If, for example, we assume that n is distributed uniformly over all k-bit odd integers, then it can be shown, using the methods of Kim, Pomerance, Damgard and Landrock [18]=-=[19]-=-[26] that for ks100 and 5stsk=9 + 2, prob (n is compositejn passes t rounds)s0:4 k2 t i 0:6 \Delta 2 \Gamma2 p k(t\Gamma2) + 2 \Gammat p k=2 j ; and for t ? k=9 + 2, prob (n is compositejn passes t ro... |

33 |
Theory
- Number
- 1983
(Show Context)
Citation Context ...at he plans to include a stronger version of isprime in a new release. 8 The Mathematica PrimeQ and ProvablePrimeQ functions The Mathematica version 2 number theoretic functions are reviewed by Wagon =-=[47]-=- (who discusses version 1 functions in [46] x1.1). The Mathematica built-in primality test PrimeQ is described briefly in [48] (first edition) PrimeQ[expr] yields True if expr is a prime number and yi... |

27 |
User’s guide to PARIGP
- Batut, Belabas, et al.
- 1997
(Show Context)
Citation Context ...oned has been corrected, and that a new version of isprime? will use an improved test. 10 The Pari/GP ispsp and isprime functions The Pari ispsp and isprime functions are described in the user manual =-=[9]-=- and the on-line documentation: ispsp(x): true (1) if x is a strong pseudo-prime for a randomly chosen base, false (0) otherwise. isprime(x): true (1) if x is a strong pseudo-prime for 10 randomly cho... |

23 | On the Distribution of Pseudoprimes - Pomerance - 1981 |

15 |
reference manual
- Maple
(Show Context)
Citation Context ...a function isprime, (also invoked as type/primeint). The Maple V language reference manual [16] x1.2, p.7 simply asserts that Maple can test integers for primality. The Maple library reference manual =-=[17]-=- x2.1.164, p.120 and the on-line documentation state isprime (n, iter) The function isprime is a probabilistic primality testing routine. It returns false if n is shown to be composite within iter tes... |

10 |
A Course in Number Theory and Cryptography, GTM 114
- Koblitz
- 1987
(Show Context)
Citation Context ...s a large and growing area of research. For further reading and comprehensive bibliographies, the interested reader could consult the works of Bressoud [13], Brillhart et al [14], Knuth [27], Koblitz =-=[28]-=-, Ribenboim [43][44] or Riesel [45]. 2 Primality tests The first and most obvious test is trial division: that is, given an integer n, try all integers from 2 up to p n to see whether any are factors ... |

8 |
jr, The pseudoprimes up to 25.10
- Pomerance, Selfridge, et al.
- 1980
(Show Context)
Citation Context ...t c. We should note that finding a quadratic non-residue is not guaranteed to be easy: the best results are those of Bach (on the GRH) and Burgess (unconditionally) mentioned above. 4 Pomerance et al =-=[40]-=- describe two methods of finding a suitable d and element ff. They have issued a challenge (with a total prize now $620) for an example of a composite number which passes both the strong test base 2 a... |

7 | Primality testing revisited
- Davenport
- 1992
(Show Context)
Citation Context ...primes base two [34][37], and the third, Z, was a "zoo" of special cases specifically intended to defeat various tests, largely obtained from Arnault [5][3][4], Bleichenbacher [10][11], and =-=Davenport [20]-=-[21]. 5 7 The Maple isprime function Maple V provides a function isprime, (also invoked as type/primeint). The Maple V language reference manual [16] x1.2, p.7 simply asserts that Maple can test integ... |

7 |
The probability that a random probable prime is composite
- Kim, Pomerance
- 1989
(Show Context)
Citation Context ...on the input numbers n. If, for example, we assume that n is distributed uniformly over all k-bit odd integers, then it can be shown, using the methods of Kim, Pomerance, Damgard and Landrock [18][19]=-=[26]-=- that for ks100 and 5stsk=9 + 2, prob (n is compositejn passes t rounds)s0:4 k2 t i 0:6 \Delta 2 \Gamma2 p k(t\Gamma2) + 2 \Gammat p k=2 j ; and for t ? k=9 + 2, prob (n is compositejn passes t rounds... |

7 |
Mathematica in Action
- Wagon
- 1999
(Show Context)
Citation Context ...f isprime in a new release. 8 The Mathematica PrimeQ and ProvablePrimeQ functions The Mathematica version 2 number theoretic functions are reviewed by Wagon [47] (who discusses version 1 functions in =-=[46]-=- x1.1). The Mathematica built-in primality test PrimeQ is described briefly in [48] (first edition) PrimeQ[expr] yields True if expr is a prime number and yields False otherwise. and less tersely in t... |

6 |
Primality Testing and Carmichael Numbers
- Granville
- 1992
(Show Context)
Citation Context ...Fermat pseudoprime, or a Carmichael number, and it has recently been proved by Alford, Granville and Pomerance [1] that there are infinitely many Carmichael numbers --- see Granville's survey article =-=[22]-=- . Carmichael numbers are of course less numerous than Fermat pseudoprimes to any fixed base: letting C(X) denote the number of Carmichael numbers up to X, we have [1] , [38] X 2=7sC(X)sXL(X) and for ... |

5 |
Improved Bounds for the Rabin Primality Test," Cryptography and Coding
- Damgård, Landrock
- 1993
(Show Context)
Citation Context ...ibution on the input numbers n. If, for example, we assume that n is distributed uniformly over all k-bit odd integers, then it can be shown, using the methods of Kim, Pomerance, Damgard and Landrock =-=[18]-=-[19][26] that for ks100 and 5stsk=9 + 2, prob (n is compositejn passes t rounds)s0:4 k2 t i 0:6 \Delta 2 \Gamma2 p k(t\Gamma2) + 2 \Gammat p k=2 j ; and for t ? k=9 + 2, prob (n is compositejn passes ... |

4 |
Le test de primalite de Rabin-Miller: Un nombre compose qui le passe
- Arnault
- 1991
(Show Context)
Citation Context ...second, Y, was that of the 264239 Fermat pseudoprimes base two [34][37], and the third, Z, was a "zoo" of special cases specifically intended to defeat various tests, largely obtained from A=-=rnault [5][3]-=-[4], Bleichenbacher [10][11], and Davenport [20][21]. 5 7 The Maple isprime function Maple V provides a function isprime, (also invoked as type/primeint). The Maple V language reference manual [16] x1... |

4 |
Hypothesis and tests for Primality
- Riemann’s
- 1976
(Show Context)
Citation Context ... j \Sigma1 mod n. This further requirement we call the Fermat--Euler test (although the result was already known to Fermat): Lehmann [29]. Iterating, we arrive at the strong or Miller--Rabin test [30]=-=[31]-=-[42]. Write n \Gamma 1 = 2 r s, where s is odd. For base a, form the Miller--Rabin sequence a s ; a 2s ; : : : ; a 2 r\Gamma1 s j a n\Gamma1 2 ; a 2 r s j a n\Gamma1 mod n 1 Students of the English le... |

4 |
The pseudoprimes up to 10
- Pinch
- 1992
(Show Context)
Citation Context ...ber which passes both the strong test base 2 and one of the versions of the Lucas test they propose, or for a proof that no such number exists. At present, the prize is unclaimed: the computations of =-=[34]-=-[37] show there is no such number less than 10 13 . 4 Primality proofs The probable-prime tests we have described all test for properties which n must have it is prime. Hence the failure of any of the... |

3 |
jr, Factorizations of b n \Sigma 1
- Brillhart, Lehmer, et al.
- 1988
(Show Context)
Citation Context ...tions. Primality testing is a large and growing area of research. For further reading and comprehensive bibliographies, the interested reader could consult the works of Bressoud [13], Brillhart et al =-=[14]-=-, Knuth [27], Koblitz [28], Ribenboim [43][44] or Riesel [45]. 2 Primality tests The first and most obvious test is trial division: that is, given an integer n, try all integers from 2 up to p n to se... |

3 |
Distributed primality proving and the primality of
- Morain
- 1989
(Show Context)
Citation Context ... depends on the factorisation of n \Gamma 1. In cases where this is difficult, one can work in a suitable quadratic extension (as in the Lucas method) and instead try to factorise n + 1. Morain [6][7]=-=[32]-=-[33] suggested replacing these multiplicative groups by the group of points on an elliptic curve modulo n, which can have any order between n + 1 \Sigma 2 p n when n is prime. The order of this group ... |

2 |
Guide to standard mathematica packages
- unknown authors
- 1991
(Show Context)
Citation Context ...re incorrect. The value True is returned if the argument is a probable prime, and there are at least two pseudoprimes which it fails to detect. Finally, it appears from the more extensive description =-=[12]-=- below that the algorithm is in fact deterministic. (Perhaps the documenter confused a probable-prime test with a probable prime-test.) In Mathematica 2.0, the built-in function PrimeQ uses the Rabin ... |

2 |
On primality tests
- Lehman
- 1982
(Show Context)
Citation Context ... then a n\Gamma1 j 1 is a square, so we require that a (n\Gamma1)=2 j \Sigma1 mod n. This further requirement we call the Fermat--Euler test (although the result was already known to Fermat): Lehmann =-=[29]-=-. Iterating, we arrive at the strong or Miller--Rabin test [30][31][42]. Write n \Gamma 1 = 2 r s, where s is odd. For base a, form the Miller--Rabin sequence a s ; a 2s ; : : : ; a 2 r\Gamma1 s j a n... |

1 |
primality test: composite numbers which pass it, Preprint, Universit 'e de Poitiers
- Rabin--miller
- 1992
(Show Context)
Citation Context ...ond, Y, was that of the 264239 Fermat pseudoprimes base two [34][37], and the third, Z, was a "zoo" of special cases specifically intended to defeat various tests, largely obtained from Arna=-=ult [5][3][4]-=-, Bleichenbacher [10][11], and Davenport [20][21]. 5 7 The Maple isprime function Maple V provides a function isprime, (also invoked as type/primeint). The Maple V language reference manual [16] x1.2,... |

1 |
fortement pseudo-premiers, pseudo-premiers de lucas, Preprint 73, Universit'e de
- Carmichaels
- 1993
(Show Context)
Citation Context ...he second, Y, was that of the 264239 Fermat pseudoprimes base two [34][37], and the third, Z, was a "zoo" of special cases specifically intended to defeat various tests, largely obtained fro=-=m Arnault [5]-=-[3][4], Bleichenbacher [10][11], and Davenport [20][21]. 5 7 The Maple isprime function Maple V provides a function isprime, (also invoked as type/primeint). The Maple V language reference manual [16]... |

1 |
Re: Pseudoprimes too strong for maple, Usenet sci.math posting 1993Apr27.141249.29080 neptune.inf.ethz.ch
- Bleichenbacher
- 1993
(Show Context)
Citation Context ...the 264239 Fermat pseudoprimes base two [34][37], and the third, Z, was a "zoo" of special cases specifically intended to defeat various tests, largely obtained from Arnault [5][3][4], Bleic=-=henbacher [10]-=-[11], and Davenport [20][21]. 5 7 The Maple isprime function Maple V provides a function isprime, (also invoked as type/primeint). The Maple V language reference manual [16] x1.2, p.7 simply asserts t... |

1 |
Finding all strong pseudoprimes x, Extended abstract
- Bleichenbacher, Maurer
- 1993
(Show Context)
Citation Context ...rimes for a fixed base a up to X, P MR;a (X) is bounded above by P F;a (X), but the best upper bound known is no better than that implied by the upper bound for P F;a (X) above. For X = 10 13 we have =-=[11]-=-, [37] P MR;2 (X) = 58897. As with the Fermat test, the strong test with a single base does not characterise primes: for example, if n = 2047 = 23 \Theta 89, then n \Gamma 1 = 2 1 :1023 and the Miller... |

1 |
primality proving and the primality of \Gamma + 1 \Delta =3, Advances in cryptology --- Eurocrypt '90
- Distributed
- 1991
(Show Context)
Citation Context ...ends on the factorisation of n \Gamma 1. In cases where this is difficult, one can work in a suitable quadratic extension (as in the Lucas method) and instead try to factorise n + 1. Morain [6][7][32]=-=[33]-=- suggested replacing these multiplicative groups by the group of points on an elliptic curve modulo n, which can have any order between n + 1 \Sigma 2 p n when n is prime. The order of this group is d... |