Confused about Telescoping/Domain Transformation Question
Here is how you can write the telescope more clearly.

$$\begin{array}{ll}
S(k)-S(k-1)\phantom{S(k-2)-S(k-3)S(2)-S(1)-S(0)}&amp;=(2^{k})^2\\
\phantom{S(k)-}S(k-1)-S(k-2)\phantom{-S(k-3)S(2)-S(1)-S(0)}&amp;=(2^{k-1})^2\\
\phantom{S(k)-S(k-1)}S(k-2)-S(k-3)\phantom{S(2)-S(1)-S(0)}&amp;=(2^{k-2})^2\\
\phantom{S(k)-S(k-1)S(k-2)}\cdots\phantom{S(2)-S(1)-S(0)}&amp;\cdots\\
\phantom{S(k)-S(k-1)-S(k-2)-S(k-3)}S(2)-S(1)\phantom{-S(0)}&amp;=(2^{2})^2\\
\phantom{S(k)-S(k-1)-S(k-2)-S(k-3)S(2)-}S(1)-S(0)&amp;=(2^{1})^2\\
\end{array}$$
Summing up all equalities above, we will cancel all terms between one another except the first term and the last term. We have
$$\begin{align}
S(k)-S(0) 
&amp;= (2^{k})^2+(2^{k-1})^2+(2^{k-2})^2+ \cdots + (2^2)^2 + 2^2\\
&amp;= 2^{2k}+2^{2k-2}+2^{2k-4}+ \cdots +2^4+ 2^2\\
&amp;= \frac {2^{2k+2}-4}{3}
\end{align}$$
So $$S(k)=\frac {2^{2k+2}\ -4}{3}+S(0) = \frac {2^{2k+2}\ -4}{3} = \frac {4(2^{k})^2\ -4}{3}$$

Now substitute $\log_2n$ for $k$. Note $2^k=n$.
$$S(\log_2n)=\frac43(n^2-1)$$
The left side is $T(2^{\log_2n})=T(n)$. So 
$$T(n)=\frac43(n^2-1)$$
The equality holds only when $n=2^k$ for some nonnegative integer $k$.