Consider the matrix given as $$A=\begin{bmatrix}a_0 & a_2 & a_1\\ a_1 & a_0 & a_2\\ a_2 & a_1 & a_0\end{bmatrix}$$ Write a formula for $A^n$ for $n\in\mathbb{N}$.
$$$$
My attempt: The first that comes to mind is to diagonalize it and hence find the formula for $A^n$, but that is very messy, so I tried to do something else it goes as:
bserve that $$A=\begin{bmatrix}a_0 & a_2 & a_1\\ a_1 & a_0 & a_2\\ a_2 & a_1 & a_0\end{bmatrix}=a_0\begin{bmatrix}1 & 0 & 0\\0 & 1 & 0\\0 & 0 & 1\end{bmatrix}+a_1\begin{bmatrix}0 & 0 & 1\\1 & 0 & 0\\0 & 1 & 0\end{bmatrix}+a_2\begin{bmatrix}0 & 1 & 0\\0 & 0 & 1\\1 & 0 & 0\end{bmatrix}$$
Let $U=\begin{bmatrix}0 & 0 & 1\\1 & 0 & 0\\0 & 1 & 0\end{bmatrix}$ then we will have that $$\begin{matrix}U^2=\begin{bmatrix}0 & 1 & 0\\0 & 0 & 1\\1 & 0 & 0\end{bmatrix} & \text{ and } & U^3=\begin{bmatrix}1 & 0 & 0\\0 & 1 & 0\\0 & 0 & 1\end{bmatrix}\end{matrix}$$
Hence we have $A=a_0I+a_1U+a_2U^2 = a_0U^3+a_1U+a_2U^2=(a_0U^2+a_1I+a_2U)U$
This got me thinking that there might be an easy way to solve the above problem, but I could not make any further progress.
Please Help and thanks in advance.