Thursday, December 17, 2009

What function will give me the amount of prime numbers between ';a'; and ';b';?

For example: a=29 and b=101. After I store ';n'; into the function, I'll get the prime numbers from ';a'; to ';b';.What function will give me the amount of prime numbers between ';a'; and ';b';?
There is no magic function that you can use. Even getting a ';good'; approximation for what you are asking is one of the greatest challenges facing mathematicians right now. So if you really need something like that use a computer program, which would be OK for small enough ';n'; values (a few dozen digits maybe?). If you want to learn more about finding good approximations, check Riemann Hypothesis from wikipedia or mathworld.What function will give me the amount of prime numbers between ';a'; and ';b';?
This isn't as easy as you thought (or at least as your question suggests). Check this out:





http://en.wikipedia.org/wiki/Prime_count鈥?/a>

No comments:

Post a Comment