title: Number of movements Hanoi Haskell
body: <p>I wanna know how i could write the code in haskell for knowing how <strong>many movements</strong>  for a number n of "discs" and 3 sticks ( A , B , C)</p>
  
  <p>Base case ( N=1): Movement A --> C   so 1 movement</p>
  
  <p>Inductive case ( N = M+1 ) : I move M discs "A" ---> "C" and ,I move 1 disc "A" ---> "B" and finally I move M discs from "C" to "B".  I thought that the de code could be this:</p>
  
  <pre><code>numMoveHanoi 0 = 0 
  numMoveHanoi 1 = 1 
  numMoveHanoi n = m+1 + numMoveHanoi m 
                   where m = n-1
  </code></pre>
  
  <p>Unfortunately this only works for the case numMoveHanoi 2 .Other cases, the result is wrong.  I don't know where my recursion definition is wrong . </p>
  
  <p>Thanks everyone.</p>