Generating false positives to the Rabin-Miller primality test

1.7k Views Asked by At

For what composite numbers $x$ will $a^{x-1} \equiv 1 \pmod x$ for $a \in [2,n]$?

Can we generate $x$s that give false positives to the Rabin-Miller test for the first, say 10, consecutive integers $a > 1$?

1

There are 1 best solutions below

4
On BEST ANSWER

Edited to add: This is actually two different questions, as DanaJ points out in a comment. The Rabin-Miller test is more stringent than simply requiring that $a^{x-1}\equiv 1$ (mod $x$).

Original answer: Yes we can! Any Carmichael number whose smallest prime factor is $\ge 13$ wil do. For instance, $294409 = 37 \times 73 \times 109$, which gives false positives for all $a < 37$. I think the smallest such Carmichael number is $29341 = 13 \times 37 \times 61$, which I found in this paper by G.J.O. Jameson. See the Wikipedia article on Carmichael numbers for more information.