Project Euler, Problem 67 Java