Sadly, I am not a mathemation and prime number seives are not my focus, but I can provide you with what I know.
Small number primes, I believe you know more than I do.
On large number primes (those greator than 512 bits), there is no method that can determine if a number is prime in a resonable time. I was answering someone elses question which is similar in the prime number area, where it took 3 universities 11 months to factor a special form composite number.
However, if you are dealing with large primes, miller-rabin primarilty test could be used. The input is a number, and a probability that the number reports as prime and is really composite. So using it, you could simply loop on all values between A and B which do not end in 0,2,4,5,6,8 and perform the test on them. (skip all even numbers and skip 5 because any number x5 either ends in 5 or 0).
Anyways, I think this is slightly different from what you were hoping, but sadly this is the only primality test I know of that can handle the larger prime numbers.
http://en.wikipedia.org/wiki/Miller-Rabin_primality_testIf you do decide to use it, you should consider testing against all primes less than 1024 as well. I read somewhere that there are some very large composite numbers which can pass the test, but not be prime. Also testing against those smaller primes, is faster than running the test.
Salindor
Salindor