Finding the sum of $3+4\cdot 3+4^2\cdot 3+\dots +4^{\log n-1} \cdot 3$ I see this:
$$A=3+4\cdot 3+4^2\cdot 3+\dots +4^{\log n-1} \cdot 3=3\cdot ([4^{\log n}-1]/3)=n^2-1$$
The base of logarithm is $2$, and $n$ is $2,4,8,\dots$
Anyone could describe me how this sum was calculated? Some hints or some tutorial for this?

$$\begin{align}S&=3+3\cdot 4+3\cdot 4^2+3\cdot 4^3+...+3\cdot 4^{\log_2 n-1}\\
&=3[1+4+4^2+4^3+...+4^{\log_2 n-1}]\\
4S&=3[\quad\;\;  4+4^2+4^3+...+4^{\log_2n-1}+4^{\log_2 n}]
\quad \quad \text{as $n=1,2,4,8,...,2^m,...$}
\end{align}$$
Subtracting:
$$\begin{align} 
3S&=3[4^{\log_2n}-1]\\
&=3[2^{2\log_2n}-1]\\
&=3[(2^{\log_2 n})^2-1]\\
&=3[n^2-1]\\
S&=n^2-1\end{align}$$
Note: The use of $n$ here is unconventional in that it is not the index count, i.e. $n\neq 1, 2, 3, 4, ....$ but instead $n=2^m=1, 2, 4, 8, 16, ...$
