Compute the $n$-th power of triangular $3\times3$ matrix I have the following matrix
$$
\begin{bmatrix}
1 & 2 & 3\\
0 & 1 & 2\\
0 & 0 & 1
\end{bmatrix}
$$
and I am asked to compute its $n$-th power (to express each element as a function of $n$). I don't know at all what to do. I tried to compute some values manually to see some pattern and deduce a general expression but that didn't gave anything (especially for the top right). Thank you.

Let $I=\begin{pmatrix}1&0&0\\0&1&0\\0&0&1\end{pmatrix}$, $A=\begin{pmatrix}0&1&0\\0&0&1\\0&0&0\end{pmatrix}$ and $B=\begin{pmatrix}0&0&1\\0&0&0\\0&0&0\end{pmatrix}$. Then $M=I+2A+3B$.
You can prove that for any $n$, $M^n$ can be written as $M^n=\lambda_n I + a_n A + b_n B$ (because it's upper triangular and the symmetry along the ascending diagonal will remain).
So $M^{n+1}=M^nM=(\lambda_n I + a_n A + b_n B) (I + 2A + 3B) = \dots$
Using this, compute $\lambda_n$, and then $a_n$ and finally $b_n$.
