So I am trying to find ways to make the number 5 using the number 15

```
import Data.List
import Control.Monad
import Control.Monad.Omega
import System.IO

data Expr = X | Sub Expr Expr | Div Expr Expr | Pow Expr Expr
          deriving Show

eval x X = x
eval x (Sub a b) = eval x a -  eval x b
eval x (Div a b) = eval x a /  eval x b
eval x (Pow a b) = eval x a ** eval x b

exprs | v <- each exprs
      = (X:) . concat $ transpose
      [ runOmega $ liftM2 Div v v
      , runOmega $ liftM2 Sub v v
      , runOmega $ liftM2 Pow v v
      ]

main = do
  hSetBuffering stdout LineBuffering
  mapM_ print $ filter ((==5).eval 15) exprs

```

However, the first result is the 118588079th element in the list, and Haskell runs out of memory long before getting there. How do I know the first one is 118588079? Because if I just calculate it and ask for the index instead, Haskell uses no memory at all:

```
run x | v <- each $ run x
      = (x:) . concat $ transpose
      [ runOmega $ liftM2 (/ ) v v
      , runOmega $ liftM2 (- ) v v
      , runOmega $ liftM2 (**) v v
      ]

main = print . map snd . filter ((==5).fst) $ zip (run 15) [0..]

```

Where exactly is my memory going in the first case, and how do I get around it?