To Find $A^{50}$ $$A=\begin{bmatrix}1 & 0&0\\1 & 0&1\\0&1&0\end{bmatrix}$$
Find $A^{50}$  ?
Now from Cayley–Hamilton theorem, I get $A^3-A^2-A+I=0$ and $A^{50}=(A^4)^{12}A^2$ so I found $A^4$ which is $-2A-I$, then we have $A^{50}=B^{12}A^2$ where $B =A^4$ was calculated, now should I again use Cayley–Hamilton theorem to find $B^{12}$ or is there a better possibility?
 A: If you do a few calculations: \begin{equation} A^2= \begin{bmatrix} 1&0&0\\1&1&0\\1&0&1 \end{bmatrix} \end{equation}\begin{equation} A^4= \begin{bmatrix} 1&0&0\\2&1&0\\2&0&1 \end{bmatrix} \end{equation}\begin{equation} A^6= \begin{bmatrix} 1&0&0\\3&1&0\\3&0&1 \end{bmatrix} \end{equation}
...so then from here you can deduce the answer...
On a more rigorous note: note that $A^2=\begin{bmatrix} 1&0&0\\1&1&0\\1&0&1 \end{bmatrix} =(\begin{bmatrix} 0&0&0\\1&0&0\\1&0&0 \end{bmatrix}+I)$. 
Now $\begin{bmatrix} 0&0&0\\1&0&0\\1&0&0 \end{bmatrix}^2 =0$. 
So that $(\begin{bmatrix} 0&0&0\\1&0&0\\1&0&0 \end{bmatrix}+I)^{n}=\binom{n}{n-1} \begin{bmatrix} 0&0&0\\1&0&0\\1&0&0 \end{bmatrix}^1I^{n-1}+I^{n}=n\begin{bmatrix} 0&0&0\\1&0&0\\1&0&0 \end{bmatrix}I+I$. 
(This last step is just using the binomial theorem combined with the result directly above it. You can write out the full binomial expansion and then just reduce to zero all higher powers of the nilpotent matrix.) 
So then $A^{50}=(A^2)^{25}$, so that $n=25$ and the result follows.
A: Let $f(x) = x^3-x^2-x-1 = (x^2-1)(x-1) = (x-1)^2(x+1)$.
Since $f(A) = 0$, we want to find polynomial $q(x), r(x)$ such that 
$$x^{50} = q(x)f(x) + r(x)\tag{*1}$$
with $\deg r(x) \le \deg f(x) - 1 = 2$. If we can figure out what is $r(x)$, then
$$A^{50} = q(A)f(A) + r(A) = r(A)$$
Write $r(x)$ as $a x^2 + b x + c$. To fix the coefficients, evaluate both side of $(*1)$ at
$1$ and $-1$ and the derivative at the double root $1$, we get:
$$
\begin{cases}
1  &= a + b + c\\
1  &= a - b + c\\
50 &= 2a + b
\end{cases}
\quad\implies\quad
\begin{cases}
a  &= 25\\
b  &= 0\\
c  &= 24\\
\end{cases}
\quad\implies\quad
r(x) = 25 x^2 - 24.
$$
As a result,
$$A^{50} = 25 A^2 - 24 I 
= 25 \begin{pmatrix}
1 & 0 & 0\\
1 & 1 & 0\\
1 & 0 & 1
\end{pmatrix}
- 24 \begin{pmatrix}
1 & 0 & 0\\
0 & 1 & 0\\
0 & 0 & 1
\end{pmatrix}
= 
\begin{pmatrix}
1 & 0 & 0\\
25 & 1 & 0\\
25 & 0 & 1
\end{pmatrix}
$$
