An $n \times n$ matrix with rational entries such that $A^{n+1}=I$ I'm working on finding $A \in M_n(\mathbb{Q})$ such that $A^{n+1}=I$. If $n$ is odd, $A=-I$ satisfies the condition. When $n$ is even, clearly it should have eigenvalues $e^{2 \pi ik/(n+1)}(k=1,\cdots ,n)$ as a complex matrix. Now I proved this matrix should be similar to $\begin{pmatrix} R_\theta & 0 & \cdots & 0\\0&R_{2\theta} & \cdots &0\\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & R_{n\theta/2} \end{pmatrix} $, where $R_\theta = \begin{pmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{pmatrix}$ and $\theta = \frac{2\pi}{n+1}$. Unfortunately, however, $R_\theta$ is not rational if $n \ge 4$. Is there any other method?
 A: In general, we can take the companion matrix to the polynomial
$$
p(x) = x^n + x^{n-1} + \cdots + 1 = \frac{x^{n+1} - 1}{x - 1}
$$
That is, the matrix $A \in M_n(\Bbb Q)$ given by
$$
A = 
\pmatrix{
0&\cdots& &-1\\
1&0&\cdots&-1\\
&1&\ddots&\vdots \\
&&\ddots&-1
}
$$
will satisfy $A^{n+1} = I$
So, for example, you can verify that
$$
\pmatrix{
0&0&0&-1\\
1&0&0&-1\\
0&1&0&-1\\
0&0&1&-1
}^5 = 
\pmatrix{
1&0&0&0\\
0&1&0&0\\
0&0&1&0\\
0&0&0&1
}
$$
A: First step: decompose $x^{n+1}-1$ in irreducible polynomials of $\mathbb{Q}[x]$.


*

*About your example, we can generalize as follows: let $p$ be a prime number and let $A\in M_{p-1}(\mathbb{Q})$ s.t. $A^p=I_{p-1}$. One has $x^p-1=(x-1)cyclo(p,x)$. Thus the minimal polynomial of $A$ is $x-1$ and $A=I_4$ or $r(x)=cyclo(p,x)$ and $A$ is similar, over $\mathbb{Q}$, to $C_r$, that is the companion matrix of $r$.

*$A\in M_8(\mathbb{Q})$ s.t. $A^9=I_8$. One has $x^9-1=(x-1)(x^2+x+1)(x^6+x^3+1)$. The minimal polynomial of $A$ is $x-1$ and $A=I$ or $q(x)=x^2+x+1$ and $A\sim diag(C_q,C_q,C_q,C_q)$ or $q(x)r(x)=(x^2+x+1)(x^6+x^3+1)$ and $A\sim diag(C_q,C_r)$ or $(x-1)r(x)$ and $A\sim diag(1,1,C_r)$ or $(x-1)q(x)$ and [$A\sim diag(1,1,1,1,1,1,C_q)$ or $A\sim diag(1,1,1,1,C_q,C_q)$ or $A\sim diag(1,1,C_q,C_q,C_q)$].

*$A\in M_3(\mathbb{Q})$ s.t. $A^{4}=I_3$. One has $x^{4}-1=(x-1)(x+1)(x^2+1)$. The minimal polynomial of $A$ is $x-1$ and $A=I$ or $x+1$ and $A=-I$ or $x^2-1$ and $A$ is a symmetry or $(x-1)q(x)=(x-1)(x^2+1)$ and $A\sim diag(1,C_q)$ or $(x+1)q(x)$ and $A\sim diag(-1,C_q)$.
