At each iteration of the inner loop you perform j = j * 7
(I assume this is what you meant)
That is, at each iteration j = 7j
After n
iterations, j = j*7*7*7*7*...*7*7 = j*(7 ^ n)
Let n
be the number we want to reach and m
the number of iterations, so:
n = j*7*7*7*...7 = j*(7 ^ m)
Let's take a log from both sides:
log(n) = log(j * (7 ^ m)) ~= m*log(7) = O(m)
So, as we can see - the inner loop runs O(log(n))
times.