Package net.n1da.dev.euler
Class PE0044
- java.lang.Object
-
- net.n1da.dev.euler.core.Problem
-
- net.n1da.dev.euler.PE0044
-
- All Implemented Interfaces:
Solvable
public class PE0044 extends Problem
Solution for problem 44 "Pentagon numbers" completed on Fri, 20 May 2016, 19:33.- Since:
- 20.05.2016 16:04:21
- Author:
- Nico Danneberg
- See Also:
- Problem @ Project Euler, Solution @ Ni-Da-Net
-
-
Method Summary
-
Methods inherited from class net.n1da.dev.euler.core.Problem
finish, getResult, getRuntime, toString
-
-
-
-
Method Detail
-
prepare
public void prepare()
It just initializes thepentagons
list.
-
solve
public java.lang.String solve()
This method solves the given problem by calculating one pentagon number after each other. Every number is tested with all other found numbers. If the sum AND the difference of two pentagon number is another one the difference is stored. A loop runs until the difference of two consecutive is larger than the minimum found difference.- Returns:
- the smallest difference of two pentagon numbers that is a pentagon number, two
-
-