Ternary Hamming code as a cyclic code (source code)

= Ternary Hamming code as a cyclic code
{title2=$g(X)=\prod_{j=0}^{s-1}(X-\alpha^{3^j})$}

For odd $s\geq3$, put $n=(3^s-1)/2$ and choose $\alpha$ of order $n$ in $\mathbb F_{3^s}$. Because $n$ is odd, the powers $\alpha^i$, $0\leq i<n$, represent every projective point once. The <cyclic code> defined by $c(\alpha)=0$ is therefore monomially equivalent to a <ternary Hamming code>, with the displayed <generator polynomial of a cyclic code>. This statement requires a qualification: at $s=2$, every ternary cyclic length-four, dimension-two code has a weight-two generator, so none has <Hamming distance> three.