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?

Maybe we need to take a few steps back ( though I imagine this has all been covered in your course). If $a$ is any real number other than $1$ and $r$ is a positive integer, then $1 + a + a^{2} +\ldots +a^{r-1} = \frac{a^{r}-1}{a-1}.$ If you need to verify that, multiply the left side by $a-1$ and notice that there is a lot of cancellation. If $b$ is another real number, then we see that $b + b.(a) + b.(a^{2}) +\ldots +b.(a^{r-1}) = b.\frac{a^{r}-1}{a-1}.$ 
In this problem, $b =3, a= 4$ and $r = \log_{2}(n)$ (where, although it not explcitly said, $n$ must be a (positive integer) power of $2)$. Then $a^{r} = 2^{2\log_{2}(n)} = n^{2}.$ Also, $b = 3,$ and $a-1 = 3,$ so the answer does indeed simplify to $n^{2}-1.$ 
