title: Python Recursive Function for Collatz Conjecture
body: <p>I have written the following recursive program to show the number of steps a number goes through in Collatz Conjecture:</p>
  
  <pre><code>def cycle_length(n):
      count = 0
      if n == 1:
          return count
      if n%2 == 0:
          count += cycle_length(int(n/2)) +1
      elif n%2 != 0:
          count += cycle_length(int(3*n+1)) + 1
          print("The count is: ",count)
      return count 
  
  print(cycle_length(22))
  </code></pre>
  
  <p>However the count is 15 when it should be 16. However, when I change the initial count to 1 or say:</p>
  
  <pre><code>return count + 1
  </code></pre>
  
  <p>It doubles the count to 31. I can't figure out what is causing this. </p>
  
  <p>Thanks for your help.</p>