Given a matrix $A$ find $A^n$.

You can use this too $$A=\begin{pmatrix}1&2\\0&1\end{pmatrix}=\begin{pmatrix}1&0\\0&1\end{pmatrix}+\begin{pmatrix}0&2\\0&0\end{pmatrix}$$ $$A=I_2+B$$ And B is a nilpotent matrix $\implies B^2=0$ $$A^n=(I_2+B)^n$$ Use binomial theorem


What you did was the smart approach. That is, you computed the first few terms of the sequence $(A^n)_{n\in\mathbb N}$ and you noticed a patern. The only thing that remains to be done is to prove that the pattern is real, but that's easy. Obviously,$$A^1=A=\begin{pmatrix}1&2\\0&1\end{pmatrix}$$and$$A^n=\begin{pmatrix}1&2n\\0&1\end{pmatrix}\implies A^{n+1}=A.\begin{pmatrix}1&2n\\0&1\end{pmatrix}=\begin{pmatrix}1&2(n+1)\\0&1\end{pmatrix}.$$


The minimal polynomial of $A$ is $(x-1)^2$ so for any entire function $f$ we have $$f(A) = f(1)P + f'(1)Q$$ for some $P, Q$ polynomials in $A$.

Plugging in $f \equiv 1$ and $f(x) = x$ we get $P = I$ and $Q = A-I$.

Therefore for $f(x) = x^n$ we have

$$A^n = 1^n\cdot I + n1^{n-1}\cdot (A-I) = I + n(A-I) = \begin{bmatrix} 1 & 2n \\ 0 & 1\end{bmatrix}$$