title: Fast Algorithm to find number of primes between two numbers
body: <p>My problem reduces to finding the number of primes between two given numbers.I could have a range as big as <code>1 to (1000)!</code> and hence I am need of some mathematical optimizations. </p>
  
  <p>Clearly the sieve method would be too slow in this case. Is there any mathematical optimization that can be applied - like for instance, taking a smaller subset of this large space and making inferences about the rest of the numbers.  </p>
  
  <p>P.S: It definitely looks like I might have reached a dead end - but all that I am looking for are some optimizations that could possibly help solve this. And also, I am only looking for a single-threaded approach. </p>
  
  <p>EDIT: One approach I have been thinking and can solve a lot of large prime number related problems - is for someone to maintain a global table of primes and make it available for lookup. Folks at the PrimeGrid project can contribute usefully towards this. </p>