Project euler in scala