Some stabs at a popular online math challenge using Haskell