Calculating $n$-th power of a matrix I was doing an exercise of a past exam in which one of the things I had to do was calculating the $n$th power of a Jordan matrix
$$J=\begin{pmatrix}
2 & 1 & 0 \\
0 & 2 & 1 \\
0 & 0 & 2
\end{pmatrix}.$$
I started calculating until the 5th power but I couldn't guess the expression for the $a_{1,2}$, $a_{1,3}$ and $a_{2,3}$ components. When I looked it up in an online calculator it showed that:
$$J^n=\begin{pmatrix}
2^n & \frac{2^n·n}{2} & \frac{2^n·(n^2-n)}{8} \\
0 & 2^n & \frac{2^n·n}{2} \\
0 & 0 & 2^n
\end{pmatrix}.$$
My question is: when the relationships are as difficult as these　(especially the $a_{1,3}$ component), are there any tricks for figuring out the$n$th power component? Because these kind of relationships are difficult to think in the middle of an exam.
 A: Hint :
$$\begin{pmatrix}
2 & 1 & 0 \\
0 & 2 & 1 \\
0 & 0 & 2
\end{pmatrix} = 2 I+\begin{pmatrix}
0 & 1 & 0 \\
0 & 0 & 1 \\
0 & 0 & 0
\end{pmatrix}$$
A: $J=2I+A$, where $A=\begin{pmatrix} 0&1&0 \\0&0&1 \\ 0&0&0\end{pmatrix}$. As $A$ and $I$ commute, we can apply the binomial formula.
Observe that  $A^2=\begin{pmatrix} 0&0&1 \\0&0&0 \\ 0&0&0\end{pmatrix}$, $A^k=0$ for $k\ge 3$, so the $n$-th power is
$$J^n=2^n I+n2^{n-1}A+\frac{n(n-1) 2^{n-2} }2A^2=2^n I+n2^{n-1}A+n(n-1) 2^{n-3}A^2. $$
A: Hint:
Expand
$$\begin{pmatrix}
a_{n+1} & b_{n+1} & c_{n+1} \\
0 & d_{n+1} & e_{n+1} \\
0 & 0 & f_{n+1}
\end{pmatrix}=\begin{pmatrix}
2 & 1 & 0 \\
0 & 2 & 1 \\
0 & 0 & 2
\end{pmatrix}\begin{pmatrix}
a_n & b_n & c_n \\
0 & d_n & e_n \\
0 & 0 & f_n
\end{pmatrix}$$
and contemplate the six linear recurrence relations you obtain. ($a,d,f$ are immediate.)

Additional hint:
The characteristic polynomial is $(2-\lambda)^3$ so the matrix has a triple Eigenvalue $2$, and you can expect the expressions of the elements of the powers to be in the form of $2^n$ times a quadratic polynomial in $n$.
