Math Fundamentals18 sections · 814 units
Open in Course

Geometric Series - Powers of 2

Common pattern in algorithms

The sum 1+2+4+8+...+2n11 + 2 + 4 + 8 + ... + 2^{n-1} equals 2n12^n - 1. This comes directly from the geometric series formula with a=1a = 1 and r=2r = 2.

For instance, 1+2+4+8+16=251=311 + 2 + 4 + 8 + 16 = 2^5 - 1 = 31. This pattern appears when analyzing binary trees (sum of nodes at all levels) or counting subsets (total number of subsets of size nn).

Notice: the sum of all powers of 22 up to 2n12^{n-1} is one less than the next power. This relationship is why binary representations work the way they do.