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.