I will first calculate little-o for you to understand the whole process and then we will get big-O from it.
Let's take it into parts:
for (int i=2; i < n; i*=2)
First we have 1 bound from i=2
If i*=2 then i ={2,4,8,16,32,64...} so i increments following 2^x then:
We are looking for i > n to be true so it is 2^x > n whats needs to be true, doing a little of maths:
log2(2^x) = log2(n)
x=log2(n) //Here we figured out that i will need log2(n) loops to satisfy conditional statement.
Since in the for we have comparisons and bounds it will be 2log2(n)+1 operations for this for.
Notice: since this is a nested chain each operation in the following for will be multiplied 2log2(n)+1 times
for (int j=0; j < i; j++)
j=0 1 bound
j++ j={0,1,2,3,4,5,6,7,8....} so j=n then it goes 2n+1 for this for
Finally we have that little o is equal to:
(2n+1)*(2log2(n)+1)
4nlog2(n) + 2n + 2log2(n) + 1
log2(n)(4n+2) +2n +1
It turns out that o(log2(n)(4n+2) +2n +1), and in order to get big O we can reduce this expression neglecting some factors, then:
O(log2(n)n)
Hope it is clear enough to understand.
Regards.