Solution for Problem 7 - dhermes/project-euler GitHub Wiki

Problem Statement

Project Euler Problem 7: 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 10001st prime number?

Solution

I determine the approximate value under which there will be 10001 primes via the prime number theorem. With this value, I use the Sieve of Eratosthenes to find all primes under this value and then perform a simple lookup to determine the 10001st prime number.

Links

Previous