Random Prime Generator/Modular Arithmetic

Bryan Olson fakeaddress at nowhere.org
Mon Mar 6 02:47:46 CET 2006


Tuvas wrote:
[...]
> Actually, I did another test, and realized that it was indeed a bug in
> the code. Yikes. Oh well, thanks for the help in identifying it!
> 
> An example that would be alot easier is this:
> 
>>>>Mod(16,561).is_strong_pseudo_prime()
> 
> True

Hmmm...my M-R tester disagrees...

Ah, there's another bug in is_strong_pseudo_prime().
While your exponent 'x' is even, you do the test with x,
not necessarily x/2.

Incidentally, the lowest base for which 561 is strongly
pseudo-prime is 50.


-- 
--Bryan



More information about the Python-list mailing list