Project Euler, Problem 38, Java