Project Euler problems in Java