Solving some Project Euler problems, in Scala