Package net.n1da.dev.euler
Class PE0050
- java.lang.Object
-
- net.n1da.dev.euler.core.Problem
-
- net.n1da.dev.euler.PE0050
-
- All Implemented Interfaces:
Solvable
public class PE0050 extends Problem
Solution for problem 50 "Consecutive prime sum" completed on Sat, 25 Jun 2016, 19:58- Since:
- 25.06.2016 15:18:21
- Author:
- Nico Danneberg
- See Also:
- Problem @ Project Euler, Solution @ Ni-Da-Net
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.ArrayList<java.lang.Integer>
candidates
A memory for all primes less than one million.private int
limit
The maximum for the wanted prime.
-
Method Summary
Modifier and Type Method Description void
prepare()
Within the preparation of this problem allcandidates
less than 1.000.000 are collected using aSieve
.java.lang.String
solve()
This method solves the given problem by adding all consecutivecandidates
.-
Methods inherited from class net.n1da.dev.euler.core.Problem
finish, getResult, getRuntime, toString
-
-
-
-
Method Detail
-
prepare
public void prepare()
Within the preparation of this problem allcandidates
less than 1.000.000 are collected using aSieve
.
-
solve
public java.lang.String solve()
This method solves the given problem by adding all consecutivecandidates
. The maximum found sum less than 1.000.000 that is a prime is returned.- Returns:
- the biggest prime less than one million that is formed as a sum of primes
-
-