The outside iteration is gonna take (n-1) times.
Then, the inside iteration:
The 1st time: k = 2 = 22^0;
The 2nd time: k = 22 = 22^1;
The 3rd time:k = 24 = 22^2;
...
The Nth time k = 22^(N-1).
If assume that the inner iteration is gonna take N times:
22^(N-1) < n => N < log(log n) +1;
So, the inner iteration is gonna take no more than log(log n) times.
The whole program is gonna take (n-1)*(log(log n) +1) = n*log(log n) + n - log(log n) -1 = O(n*log(log n));