Ok and the code OP showed should be similarly proved right? Like so :
Summation from i = 1 to N
Summation from j = x, where x = 2^iThus N * Summation from j = x, where x = 2^i = {1,2,4,8,16...}
If you look on wiki_summation. In the growth rate section it tells you that: Summation from i to N of c^i = THETA(c^n).
In our case c = 2, thus Summation from i to N of 2^i = THETA(2^n);Thus N * Summation from j = x, where x = 2^i
= N * THETA(2^n)
= THETA(n*2^n)
"Summation from i to N of c^i" is exactly what the code does, you're confusing the second loop with something that it is not :). Maybe you're considering "Summation from j = x, where x = 2^i" as O(2^N) and summing that N times, which does indeed result in O(N * 2^N), but a better bound can be found. Here's a picture that might clear things up: