On the matrices with constant determinant and permanent over roots of unity