On Integer Matrices Obeying Certain Matrix Equations