Showing that a matrix raised to a power is equal to itself Let $F$ be a field of cardinality $q=2^k$ for some $k \in \mathbb{N}$ and let
$$E= \begin{bmatrix}
1 & 0 & & & & & &\\
1 & 0 & & & & & &\\
& & \ddots & & & & & &\\
& & & 1 & 0 & & &\\
& & & 1 & 0 & & \\
& & & & & & 1 & 0 & a_{n-1}a_{n-2}\\
& & & & & & 1& 0 & a_{n-2} \\
& & & & & & & & 1+a_{n-1}
\end{bmatrix} \in M_n(F).$$
I want to show that $E^q=E.$
I was able to show for $q=2,4,8$ that
$$E^q= \begin{bmatrix}
1 & 0 & & & & & &\\
1 & 0 & & & & & &\\
& & \ddots & & & & & &\\
& & & 1 & 0 & & &\\
& & & 1 & 0 & & \\
& & & & & & 1 & 0 & a_{n-1}^qa_{n-2}\\
& & & & & & 1& 0 & a_{n-2} \\
& & & & & & & & 1+a_{n-1}^q
\end{bmatrix}$$
through brute force computation. This gives the desired result as $x^q=x$ in $F$. Note that this is not the case for $E^3, E^4, E^5, E^6, E^7.$
I want to generalize this for any $q=2^k$ and I have no idea how. Any help would be appreciated.
 A: Write $x=a_{n-1}$ and $y=a_{n-2}$ for notational ease. Let $M$ represent the matrix formed by the first $n-1$ columns of $E$ with zeroes in column $n$, and let $N=E-M$ be the $n$th column of $E$ with zeroes in the first $n-1$ columns. It is not hard to check that
$$M^2=M,\ N^2=(x+1)N,\ NM=0.$$
In particular, when we expand the sum $(M+N)^q$, all terms with an $NM$ vanish, so
\begin{align*}
(M+N)^q
&=\sum_{i=0}^q M^{q-i}N^i\\
&=M^q+N^q+\sum_{i=1}^{q-1} M^{q-i}N^i\\
&=M+(x+1)^{q-1}N+MN\sum_{i=1}^{q-1}(x+1)^{i-1}\\
&=M+(x+1)^{q-1}N+MN\left(\frac{(x+1)^{q-1}-1}x\right),
\end{align*}
where the last fraction is as a polynomial in $x$. We need to show that
$$(x+1)^{q-1}N+MN\left(\frac{(x+1)^{q-1}-1}x\right)=N,$$
which is equivalent to
$$MN\left(\frac{(x+1)^{q-1}-1}x\right)=N\left((x+1)^{q-1}-1\right).$$
If $x\neq 0,1$, this is true, since both sides are $0$. When $x=1$, we require that $MN=N$, which can be checked directly (we can find that $MN$ is $0$ everywhere except for the bottom of the last column, where it is $\dots 0,xy,xy,0$). When $x=0$, the right side is still $0$, so it suffices for $MN$ to be $0$, which is true.
