This question can be solved by taking first some initial values of k={1,2,3,4,5.....} and then using the coming relation find out the relationship between k and n.
for k=1 ,n will be 4 so i will iterate for 4 times(ie..,n times) and j=2 and each time incrementing in terms of square(j). so j will be 2 and 4 i.e., pf will be printing 2 times for each i thus it will be printed total of n*2.
for k=2 ,n will be 16 so i will iterate for 16 times(ie.. n times) and j=2 and each time incrementing in terms of square(j). so j will be 2 and 4 and 16 i.e., pf will be printing 3 times for each i thus it will be printed total of n*3.
for k=3 ,n will be 256 so i will iterate for 256 times(ie.. n times) and j=2 and each time incrementing in terms of square(j). so j will be 2 and 4 and 16, and 256 i.e., pf will be printing 4 times for each i thus it will be printed total of n*4 or(n*(3+1)).
.
.
.
.
.
for k=k times , it wil be executing n*(k+1) times
n= square(square(k))
log n= square(k) (base 2)
or k= log log (n).
time complexity will be O(log log (n)) for each n and thus printing will be done =n *(K+1)=O(n*k) =O(n*log*log (n))