Project Euler Java code