Finding a $5\times5$ Matrix such that the sum of it and its inverse is a $5\times 5$ matrix with each entry $1$. How can I do this question:
Is it possible to find a $5 \times5$ invertible matrix $B$ over $\mathbb Z_2$ such that:
$B+B^{-1}=5\times5$ matrix where every element is $1$
anyway, I assume that the question requires a proof if such a matrix $B$ does not exist and working/solution(maybe?) if $B$ exists
Thanks!
 A: No, this isn't possible. Denote the all-one matrix by $E$. If $B+B^{-1}=E$, then $BE=B^2+I=EB$. Therefore $B^2+I$ has identical columns and identical rows. Hence either $B^2+I=0$ or $B^2+I=E$.


*

*In the first case, what is $BE$? Why is this case impossible?

*In the second case, what are $BE,\ B^{-1}E$ and $E(B+B^{-1})E$? How do they violate the condition that $B+B^{-1}=E$?

A: As user1551 did, let $E$ be the Attila matrix. When $n$ is odd, the equation $B+B^{-1}=E$ has no solutions. Yet, when $n$ is EVEN, there are.
Indeed, $E^2=0_n$, $rank(E)=1$ and $E$ is similar to $diag(J_2,0_{n-2})$ where $J_2$ is the nilpotent Jordan block of dimension $2$. If $\lambda\in spectrum(B)$, then $\lambda+1/\lambda=0$ and $\lambda=1$ is the sole solution in $K$, the algebraic closure of $\mathbb{F}_2$. Thus $B=I_n+N$ where $N$ is nilpotent and $E=(I+N)+(I-N+N^2-\cdots)=N^2-N^3+\cdots$; from $rank(E)=1=rank(N^2)$, we deduce that $N^3=0$ and $E=N^2$. Thus $B^2+I=BE=EB=E$; that is, when we assume that $B\in M_n(K)$, we obtain the same equations as when $B\in M_n(\mathbb{F}_2)$; of course, there are much more solutions over $K$.
For instance, for $n=4$, there are $12$ solutions over $\mathbb{F}_2$, including this one: $B=\begin{pmatrix}1&1&1&0\\1&1&0&1\\0&1&0&0\\1&0&0&0\end{pmatrix}$.
EDIT. About the equation $E=N^2$, the unknown $N$ must be similar to $diag(J_3,U_1,\cdots,U_p,0_{n-2p-3})$ where $U_i=J_2$.
