Miller-Rabin

paul zimmermann Paul.Zimmermann at inria.fr
Tue Mar 27 07:36:58 UTC 2018


       Niels,

>   int
>   mpz_miller_rabin_uis (mpz_srcptr n, size_t count, unsigned long *bases);

this interface would be nice for me. I don't think a bignum base is necessary,
unless you use REDC in powm, in which case (for n having at least 2 limbs) it
might be faster to use a base b such that b*R mod n is small, where R is the REDC
multiplier.

> Out of curiosity, are any similar results known when using bases given
> by Euler's polynomial,
> 
>   a_j = j^2 + j + 41, 
> 
> with the curious property that j_40 = 41^2 is the first composite in the sequence?

a quick test shows that n=21 already requires 3 bases, like 764941, 1004653...

Paul


More information about the gmp-devel mailing list