Periodic matrices A square matrix $M$ such that $M^{k+1}=M$, for some positive integer $k$, is called a periodic matrix.


*

*Can we characterize the periodic matrices in $\mathcal{M}_n(\mathbb{Z})$?

*If we replace $\mathbb{Z}$ by an Euclidean domain?

*If we replace $\mathbb{Z}$ by a PID?

 A: It seems that they are those matrices which are conjugate via a unimodular integral matrix to a matrix of the form $\left( \begin{array}{clcr} 0 & A\\0 & B \end{array} \right),$ where $B$ is an invertible integral (square) matrix of finite order and $A$ is an arbitrary integral matrix. I think you just extend a $\mathbb{Z}$-basis of the pure submodule of integral vectors  with $Mv = 0$ to a basis for $\mathbb{Z}^{n}$ (as column space). Then it's just a matter of seeing what the matrix looks like with respect to that basis, and computing its powers. This argument works over any PID (so, in particular, over any Euclidean domain).
A: Geoff already gave a description. Here is a semigroup theory approach. $M^{k+1}=M$ means that $E=M^k$ is an idempotent,  $E^2=E$, and $EM=M=ME$. All idempotents in the matrix semigroup over $Z$ are easily described as matrices similar to diag$(0,...,0,1,1,...,1)$ (several 0's followed by several $1$'s) with unimodular conjugator. Hence we can assume that $E$ has that form. Therefore $M=EM=ME$ must have the form described in Geoff's answer. The same description holds for matrices over any ring if the structure of idempotents is similar to the above. 
 Edit.  As Geoff pointed out below, in fact since $EM=ME=M$, we get that the block $A$ in $M$ is 0, so $M$ looks like $$\left(\begin{array}{ll} 0&0\\\ 0 & B\end{array}\right)$$ where $B$ is an integer matrix with $B^k=1$. This is of course an "if and only if" description. I am pretty sure this has been known since the 50s, but I do not have time to dig it up. It should follow from the description of Green relations in the matrix semigroups.  
