Project Euler/7: Difference between revisions
From charlesreid1
(Created page with "==The Question== By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the 10,001st prime number? https://projecteule...") |
|||
| Line 18: | Line 18: | ||
<math> | <math> | ||
\dfrac{x}{ln{(x)}} = | \dfrac{x}{ln{(x)}} = 10,001 | ||
</math> | </math> | ||
Revision as of 21:12, 13 June 2017
The Question
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the 10,001st prime number?
https://projecteuler.net/problem=7
Approach
Start with the prime number distribution function pi(x),
$ \pi(x) \approx \dfrac{x}{\ln{(x)}} $
This gives us a ballpark estimate of how many numbers we will need to look at to find the 10,001st prime number: just solve
$ \dfrac{x}{ln{(x)}} = 10,001 $
or,
$ x \approx 116,000 $