Project Euler, Problem 16 Java