<s>[INST] Find large power of a non-diagonalisable matrix 
If $A = \begin{bmatrix}1 & 0 & 0 \\ 1 & 0 & 1 \\ 0 & 1 & 0 \end{bmatrix}$, then find $A^{30}$.

The problem here is that it has only two eigenvectors, $\begin{bmatrix}0\\1\\1\end{bmatrix}$ corresponding to eigenvalue $1$ and $\begin{bmatrix}0\\1\\-1\end{bmatrix}$ corresponding to eigenvalue $-1$. So, it is not diagonalizable.
Is there any other way to compute the power?
 [/INST] Generalized eigenvector $\;u_1=\begin{pmatrix}a\\b\\c\end{pmatrix}\;$for $\;\lambda=1\;$ :
$$Au_1=1\cdot u_1+v_1\iff \begin{pmatrix}a\\a+c\\b\end{pmatrix}=\begin{pmatrix}a\\b\\c\end{pmatrix}+\begin{pmatrix}0\\1\\1\end{pmatrix}\implies \begin{cases}b=c+1\\{}\\a+c=b+1\end{cases}\implies \begin{cases}a=2\\{}\\b=1\\{}\\c=0\end{cases}$$
$$\implies u_1=\begin{pmatrix}2\\1\\0\end{pmatrix}\;,\;\;\text{so define}\;\;P:=\begin{pmatrix}0&2&0\\1&1&1\\1&0&\!\!-1\end{pmatrix}\implies P^{-1}=\frac14\begin{pmatrix}\!\!-1&2&2\\2&0&0\\\!\!-1&2&\!\!-2\end{pmatrix}$$
and now:
$$P^{-1}AP=\frac14\begin{pmatrix}\!\!-1&2&2\\2&0&0\\\!\!-1&2&\!\!-2\end{pmatrix}\begin{pmatrix}1 & 0 & 0 \\ 1 & 0 & 1 \\ 0 & 1 & 0 \end{pmatrix}\begin{pmatrix}0&2&0\\1&1&1\\1&0&\!\!-1\end{pmatrix}=\begin{pmatrix}1&1&0\\0&1&0\\0&0&\!\!-1\end{pmatrix}\implies$$
$$A^{30}=P\begin{pmatrix}1&1&0\\0&1&0\\0&0&\!\!-1\end{pmatrix}P^{-1}$$
You can now check that taking powers of the above quasi-diagonal matrix ( i.e., the Jordan Canonical Form for $\;A\;$) is very easy, though not as easy as with diagonal matrices, of course.
</s>