What is the time complexity Big-O of this algorithm? What is the time complexity Big-O of this algorithm?

, The first assumption it's O(N * lg N) but it is not correct, why?

        count = 0
        for i = N : 1 {
            for j = 0 : i {
                count = count + 1
                j =  j + 1
            }
            i = i/2
        }
        print(count)
The second for-loop while be executed N + N/2 + N/4 +....+ N/N

, the first for-loop decides how much the second for-loop will be executed.

When i = 0, j loops until N

, i = N/2, j loops until N/2

, And so on

, The Big O notation of N + N/2 + N/4 +....+ N/N will be O(N)