Project Euler Solution in Haskell