Sometimes you need to solve for loop bounds algebraically. For example, you want a loop that runs while .
Solve for : . So the loop runs from to . This gives iterations.
Another example: a loop doubles each iteration until . Solve to get , meaning iterations.