title: collatz algorithm that returns first integer when at least input (n) in length
body: <p>Here are my instructions: </p>
  
  <p>Consider the following process: Start with some positive integer. If the number is odd, multiply it by 3 and add 1. If it is even, divide it by 2. For every number that has ever been tried, repeating this process eventually leads to the number 1. For example, starting with 6 we get the sequence 6, 3, 10, 5, 16, 8, 4, 2, 1. That is a sequence of length 9.</p>
  
  <p>Write a function collatz that takes a parameter n and returns the first integer for which the generated sequence is at least n in length.</p>
  
  <p>This is my current code:</p>
  
  <pre><code>def collatz( n ):
  
      seq = []
      seq.append( n )
  
      while n &gt; 1:
  
          if n % 2 != 0:
  
              n = int( n * 3 ) + 1
              seq.append( n )
  
          else:
  
              n = int( n / 2 )
              seq.append( n )
  
      if len( seq ) &lt; seq[ 0 ]:
          return len( seq )
  
      else: 
  
          return seq[ 1 ]
  </code></pre>
  
  <p>My current code works for an input of 10 which outputs 7 correctly, as well as an input of 6 which outputs 3 correctly, but for an input of 3 it outputs 10 when it should output 3. </p>
  
  <p>I am incredibly confused by this question and cannot wrap my head around what it's even asking. Any help is greatly appreciated! Thanks!</p>