I found this example problem on the internet that I just cannot understand how the author came to their conclusion.
sum1 = 0; for(k=1; k<=n; k*=2) // Do