Fast Algorithm to find number of primes between two numbers

前端 未结 5 2033
后悔当初
后悔当初 2021-02-04 14:57

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

5条回答
  •  佛祖请我去吃肉
    2021-02-04 15:36

    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.

提交回复
热议问题