Let ${\displaystyle A={\begin{pmatrix}-1 &0&\cdots &0 &1\\-1&0 &\cdots&0 &0\\0&-1 &\cdots&0 &0\\\vdots &\vdots &\vdots &\ddots &\vdots \\0&0&\cdots&-1&0 \end{pmatrix}}}\in \text{GL}(n,\mathbb{F}_q)$, where $\mathbb{F}_q$ is the finite field with $q$ elements and $n$ is a positive integer.
Question: compute $A^k$, for all $k \in \mathbb{N}$.
Attempt: I try to write $A$ as $P^{-1}BP$, but $A$ is not diagonalizable. Then I use mathematica to solve this problem for $n=4$ and $n=5$. It seems the following polynomial should be considered: $$x^n+x^{n-1}+(-1)^n=0.$$ But I don't know why.
Thanks for any replies.