title: How to make Haskell use another list depending on the previous answer in Haskell
body: <p>I am doing project euler question 63 where I must find the amount of numbers that exist where:</p>
  
  <pre><code>x^(n) == y
  </code></pre>
  
  <p>Where <code>n</code> is the length of <code>y</code>.</p>
  
  <p>It soon emerges that the results for this condition alternate between odd and even and so I came up with this in Haskell:</p>
  
  <pre><code>prob63 = [ n | n &lt;- nums n , i &lt;-[1..10], i^(length $ show n) == n]
  
  nums n | odd (n) == True = filter odd [n..]
      | otherwise         = filter even [n..]
  </code></pre>
  
  <p>If n &lt;- [1..], prob63 produces a stream that looks like this:</p>
  
  <pre><code>[1,2,3,4,5,6,7,8,9,16,25,36,49,64,81,125,216,343,512,729,1296,2401,4096,6561,16807,32768,59049,117649,262144,531441]
  </code></pre>
  
  <p>But this is slow and what I came up with after doesn't work. What I need is, depending on the previous answer, it will start testing the odd or even integers from <code>n</code>. How would I go about this from what I already have?</p>