Project Euler meets Java.