Package net.n1da.dev.euler
Class PE0026
- java.lang.Object
-
- net.n1da.dev.euler.core.Problem
-
- net.n1da.dev.euler.PE0026
-
- All Implemented Interfaces:
Solvable
public class PE0026 extends Problem
Solution for problem 26 "Reciprocal cycles" completed on Sun, 19 Jul 2015, 13:33.- Since:
- 19.07.2015 06:52:46
- Author:
- Nico Danneberg
- See Also:
- Problem @ Project Euler, Solution @ Ni-Da-Net
-
-
Method Detail
-
solve
public java.lang.String solve()
Solves the problem by decrementing D beginning from 1000. The loop stops when the looping variable is smaller than the biggest cycle found.- Returns:
- the number with the biggest cycle
-
getCycle
private int getCycle(int d)
Divides 1 by the given number step by step checking if the current remainder (modulus) was found earlier.- Parameters:
d
- the number to be checked- Returns:
- the length of the cycle
-
-