How can calculate $ a \mod n^2 $ be computed smartly if we know $a \mod n$? By example:

How can $ 2^{65536} \mod 7^2 $ be computed smartly?

I think that there is a faster method than writing next element and find cycles. I found that 
$\mod 7 :$
$$ \color{red}{ 2^{0} \equiv 1\\2^{1} \equiv 2\\2^{2} \equiv 4}\\2^{3} \equiv 1 $$
and by these equations each number can be fastly computed for example:
$$2^{65536} = 2^{21845\cdot 3 +1 } \equiv 2^1 \equiv 2 $$
but how can it be applied for $\mod 49$?

Since, as you noticed, $2^3\equiv 1\pmod 7$, let's look at what multiplying by $2^3$ does to a number mod $7^2$. We'll write our congruence class in the form $7a+b$ where $0\leq a, b\lt 7$; then $2^3(7a+b)$ $=(7+1)(7a+b)$ $=7^2a+7a+7b+b$ $\equiv 7(a+b)+b$.  By iterating this, we see that $2^{3i}(7a+b)$ $\equiv 7(a+ib)+b$, so $2^{21}(7a+b)$ $\equiv 7(a+7b)+b$ $\equiv 7a+7^2b+b$ $\equiv 7a+b$.  In other words, $2^{21}$ here is the identity mod $7^2$ just as $2^3$ was mod $7$ (this is another way of looking at Arthur's answer), so we can remove all the factors of $2^{21}$ from $2^{65536}$ and wind up with $2^{65536}\equiv 2^{16}$ $\equiv 2\cdot2^{15}$ $\equiv 2\cdot (2^3)^5$ $\equiv 2\cdot (5\cdot 7+1)$ $\equiv 3\cdot7+2 \equiv 23$.
