Time complexity for this simple loop
You're on the right track.  For the simpler code, you correctly wrote down the sequence of values that are produced: $2^0,2^1,2^2,\dots$.  In particular, the $t$th output is $2^t$.  Then you were able to find where the loop stops by setting $2^t=n$ and solving for $t$.  That's a great approach.

Try doing the same thing for your actual example.  Hint: the first two outputs are $j$ and $j^2$.  What's next?  Can you generalize What is the $t$th output?  Can you write an equation that represents where the loop stops and solve for $t$?