Is there anyway to do this with eigen vectors and eigen basis? So, say we have a square matrix A, and lets say that $A^2, A^3....$ so on are defined. Now If I want to find a general term $A^n$ is there any way to do that with eigen vectors. Take for example $A = \begin{bmatrix} 2 & 0 \\ 1 & -1\end{bmatrix}$. Like I would like to know if its possible to do it with eigen vectors instead of just trying to guess a pattern ? Like can we do something by converting the matrix into an eigen basis ?

In general:
$$A = TDT^{-1},$$
where $D$ is a diagonal matrix such that its diagonal entries correspond to the eigenvalues of $A$, and the columns of $T$ are the eigenvectors of $A$.
Starting from this, we get:
$$A^n = \underbrace{TDT^{-1} \cdot  TDT^{-1} \cdot \ldots \cdot TDT^{-1}}_{n~\text{times}}= \\
= T D (TT^-1) D (TT^-1) \ldots (TT^-1) D T^{-1}= \\
= T D I D I \ldots I D T^{-1} = \\
= T D^n T^{-1}.
$$
Notice that $D^n$ is a diagonal matrix such that its diagonal entries are the $n$-th power of the eigenvalues of $A$.
