If $A=\begin{bmatrix}2&1&1\\0&1&0\\1&1&2\end{bmatrix}$, find $A^8-5A^7+7A^6-3A^5+A^4-5A^3+8A^2-2A+I$ 
If $A=\begin{bmatrix}2&1&1\\0&1&0\\1&1&2\end{bmatrix}$, find $A^8-5A^7+7A^6-3A^5+A^4-5A^3+8A^2-2A+I$

Attempt $1:$ $A=I+B$, where $B=\begin{bmatrix}1&1&1\\0&0&0\\1&1&1\end{bmatrix}$
$B^n$ comes out to be $2^{n-1}B$
After that I tried doing $A^8=(I+B)^8$ and then opening RHS with binomial. But it didn't help.
Attempt $2:$ Finding characteristic equation and putting $A$ in it. It didn't help either.
The equation I got here is $A^3-5A^2+7A-3I=0$
Note: Concept of minimal polynomial is not in syllabus. Also, if we can do this without characteristic polynomial, that would be great.
 A: We have, $$A=\begin{bmatrix}2&1&1\\0&1&0\\1&1&2\end{bmatrix}$$
According to Caley-Hamilton Theorem,
$$|A - \lambda I| = 0$$
So we have,
$$A - \lambda I = \begin{bmatrix}2&1&1\\0&1&0\\1&1&2\end{bmatrix} - \lambda \begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix} = \begin{bmatrix}2 - \lambda&1&1\\0&1 - \lambda &0\\1&1&2 - \lambda\end{bmatrix}$$
Now,
$$|A - \lambda I|  = 0 $$$$\implies \begin{vmatrix}2 - \lambda&1&1\\0&1 - \lambda &0\\1&1&2 - \lambda\end{vmatrix}  = 0$$$$\implies \lambda^3 - 5\lambda^2 + 7 \lambda - 3 = 0\tag{1}$$
Now, since every matrix is the root of its Eigen matrix, we have:
$$A^3 - 5A^2 + 7A  - 3 = 0 \tag{2}$$
Now consider,
$$A^8-5A^7+7A^6-3A^5+A^4-5A^3+8A^2-2A+I$$
$$ = (A^3- 5A^2  + 7A - 3) (A^5 + A) + (A^2 + A + I) $$
Using equation $(2)$ this equation will be changed into,
$$ (0) (A^5 + A) + (A^2 + A + I) $$
$$ =  (A^2 + A + I)$$
Now put values of $A^2, A$ and $I$, it will be done!

Factorization step:
$$A^8-5A^7+7A^6-3A^5+A^4-5A^3+8A^2-2A+I$$
$$A^5(A^3-5A^2+7A-3) +A^4-5A^3+8A^2-2A+I$$
$$A^5(A^3-5A^2+7A-3) +A^4-5A^3+7A^2 + A^2 - 3A + A+I$$
$$A^5(A^3-5A^2+7A-3) +A^4-5A^3+7A^2- 3A  + A^2 + A+I$$
$$A^5\underbrace{(A^3-5A^2+7A-3)} +A\underbrace{(A^3-5A^2+7A - 3)} + A^2 + A+I$$
$$(A^5 + A)(A^3-5A^2+7A-3) + (A^2 + A+I)$$
A: Hint:
$$A^5(A^3-5A^2+7A-3I)+A(A^3-5A^2+7A-3I)+A^2+A+I=\cdots$$
A: Following your attempt 1 and using
$$\begin{cases}
A-I &= B\\
B^2 &= 2B
\end{cases}$$ you get that
$A^2-4A + 3I=0$, i.e. that $q(A)=0$ where $q(x) = x^2-4x +3$. You want to get $p(A)$ where $p(x)=x^8-5x^7+7x^6-3x^5+x^4-5x^3+8x^2-2x+1$.
Performing the long division of $p$ by $q$ you get
$$p(x) = (x^6-x^5+x^2-x+1)q(x) + 5x-2.$$
Hence $$p(A)= 5A-2I=5B + 3I=\begin{bmatrix}8&5&5\\0&3&0\\5&5&8\end{bmatrix}$$
Note: when you'll learn the minimum polynomial, you'll be able to see that $q$ is the minimal polynomial of $A$. However, the notion is not required for the question.
