<s>[INST] Computing $A^{50}$ for a given matrix $A$ $A =\left(
               \begin{array}{ccc}
                 1 & 0 & 0 \\
                 1 & 0 & 1 \\
                 0 & 1 & 0 \\
               \end{array}
             \right)$ then what would be $A^{50}$?
For real entries
 [/INST] the characteristic polynomial is 
\[ 
  \chi_A(t) = (1-t)\bigl(t^2 - 1)
\]
so the eigenvalues are $\pm 1$, we have 
\[
   A - 1 = \begin{pmatrix} 0 & 0 & 0\\\ 1 & -1 & 1 \\\ 0 & 1 & -1 \end{pmatrix} 
\]
which has defect $1$ (so $A$ isn't diagonalizable). It holds
\[
   (A - 1)^2 = \begin{pmatrix} 0 & 0 & 0\\\ -1 & 2 & -2 \\\ 1 & -2 & 2 
 \end{pmatrix} 
\]
so a basis of $\ker (A-1)^2$ is $\\{(2,1,0), (2,0,-1)\\}$, we have $A \cdot (2,1,0) = (0, 1, 1)$, so $\\{(2,1,0), (0,1,1)\\}$ is the basis of $\ker(A-1)^2$ we will use. It holds 
\[
   A + 1 = \begin{pmatrix} 2 & 0 & 0\\\ 1 & 1 & 1 \\\ 0 & 1 & 1 \end{pmatrix} 
\]
we choose the basis $\{(0,1,-1)\}$ of its kernel. So we let 
\[
   S := \begin{pmatrix} 2 & 0 & 0\\\ 1 & 1 & 1 \\\ 0 & 1 & -1 \end{pmatrix} 
\]
Then 
\[
   S^{-1}AS = \begin{pmatrix} 1 & 0 & 0\\\ 1 & 1 & 0 \\\ 0 & 0 & -1 \end{pmatrix} 
\]
so
\[
   S^{-1}A^{50}S = \begin{pmatrix} 1 & 0 & 0\\\ 50 & 1 & 0 \\\ 0 & 0 & -1 \end{pmatrix} 
\]
and finally 
\[
   A^{50} = \begin{pmatrix} 1 & 0 & 0\\\ 25 & 1 & 0 \\\ 25 & 0 & 1 \end{pmatrix} 
\]
</s>