How does the sum of the above GP come down to 2n - 1?

Please explain.

The geometric series is `1+2+4+8+....+2^k`

Let’s assume that `2^k`

= `n`

`2^0+2^1+2^2…+2^k = 2^(k+1)-1

`= 2^k * 2^1-1`

Substituting n for 2^k we get,

`= 2n-1`

Anum Hassan|Developer Advocate

educative.io