Bill Allombert on Mon, 08 Jul 2024 14:51:33 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Are there known false positives for GP ispseudoprime() ?


On Mon, Jul 08, 2024 at 01:11:32PM +0200, hermann@stamm-wilbrandt.de wrote:
> Are there known non-prime numbers where GP ispseudoprime returns 1
> without passing flag?

No. The doc says:

   There  are  no known composite numbers passing the above test,  although it is expected that infinitely many such numbers exist.   In
   particular,   all  composites  <= 2^{64} are correctly detected  (checked using
   http://www.cecm.sfu.ca/Pseudoprimes/index-2-to-64.html).

> Or with other flag values?

Yes, but they depend on the random seed;

? for(N=1,oo,setrand(1);if(ispseudoprime(N,1)&&!isprime(N),return(N)))
%22 = 51
? for(N=1,oo,setrand(1);if(ispseudoprime(N,2)&&!isprime(N),return(N)))
%23 = 949
? for(N=1,oo,setrand(1);if(ispseudoprime(N,3)&&!isprime(N),return(N)))
%24 = 22028203

Cheers,
Bill.