Check out my suggestion for why its not n^2


#1

I think it should be n^2 at first glance but it’s not
because if the n is 5 the total iteration is :
1st iteration:
i = 5 and now i is i /=5 i.e 2
j = 0, 1
2nd iteration:
i = 3 and now i is i /=3 i.e 1
j= 0
total iteration of i: 2 and iteration of j : 3
So the total iteration is 5.


#2

but for 2nd iteration the value of i will be 2. for your case