From charlesreid1

Project Euler, question 7: https://projecteuler.net/problem=7

Solution: https://git.charlesreid1.com/cs/euler/src/master/007

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),

Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \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

Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \dfrac{x}{ln{(x)}} = 10,001 }

or,

Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle x \approx 116,000 }