Project Euler problem solutions in Java