Prove the following by using the principle of mathematical induction for all n ∈ N:
$1+3+3^{2}+\ldots+3^{n-1}=\frac{\left(3^{n}-1\right)}{2}$
Let the given statement be $P(n)$, i.e.,
$P(n): 1+3+3^{2}+\ldots+3^{n-1}=\frac{\left(3^{n}-1\right)}{2}$
For $n=1$, we have
$P(1): 1=\frac{\left(3^{1}-1\right)}{2}=\frac{3-1}{2}=\frac{2}{2}=1$, which is true.
Let $P(k)$ be true for some positive integer $k$, i.e.,
$1+3+3^{2}+\ldots+3^{k-1}=\frac{\left(3^{k}-1\right)}{2}$
We shall now prove that $\mathrm{P}(k+1)$ is true.
Consider
$1+3+3^{2}+\ldots+3^{k-1}+3^{(k+1)-1}$
$=\left(1+3+3^{2}+\ldots+3^{k-1}\right)+3^{k}$
$=\frac{\left(3^{k}-1\right)}{2}+3^{k} \quad[U \operatorname{sing}(\mathrm{i})]$
$=\frac{\left(3^{k}-1\right)+2.3^{k}}{2}$
$=\frac{\left(3^{k}-1\right)+2 \cdot 3^{k}}{2}$
$=\frac{(1+2) 3^{k}-1}{2}$
$=\frac{3.3^{k}-1}{2}$
$=\frac{3^{k+1}-1}{2}$