<s>[INST] Find the power of the matrix. Let $A = \left( {\begin{array}{*{20}{c}}
0&1&1\\
1&0&1\\
1&1&0
\end{array}} \right)$.
I want to find $A^k,$ where $k \in N$. So far I calculated $A^2, A^3, A^4,...$ but I can not see the general formula for $A^k$. Here are $A^2, A^3, A^4, A^5$.

Not sure if this leads to anything but I found the general formula for $B^k$, where $B = \left( {\begin{array}{*{20}{c}}
1&1&1\\
1&1&1\\
1&1&1
\end{array}} \right)$.
${B^k} = \left( {\begin{array}{*{20}{c}}
{{3^{k - 1}}}&{{3^{k - 1}}}&{{3^{k - 1}}}\\
{{3^{k - 1}}}&{{3^{k - 1}}}&{{3^{k - 1}}}\\
{{3^{k - 1}}}&{{3^{k - 1}}}&{{3^{k - 1}}}
\end{array}} \right)$
Thanks in advance.
 [/INST] Given matrix is real symmetric and hence diagonalisable. Hence $A=PDP^{-1}$. Thus $A^n$=$PD^nP^{-1}$ where P is the matrix of eigen vectors. D is diagonal and hence its powers are simply the powers of the eigenvalues which are $2,-1,-1$.
</s>