Project Euler, Problem 26, Java