Miller's primality test applies to an odd integer . Write
, where
is odd. The test checks a base
with
.
The base passes if
or
for some
. Otherwise,
is a witness to the compositeness
of
.
A composite number that passes is called a strong pseudoprime to base
. There is no analog of Carmichael
numbers for strong pseudoprimes.
The smallest numbers that are strong pseudoprimes to base 2, 3, 5, and 7 (and would hence fail a test based on these bases) are 3215031751, 118670087467, 307768373641, 315962312077, ... (OEIS A074773; Jaeschke 1993).
Miller (1976) showed that any composite has a witness
less than
if the generalized Riemann hypothesis
is true. Rabin's randomized version chooses bases independently and uniformly (Rabin
1980). Since at most one quarter of the admissible bases are strong liars for any
odd composite
,
independent rounds have error probability
at most
.
This randomized algorithm is commonly called the Miller-Rabin primality test.