I know that there are many prime generators, such as the sieve of Eratosthenes or Atkin. But they generate numbers sequentially, starting from the small ones. What method can I use to get prime numbers in an interval without starting from the smallers?
An option could be to use a random number generator and test the output with a primality test, deterministic or probabilistic, depending of what I want to achieve. Anyway the test would be slow and complex.
Is there any quick and easy method to generate primes non consecutively? A pseudoprime generator would also be OK.
regards
I rewrite the question more clearly:
How can I generate prime numbers in a given interval without: - going sequentially from the smallers to the largest ones (as with a Erathostenes Sieve) - nor using slow probabilistic primality tests on a random sequence?
Is there any FAST and EASY algorithm or function that generates numbers in such a way that if you run it for a long time you get all prime numbers on an interval? (I don't mind if it also generates some composites).