Simplifying sum equation. (Solving max integer encoded by n bits) Probably a lack of understanding of basic algebra. I can't get my head around why this sum to N equation simplifies to this much simpler form.
$$
\sum_{i=0}^{n-2} 2^{-i+n-2} + 2^i  = 2^n - 2
$$
Background
To give you some background I am trying to derive $MaxInt(n) = 2^n-1$ which describes that the maximum integer which can be created using the two's complement where $n$ is the number of bits the integer is encoded by.
How two's complement encodes numbers with 4 bits is explained by the images below:


Therefore:
$$
MaxInt(n) = \sum_{i=0}^{n-2} 2^i = (2^0 + 2^1 + ... + 2^{n-3} + 2^{n-2} )
$$
Maybe there is a way of integrating this or simplifying it but I figured that this is a similar problem to sum to N where
$$
\frac{T(n) + T(n)}{2} = T(n) = \sum_{i=1}^{n} n-i+1 = \sum_{i=1}^{n} i 
$$
So following this logic $MaxInt(n)$ is also equal to:
$$
MaxInt(n) = \frac{MaxInt(n) + MaxInt(n)}{2} 
$$
Since
$$
(2^0 + 2^1 + ... + 2^{n-3} + 2^{n-2}) = (2^{n-2} + 2^{n-3} + ... 2^2 + 2^1 + 2^0)
$$
Then
$$
MaxInt(n) = \sum_{i=0}^{n-2} 2^{n-2-i} = (2^{n-2} + 2^{n-3} + ... 2^2 + 2^1 + 2^0)
$$
Putting it all together:
$$
MaxInt(n) = \frac{\sum_{i=0}^{n-2} 2^{n-2-i} + \sum_{i=0}^{n-2} 2^i}{2}
$$
$$
MaxInt(n) = \frac{\sum_{i=0}^{n-2} 2^{-i+n-2} + 2^i}{2}
$$
Which is when I got stuck, cheating with wolfrom alpha I found that
$$
\sum_{i=0}^{n-2} 2^{-i+n-2} + 2^i  = 2^n - 2
$$
But I don't know why. If you see a better alternative way (i.e. not using sum to N method) of deriving $MaxInt(n) = 2^n-1$ please let me know.
Thanks for reading.

$$\large\begin{align}
\sum_{i=0}^{n-2} 2^{-i+n-2} + 2^i  &=\sum_{\begin{matrix}j\ +\ k\ =\ n-2\\ 0\;\le\; j,\ k\;\le\; n-2\end{matrix}}2^j+2^k\\\\
&=2\sum_{r=0}^{n-2}2^r\\
&=\sum_{r=1}^{n-1}2^r\\
&=\sum_{r=1}^{n-1}2^{r+1}-2^r\\
&=2^n-2\qquad\text{by telescoping}\quad \blacksquare
\end{align}$$
