Project Euler - Problem 1 Solution - Java