<s>[INST] 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?
 [/INST] If $\log $ is 2-base logarithm, you have:
$\;\;\; 3+4 \cdot 3+4^2 \cdot 3+ \cdots + 4^{\log n -1} \cdot 3
\\    = 4-1+4(4-1)+4^2(4-1)+4^3(4-1)+\cdots+4^{\log n -1} \cdot (4-1)
\\    = 4-1+4^2-4+4^3-4^2+\cdots+4^{\log n}-4^{\log n-1}
\\    = 4^{\log n}-1
\\    = 2^{2\log n}-1
\\    = n^2-1$
$\textbf{Edit}$ In sigma notation :
$$\sum_{i=1}^{\log n}3\cdot 4^{i-1}=\sum_{i=1}^{\log n}(4-1)\cdot 4^{i-1}=\sum_{i=1}^{\log n}4^{i}-4^{i-1}=\sum_{i=1}^{\log n}4^{i}-\sum_{i=1}^{\log n}4^{i-1}=4^{\log n}-1$$
</s>