Project Euler for java code