What set of witnesses is sufficient for the Miller-Rabin test to be correct for all numbers up to 10¹⁸? I know that use of primes up to 17 as witnesses suffices for n < 341550071728321.
Asked
Active
Viewed 479 times
3 Answers
2
According to this record page, the set of 7 SPRP bases: {2, 325, 9375, 28178, 450775, 9780504, 1795265022}
is sufficient for a deterministic test to at least n = 2^64 ( > 10^19)
.

Brett Hale
- 21,653
- 2
- 61
- 90
0
If you're willing to use a Baillie-Wagstaff test instead of a Miller-Rabin test, it has been certified to be error-free in classifying primes up to 2^64. The coding is not much more complicated, the function executes more quickly than a Miller-Rabin test, and there are no known errors of classification.

user448810
- 17,381
- 4
- 34
- 59
-
1This should be a comment, not an answer. – kinokijuf Mar 05 '14 at 16:34