Project Euler, Problem 11 Java