title: Julia code not finishing while Python code does
body: <p>I am very new to Julia and was trying to implement/rewrite some of my previous Python code as practice. I was using the Project Euler problem 25 as practice</p>
  <p>In Python I have</p>
  <pre class="lang-py prettyprint-override"><code>def fibonacci(N):
      &quot;&quot;&quot;Returns the Nth Fibonacci Number&quot;&quot;&quot;
      F = [0, 1] 
      i = 0
      while i &lt;= N-2:
          F_new = F[i] + F[i+1]
          F.append(F_new)
          i += 1
      return F[N]
  
  N = 0 
  x = 1000
  
  while len(str(fibonacci(N))) &lt;= x:
      if len(str(fibonacci(N))) == x:
          print(N)
          break     
      N = N + 1
  </code></pre>
  <p>Which runs and gives me the correct answer in about 6.5 seconds. When trying to do this in Julia below</p>
  <pre><code>function fib(N)
      F = [0, 1]
      global i = 1
      while i &lt;= N-2
          F_new = F[i] + F[i+1]
          append!(F, F_new)
          global i += 1
      end
      return F[N]
  end
  
  N = 1
  x = 1000
  
  while length(string(fib(N))) &lt;= x
      if length(string(fib(N))) == x
          print(N-1)
          break
      end
  global N += 1
  end
  </code></pre>
  <p>The code seems to run &quot;forever&quot;. However in the Julia code only when x&lt;= 20 will the code finish and produce the correct answer. In the Julia code when x&gt;20 the program never ends.</p>
  <p>I'm not sure where something could go wrong if it runs for all values below 21? Could somebody explain where the error is happening and why?</p>