## 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

619 |
Mathematica: A System for Doing Mathematics by Computer �Addison-Wesley
- Wolfram
- 1988
(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... |

255 |
The Art of Computer Programming, Seminumerical Algorithms Volume 2, third edition
- Knuth
- 1998
(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... |

207 |
Riemann’s hypothesis and tests for primality
- Miller
- 1976
(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... |

190 |
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 ... |

162 | Elliptic curves and primality proving
- Atkin, Morain
(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... |

132 |
The New Book of Prime Number Records
- Ribenboim
- 1999
(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 ... |

93 |
The scientific computation system
- Jenks, Sutor, et al.
- 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... |

86 |
Maple V Language Reference Manual
- Char
- 1991
(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... |

83 |
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... |

71 | 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... |

70 |
Prime Numbers and Computer Methods for Factorization
- Riesel
- 1985
(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... |

66 |
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... |

36 |
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 ... |

35 |
The distribution of quadratic residues and non-residues
- Burgess
(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 |
Average case error estimates for the strong probable prime test
- Landrock, Pomerance
(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... |

29 |
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 ... |

29 |
Theory
- McClellan, Rader
- 1979
(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 PARI-GP, by
- 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... |

20 | On the distribution of pseudoprimes - Pomerance - 1981 |

11 |
Language Reference Manual
- Maple
- 1991
(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... |

9 |
A Course in Number Theory and Cryptography (Graduate Texts
- Koblitz
- 1994
(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 |
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... |

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 ... |

5 | 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... |

5 |
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 |
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... |

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... |