TITLE: Is it possible to construct a matrix : $A^2 = J_{n}$.
QUESTION [5 upvotes]: Consider $\Omega = Mat_{n\times n}(\{0,1\})$ - space of matrices of $1$s and $0$s.  We want to determine does there exist $A\in\Omega$ : $A^2 = J_n$, where $J_n$ is a matrix of ones. We suppose that there are standard arithmetical operations : ($\mathbb{R}$,+,$\cdot)$.
Actually I don't understand how to step it. I've thought about using some properties about spectrum of $J_n$, but it looks like failure moment.

REPLY [7 votes]: Note that $spectrum(J_n)=\{0,\cdot,0,n\}$; consequently, $spectrum(A)=\{0,\cdots,0,\pm\sqrt{n}\}$ and, necessarily,  $trace(A)=\sqrt{n}$. Thus, $A$ may exist only when $n$ is a square. In this last case, $A$ exists
For $n=1$, $A=[1]$.
For $n=4$,

For $n=9$,

and so on...