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.