<s>[INST] Let A be a matrix then $A^{50}$ is? 
If $$A=\begin{bmatrix}1&0&0\\1&0&1\\0&1&0\\ \end{bmatrix}$$ then ${A^{50}}$ is?                                   

How to calculate easily? What is the trick behind it? Please tell me.
 [/INST] Although there are easier ways in this particular case, I will outline a trick involving the Cayley-Hamilton theorem. 
We have $\det\begin{pmatrix}
1-X & 0&0\\
1& -X& 1\\
0&1&-X
\end{pmatrix}=-(X+1)(1-X)^2=Q(X)$. Hence there are two eigenvalues, namely $-1$ and $1$. We know that $A$ is diagonalizable if there are two independent eigenvectors belonging to the eigenvalue $1$, but that's not the case here. 
By the Cayley-Hamilton theorem, we have that $-(A+1)(1-A)^2=0$. Now consider the polynomial $P(X)=X^{50}$. We can divide this polynomial by $Q(X)$ and obtain $$P(X)=S(X)Q(X)+R(X)$$
where $R(X)$ is a polynomial of degree at most $2$. Notice that $P(A)=R(A)$ by the Cayley-Hamilton theorem. Write $R(X)=a+bX+cX^2$. Now notice that $$50X^{49}=P'(X)=S'(X)Q(X)+S(X)Q'(X)+R'(X).$$
It follows that $50=P'(1)=R'(1)=b+2c$, here I used that $1$ is a double root and hence $Q'(1)=0$. Also, $1=P(1)=R(1)=a+b+c$ and $P(-1)=R(-1)=a-b+c$. Now you can solve for $a,b$ and $c$. You should find that $a=-24,b=0$ and $c=25$. It follows that $$A^{50}=R(A)=-24I+25A^2=-24I+25\begin{pmatrix}
1&0&0\\
1&1&0\\
1&0&1
\end{pmatrix}=\begin{pmatrix}
1&0&0\\
25&1&0\\
25&0&1
\end{pmatrix}.$$
</s>