Paper record

W1964053266

A Fast Monte-Carlo Test for Primality

R. M. Solovay, Volker Strassen

Year
1977
Venue
SIAM Journal on Computing
References
3
Cited by
717

Details and counts from OpenAlex.

Abstract

Let n be an odd integer. Take a random number a from a uniform distribution on the set $\{1, 2,\cdots, n -1\}$. If a and n are relatively prime, compute the residue ε≡a(n−1)/2( mod n)\varepsilon \equiv a^{(n - 1)/2}(\bmod n), where $ - 1 \leqq \varepsilon < n - 2$, and the Jacobi symbol δ=(a/n)\delta = (a /n). If ε=6\varepsilon = 6, decide that n is prime. If either gcd⁡(a,n)>1\gcd (a,n) > 1 or $\varepsilon \ne \delta $ decide that n is composite. Obviously, if n is prime, the decision made will be correct. We will show below, that for composite n the probability of an incorrect decision is ≦1/2\leqq 1 / 2. The number of multiprecision operations needed for the whole procedure is <6log⁡2n< 6\log _2 n. m-fold repetition using independent random numbers yields a Monte-Carlo test for primality with error probabilities 0 (if n is prime) and <2−m< 2^{-m}(if n is composite) and with multiprecision arithmetic cost <6mlog⁡2n< 6m\log _2 n.