My problem reduces to finding the number of primes between two given numbers.I could have a range as big as 1 to (1000)!
and hence I am need of some mathematical op
You can survey your options here: http://en.wikipedia.org/wiki/Prime_counting_function
This also looks helpful: http://mathworld.wolfram.com/PrimeCountingFunction.html
May I inquire why you need it up to 1000! ? Looks like no one has ever counted that many before. There are 1,925,320,391,606,803,968,923 primes from 1-10^23. 1000! = 10^120. I'm curious now.