Solution
= Solution
A cyclic code is a linear subspace invariant under cyclic coordinate shift. Identifying words with $\mathbb F_2[X]/(X^n-1)$ makes such codes exactly <ideals>. Since this quotient is a principal <ideal> <ring>, every code is generated uniquely by a monic divisor of $X^n-1$. For $n=7$,
$$
X^7-1=(X+1)(X^3+X+1)(X^3+X^2+1),
$$
so its three distinct irreducible factors have $2^3=8$ monic divisors and there are eight cyclic codes.