Project Euler solutions in java