Find $M$, where $M^7=I$ and $M\neq I$, $M$ has only 0's and 1's. Find a $3 \times 3 $ matrix $M$ with entries 0 and 1 only such that $M^7=I$ and $M\neq I$.
This was a short question in a recent exam. I tried with permutation matrices but couldn't find $M^{odd}=I$ except for 3.
 A: There is no such matrix over $\mathbb{R}$. The matrix satisfies the polynomial $x^7−1$ which implies that the eigenvalues lie amongst the $7^{\text{th}}$ roots of unity and that the matrix is diagonalizable. This implies that the characteristic polynomial, being a real cubic, has either three real roots, or one real root and a conjugate root pair. 
If all roots are real then we must have $1$ repeated three times as the eigenvalues. Diagonalizability then forces $M=I$. 
If we have a conjugate root pair, say $\left(\omega, \overline{\omega}\right)$ and a real root (which is again $1$) then we know that 
$$1 + \omega + \overline{\omega} = 1 + 2\Re(\omega) = \mathrm{tr}(M)$$
But since $M$ has only $0$s and $1$s as entries this implies that the trace is integral and hence $2\Re(\omega)$ is integral. It is easy to check that this is impossible.
If you allow other fields then this is possible. As julien points out, if we work over $\mathbb{Z}/7\mathbb{Z}$ then 
$$M=\begin{pmatrix}1 & 0 & 1 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}$$
is a working example.
