Project euler problems in Java