### big-o

#### Big Oh notation loop manipulation

If I had two nested loops where the outer had a big oh notation of logn and the inner had one of n does that mean the overall notion would be log2n? because since n changes every time the outer loop executes, then the inner loop is technically running logn times but it loops n times. I apologise if this question sounds stupid. This is how the loop looks like: outer loop runs while n>0 inner loops runs n times n=(1/4)n I'm sorry if my formatting is off, I spent a few minutes trying to figure out how to use latex here and couldn't quite crack it

Time complexity is O(n): First time, inner loop iterates n times Second time, inner loop iterates n/4 times Third time, inner loop iterates n/16 times ... K'th time, inner loop iterates n/(4^k) times Summing them up: n + n/4 + n/16 + ... + n/4^k + ... + n/(4^log_4(n)) This is sum of geometric series with: a = n r = 1/4 And it's sums is bounded by: (n/3/4) = 4n/3 accorsing to the formula for r < 1

### Related Links

Why this code gives big-O = O(1)

Confused on how to find c and k for big O notation if f(x) = x^2+2x+1

calculating complexity of a function

Big - O notation linear and binary search [closed]

Show the O-notation for the following code fragment

Big Theta Questions

Role of lower order terms in big O notation

Finding Big O notation

Which Big-O grows faster asymptotically

Total time complexity in a method

What complexity mutiplication table code here have?

what is the worst case time complexity of 5/n?

Big O notation of simple expressiosn [closed]

Finding n0 in big O notation

Whats the dominant term in 2^n or n^2 for big O notation

Big-O simplification