shortened haskell solution to euler problem #14