I need the summation formula for the following:
$2^0+2^1+2^3+2^5+\cdots+2^n$, $n$ is even i.e.
$2^0+2^2+2^4+2^6+\cdots+2^n$, $n$ is odd
I am aware that the formula of
$2^0+2^1+2^2+2^3+\cdots+2^n = 2^{n+1}-1$. But can anyone help me with a approach so solve such kind of problems.
[EDIT] Thanks for accepting. This is an even more straightforward approach:
$$\begin{align} S&=2^0+2^2+2^4+ \cdots +2^{2m}\\ &=4^0+4^1+4^2+\cdots +4^m\\ &=\frac 13 (4^{m+1}-1)\end{align}$$
$$\begin{align} S'&=2^1+2^3+2^5+ \cdots +2^{2m+1}\\ &=2(4^0+4^1+4^2+\cdots +4^m)\\ &=\frac 23 (4^{m+1}-1)\end{align}$$
[ORIGINAL ANSWER] Consider the case where $n$ is even, i.e. $n=2m$.
Let $$\begin{align} S&=2^0+2^2+2^4+\cdots +2^{2m}\\ 2S&=2^1+2^3+2^5+\cdots+2^{2m+1}\end{align}$$
Adding: $$\begin{align}3S&=2^0+2^1+2^2+2^3+2^4+\cdots+2^{2m+1}\\ &=\sum_{r=0}^{2m+1}2^r\\ &=2^{2m+2}-1\\ S&=\frac 13 \left(2^{2m+2}-1\right)\\ &=\frac 13 \left(4^{m+1}-1\right)\end{align}$$
Similarly, for the case where $n$ is odd, i.e. $n=2m+1$,
$$\begin{align}S'&=2^1+2^3+2^5+\cdots+2^{2m+1}\\ &=2(2^0+2^2+2^4+\cdots +2^{2m})\\ &=2S\\ &=\frac 23 \left(4^{m+1}-1\right)\end{align}$$