Ask your own question, for FREE!
Mathematics 10 Online
OpenStudy (across):

How many prime numbers are there between 1,000,000 and 1,100,000?

OpenStudy (mathmate):

Does that have to do with log(n)/n and the Riemann-Zeta function?

OpenStudy (mathmate):

Oops, n/log(n)

OpenStudy (across):

With this question, I am seeking to clash a mathematical approach with a computerized one. Although it would be interesting to see in how many different ways we can tackle this exercise.

OpenStudy (mathmate):

So that makes 6692.7, say 6693. Is there a better estimate using R-Z function, I don't really understand it.

OpenStudy (across):

mathmate, your approximation is fairly close!

OpenStudy (across):

For corroboration, I wrote this: http://ideone.com/qoDbe I am now trying an analytical approach.

OpenStudy (mathmate):

Can you elaborate on your analytical approach, or is it proprietary?

OpenStudy (mathmate):

6693 wasn't even close, you were being polite! Using the "offset logarithmic integral" \[Li(n) = \int\limits_{2}^{n}\ \frac{dt}{\log(t)}\] I get 7212.99 > 7213. Using your code, I get 7216. So now it's getting close. Also, your code included 1 as a prime, which it is not. This does not change the counts over 1 though.

OpenStudy (across):

That made me want to go back and recheck the code. ^^

OpenStudy (anonymous):

wow.....

OpenStudy (across):

Interesting. Using the logarithmic integral from 2,000,000 to 2,100,000 you get 6881, whereas the (fixed) code chunks out 6871. The error is now negative.

OpenStudy (anonymous):

Code looks good except comparison to 1.

OpenStudy (anonymous):

btw - why picture change?

OpenStudy (mathmate):

I get the same answers, except that I get 6872 for the actual count, both using your code and my code.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!