Project Euler in Haskell: problem 2.