Solution to projecteuler.net problems, implemented in Scala