Loading ...
Sorry, an error occurred while loading the content.

Re: [PrimeNumbers] testing if 32 bit integer is prime number

Expand Messages
  • Phil Carmody
    ... Good suggestion. Ready-made source code, by Professor Caldwell, in JavaScript, can be found at
    Message 1 of 5 , Oct 2, 2001
    • 0 Attachment
      On Tue, 02 October 2001, "James Thoms" wrote:
      > May I suggest that you use strong pseudoprimes as described in
      > http://www.utm.edu/research/primes/prove/prove2_3.html
      > It may seem a bit more complex then the other methods, but requires almost
      > no storage space and shouldn't be TOO difficult to implement. Specifically,
      > you can use other people's work to reduce your workload by using bases 2, 7
      > and 61, which can verify a number to be prime if it is less than 4759123141
      > (more than 32 bits). Bitshifting can be used to take care of any necessary
      > divisions by two and the modulus and exponentiation algorithms won't be very
      > hard to implement in assembly (you would probably need a modulus or
      > equivalent function for trial divisions anyway). At the very least, it is
      > an interesting alternative to trial division.


      Good suggestion. Ready-made source code, by Professor Caldwell, in JavaScript, can be found at

      http://primes.utm.edu/curios/includes/file.php/primetest.html

      Phil

      Mathematics should not have to involve martyrdom;
      Support Eric Weisstein, see http://mathworld.wolfram.com
      Find the best deals on the web at AltaVista Shopping!
      http://www.shopping.altavista.com
    Your message has been successfully submitted and would be delivered to recipients shortly.