Pizza Hut math problem #1 in Haskell
Basically, you're testing a lot of paths you don't have to.  It would probably be more efficient to find a 1-digit number that is divisible by 1, then use that digit to find a 2-digit number that is divisible by 2, then use those two digits to find a 3-digit number that is divisible by 3, then recursively backtrack if you run out of options at one level.

Here's some code to illustrate.  It returns essentially instantly in my REPL.  You call it by pizza 1 0 initially.  



import Data.List ((\\))
import Data.Char (digitToInt, intToDigit)
import Data.Maybe (listToMaybe, mapMaybe)

pizza :: Integer -&gt; Integer -&gt; Maybe Integer

pizza 10 accum = Just (accum * 10)

pizza n accum =
  let usedDigits = map digitToInt $ show accum
      unusedDigits = map toInteger $ [1..9] \\ usedDigits
      previous = accum * 10
      divisibleDigits = filter (\digit -&gt; (previous + digit) `mod` n == 0) unusedDigits
  in listToMaybe $ mapMaybe (\digit -&gt; pizza (n + 1) (previous + digit)) divisibleDigits


However, for one-shot problems like these, your solution is fine.  If you can't write a faster algorithm in less than 9 minutes (of your programmer time), you haven't actually saved any time.