Project Euler solutions in Java