Solovay-Strassen test
It is known that an odd number n is prime if and only if for every 1<a<n such that (a,n)=1 we have
(1) |
where is the Jacobi symbol. (The only if part is obvious; the if part follows from Theorem 1.) From this we can derive the following algorithm
.
-
1.
Choose a random number between and .
-
2.
Check if (for example using the Euclidean algorithm
). If it is not, then is not prime and is a divisor
of .
- 3.
By repeating this algorithm we can increase the chance that the result is correct. In order to estimate the probability of error, we make use of Theorem 1, which says that every independent iteration of the algorithm has a chance of at most of being wrong. Hence, after iterations there is at most a chance of getting a wrong result.
Theorem 1.
Proof.
It suffices to exhibit one element which does not satisfy Equation (1). Indeed, if there exists one such element, then the set of
all elements which do satisfy Equation (1) forms a proper subgroup of , from which we
conclude that the elements satisfying Equation (1) number no more than half of the elements
of .
We consider separately the cases where is squarefree and not
squarefree. If is squarefree, let be a prime dividing and
let be a quadratic non-residue mod . Using the Chinese
Remainder Theorem
, choose an integer such that:
The Jacobi symbol is given by
We will assume that and derive
a contradiction. The equation
implies that .
However, since , we must have
, so that , which is a contradiction.
Now suppose that is not squarefree. Let be a prime such that
, and set . By the binomial theorem,
we have
so the multiplicative order of is equal to , and hence
in particular , since . On the
other hand,
so does not satisfy Equation (1). ∎
Title | Solovay-Strassen test |
---|---|
Canonical name | SolovayStrassenTest |
Date of creation | 2013-03-22 14:27:33 |
Last modified on | 2013-03-22 14:27:33 |
Owner | mathwizard (128) |
Last modified by | mathwizard (128) |
Numerical id | 7 |
Author | mathwizard (128) |
Entry type | Algorithm |
Classification | msc 11Y11 |
Related topic | MillerRabinPrimeTest |