Factor $X^7 − 1$ into irreducibles in $\mathbb{Z}_{127}[X]$

Solution 1:

You are looking for the seventh roots of unity. In the algebraic closure of $\mathbb F_{127}$ they form a cyclic group of order $7$. Because $7$ is prime every element different from the neutral element (which is $1$) will generate the group. Since you've found already another root, namely $2$, you just need to compute the powers of $2$ and get everything. So you have $$X^7-1 = (X-1)(X-2)(X-4)(X-8)(X-16)(X-32)(X-64).$$