06-05-2003, 04:19 AM
It checks every odd number for primality by seeing if it is evenly divisible by every number that is less than 32767.
The reason is that it is slower to do mod using integers, but you can only check up to 32761 (I think it's a prime) squared.
A number can be checked for primality by just doing mod all primes less than the square root of that number because you just check the same numbers over again after...
(x+1)(x-1)
(x-1)(x+1)
The reason is that it is slower to do mod using integers, but you can only check up to 32761 (I think it's a prime) squared.
A number can be checked for primality by just doing mod all primes less than the square root of that number because you just check the same numbers over again after...
(x+1)(x-1)
(x-1)(x+1)
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Visit www.neobasic.net to see rubbish in all its finest.