title: How many times can n be floor(sqrt(n)) - 1 while n > 0?
body: <p>The full question is</p>
  
  <p>Supposed we have a function</p>
  
  <pre><code>void foo(int n){
    int i = n;
    while(i &gt; 0){
      //do an O(n) operation
      //do some O(1) operations
      i = sqrt(i) - 1;
    }
  }
  </code></pre>
  
  <p>I just have to find the asymptotic bounds, but I can't do that until I figure out how many times the loop actually runs. Which I'm guessing is another summation involving a square root, but I'm not sure how to start.</p>