i=2;
while(i<n) {
i = i*i;
//O(1) complexity here
}
I'm new to time complexity and trying to figure out what this would be. I know that if the iteration would've been i=2*i then it'd be O(log(n)) but I don't really know how I can calculate iterations of i^2.
Intuitively it'd also be O(log(n)) because it "iterates faster" but I don't know how to formally explain this.
Any help would be appreciated, thanks in advance