Solves problem 10 in Haskell