If $A$ is a $3 \times 3$ matrix with two eigenvalues $2$ and $-1$, and the respective eigenvectors $(1, 2, 0)$ and $(0, 0, 1)$, then what is the vector $A^3 (1, 2, 2)$?
I know the formula for finding the searched matrix is $M=PDP^{−1}$ where $D$ is the diagonal matrix whose diagonal elements are the eigenvalues, in the same order as the eigenvectors in $P$. But how to apply this formula for finding $3 \times 3$ matrix given two eigenvalues and the respective eigenvectors?
Hint:
Write $$\begin{pmatrix} 1\\ 2 \\ 2 \end{pmatrix} = \begin{pmatrix} 1\\ 2 \\ 0 \end{pmatrix} + 2 \begin{pmatrix} 0\\ 0 \\ 1 \end{pmatrix}$$
Now, apply $A^n v = \lambda^nv$ for any eigenvector $v$ of eigenvalue $\lambda$.