0
$\begingroup$

Miller-Rabin primality test can be made deterministic when the number $n$ is small, for example "if $n < 2047$, it is enough to test [with base] $a = 2$".

How are those bases found? By brute force? Say I pick an upper bound 2047 and test many different bases to see if any of them always returns correct primality outcomes?

$\endgroup$
  • 1
    $\begingroup$ May be Finding primes & proving primality and the listed references help; especially Jaeschke's paper On strong pseudoprimes to several bases $\endgroup$ – gammatester Nov 30 '18 at 19:17
  • 1
    $\begingroup$ The Wikipedia references are much more up to date than the primes.utm page, but certainly the basic references such as Jaeschke are worthwhile as they go into detail about the mathematics (not relying on exhaustive testing). For the efficient deterministic bases, somewhere past 32-bit they rely on the Feitsma/Galway enumeration of all base-2 strong pseudoprimes to get deterministic results for 64-bit inputs, which makes searches practical. $\endgroup$ – DanaJ Nov 30 '18 at 19:50
1
$\begingroup$

You do it the other way round. You give a set of bases that are tested and look which composites pass the test based on this set.

In particular interesting is the smallest composite number passing the test.

If the set is, for example {$2,3$}, the smallest counterexample is $$1373653$$ Hence we can say : If $n<1373653$ and $n$ is a strong Fermat-pseudoprime to bases $2$ and $3$ , then $n$ is prime.

The poulet-numbers are calculated upto a large limit, using these numbers we can (assuming that the set contains $2$) accelerate the search dramatically, but since the poulet-numbers were basically found by brute force, there is probably no better method to find the smallest counterexamples (or good base-combinations with a large smallest counter-example) than brute force.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.