Is there a way to find the approximate value of the nth prime?

前端 未结 7 1748
醉话见心
醉话见心 2020-12-14 10:09

Is there a function which will return the approximate value of the n th prime? I think this would be something like an approximate inverse prime counting function.

7条回答
  •  無奈伤痛
    2020-12-14 10:56

    As a rough estimate, you can use n*ln(n) as an approximation for the nth prime number. There is a much more complex, but more accurate method, details of which you can find on Wikipedia here.

提交回复
热议问题