Some solutions to Euler problems (in Scala and Haskell)