Java Implementation of Problem 7

View source code here on GitHub!

Includes

Problem Solution

public class p0007 implements IEuler
Object answer()
Returns:

The answer to Project Euler problem 7

 1/*
 2Project Euler Problem 7
 3
 4Problem:
 5
 6By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that
 7the 6th prime is 13.
 8
 9What is the 10 001st prime number?
10*/
11package euler;
12
13import euler.lib.Primes;
14
15public class p0007 implements IEuler {
16    @Override
17    public Object answer() {
18        return Primes.primes()
19                     .skip(10000)
20                     .findFirst()
21                     .get()
22                     .intValue();
23    }
24}

Tags: prime-number, java-iterator