Its very simple maths used here
i/j > 0.001 holds true
As you can see i=2 always and never changes , while the value of j is constantly changing in terms of 2^n.
2/2^n > 0.001
1/2^(n-1) > 0.001
2^(n-1) < 1000 holds true
it will fail when 2^(n-1)=1024 ,
hence n-1=10
n=11