Fastest algorithm for primality test [closed]
I need to test primality on intervals between numbers which are really big (in the range of long long), so i need some fast algorithm for checking if a number is prime or not. Please suggest your ideas. One good method is the Miller-Rabin test. It should be noted however, that this is only a probabilistic test. A Miller-Rabin test to the seven bases 2, 325, 9375, 28178, 450775, 9780504, 1795265022 has been proved by Jim Sinclair to deterministically test if a number less than 2^64 is prime. See http://miller-rabin.appspot.com/ . I believe that the asymptotically fastest current (non