Re: [PrimeNumbers] testing if 32 bit integer is prime number
- On Tue, 02 October 2001, "James Thoms" wrote:
> 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.
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!