Package net.n1da.dev.euler
Class PE0035
- java.lang.Object
-
- net.n1da.dev.euler.core.Problem
-
- net.n1da.dev.euler.PE0035
-
- All Implemented Interfaces:
Solvable
public class PE0035 extends Problem
Solution for problem 35 "Circular primes" completed on Thu, 4 Feb 2016, 21:22.- Since:
- 31.01.2016 22:38:03
- 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
List of all primes less that 1,000,000.private java.util.ArrayList<java.lang.Integer>
found
Stores all primes that are a solution of this problem.private java.util.ArrayList<java.lang.Integer>
tested
Storage of all tested primes.
-
Method Summary
Modifier and Type Method Description void
prepare()
Just initializes the attributes and stores all primes less than 1,000,000 incandidates
if the do not have one of the digits 0, 2, 4, 6, or 8.java.lang.String
solve()
This method solves the given problem by checking every prime in the list ofcandidates
.-
Methods inherited from class net.n1da.dev.euler.core.Problem
finish, getResult, getRuntime, toString
-
-
-
-
Field Detail
-
candidates
private java.util.ArrayList<java.lang.Integer> candidates
List of all primes less that 1,000,000.
-
tested
private java.util.ArrayList<java.lang.Integer> tested
Storage of all tested primes.
-
found
private java.util.ArrayList<java.lang.Integer> found
Stores all primes that are a solution of this problem.
-
-
Method Detail
-
prepare
public void prepare()
Just initializes the attributes and stores all primes less than 1,000,000 incandidates
if the do not have one of the digits 0, 2, 4, 6, or 8.
-
solve
public java.lang.String solve()
This method solves the given problem by checking every prime in the list ofcandidates
. Therefore the current prime is rotated over the complete length. Only if all resulting number are prime the set is stored infound
list.- Returns:
- the size of
found
- See Also:
Mathe.rotate(int)
-
-