title: Time complexity of loop multiplying the value by two or three
body: <p>I found the below for-loop in an SO question.</p>
  
  <p>I found that the time complexity is <code>O(n log n)</code>.</p>
  
  <p>How would I find the time complexity if we change <code>k *= 2</code> to <code>k *= 3</code>?</p>
  
  <pre><code>// 'int n' is defined somewhere
  int var = 0;
  for (int k = 1; k &lt;= n; k *= 2)
     for (int j = 1; j &lt;= n; j++)
        var++;
  </code></pre>