[Jprogramming] bug i "q:"?

Roger Hui rhui000 at shaw.ca
Mon Nov 24 13:04:45 HKT 2008


Fixed for the next release.  Thank you for finding
and reporting this error.

By the way, Miller-Rabin is useful even for
numbers less than 2^31.  To test n=._1+2^31 for
primality by trial division requires _1 p: %:n
(4792) divisions.  By (deterministic) Miller-Rabin,
only 3 witnesses (2 7 61) are required.



----- Original Message -----
From: Devon McCormick <devonmcc at gmail.com>
Date: Sunday, November 23, 2008 19:36
Subject: [Jprogramming] bug i "q:"?
To: J-programming forum <programming at jsoftware.com>

> for
> 
>    q: 1610612736
> 
> I get
> 
> 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0
> 
> which is evidently incorrect.  I notice that
> 
>    2^.1610612736
> 30.584963
> 
> so this should avoid any Miller-Rabin trickery.


More information about the Programming mailing list