Find formulas for the entries of $M^n$, where $n$ is a positive integer ($2\times 2$ matrix) 
I got the following solution by doing: $P^{-1}\times M^n\times P$ but it is not correct. 
I spent hours trying to solve this and find help online but I am out of options. Please help :(
Note:
eigenvalues of $4$, $4$;
egeinvectors of $(-1,4)$ $\&$ $(0,0)$.
Another similar problem here: 

For some strange reason $a_{21}$ (lower left entry) was correct but the rest weren't. I kept rechecking my work but I could not figure out why.
Note: eigenvalues of $2$, $5$; egeinvectors of $(-2,1)$ $\&$ $(-1,1)$.
 A: An idea and hints: try to diagonalize your matrices, for example:
$$M=\begin{pmatrix}\;8&\;6\\\!\!-3&\!\!-1\end{pmatrix}\implies \det(xI-M)=(x-5)(x-2)$$
so the eigenvalues of this matrix are $\,2,5\,$ , and the corresponding eigenvectors are
$$\binom{\;2}{\!\!-1}\;,\;\;\binom{\;1}{\!\!-1}\implies P=\begin{pmatrix}\;2&\;1\\\!\!-1&\!\!-1\end{pmatrix}\;,\;\;P^{-1}=\begin{pmatrix}\;1&\;1\\\!\!-1&\!\!-2\end{pmatrix}\implies$$
$$P^{-1}MP=\begin{pmatrix}5&0\\0&2\end{pmatrix}\implies P^{-1}M^nP=\begin{pmatrix}5^n&0\\0&2^n\end{pmatrix}\implies M^n=P\begin{pmatrix}5^n&0\\0&2^n\end{pmatrix}P^{-1}\ldots$$
The second matrix is not diagonalizable (though you can try to triangle it...), but anyway you can try a direct approach and an inductive proof:
$$\begin{pmatrix}\;8&1\\\!\!-16&0\end{pmatrix}\;,\;\;\begin{pmatrix}\;8&1\\\!\!-16&0\end{pmatrix}^2=\begin{pmatrix}\;48&\;8\\\!\!-128&\!\!-16\end{pmatrix}\;,\;\;\begin{pmatrix}\;8&1\\\!\!-16&0\end{pmatrix}^3=\begin{pmatrix}\;256&\;48\\\!\!-768&\!\!-128\end{pmatrix}\ldots$$
BTW, the lower left entry cannot be correct, as the squared matrix proves.
