1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Number of Primes between two integers

  1. Nov 10, 2013 #1
    Is there a formula to calculate the EXACT number of primes between two integers? There are many very good ways of ESTIMATING the number but I have found very few that give the EXACT number, and those that do essentially require the knowledge of primes before hand (Legendre and Miessel.) While those are all nice I am looking for a formula (not an algorithm) that will spit out the EXACT number of primes by knowing only the two boundaries. Has it been done?
  2. jcsd
  3. Nov 10, 2013 #2
    Exact? No. But as the numbers in question approach infinity, they behave more accordingly to the Prime Number Theorem.
  4. Nov 12, 2013 #3


    User Avatar
    Science Advisor

    With the use of pi(n) you could easily construct a forumula for the number of primes between two integers i and j. However, I imagine that you would classify pi(n) as being an "algorithm" rather than a "formula".

  5. Nov 13, 2013 #4
    Thank you both for your reply's and to jbriggs444 I would consider using the logarithmic pi(x) an algorithm. I am looking for a formula/ function that would shed more light on the distribution of primes by solving for the number of primes using only the two integer limits.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook