# Property of cyclic codes

Let $C$ be a $[n,k]$ cyclic code over $\mathbb{F}_q$ with $(n,q)=1$.

I want to show that $(1, \dots, 1)$ is a codeword iff $X-1 \nmid g(X)$.

$g(x)$ is the generator polynomial.

We suppose that $(1, \dots, 1)$ is a codeword.

We consider the following correspondence

$$\pi: \mathbb{F}_q^n \to \mathbb{F}_q[x] / x^n-1, (a_0, a_1, \dots, a_{n-1}) \mapsto a_0+ a_1 x+ \dots+ a_{n-1} x^{n-1}$$

Then $(1, \dots, 1) \mapsto 1+ x+ \dots+ x^{n-1}$.

We want to show that $X-1 \nmid g(X)$.

Then $g(X)=b(X)(X-1)$ for some polynomial $b(X)$. How can we get a contradiction?

How can we show that if $X-1 \nmid g(X)$ then $(1, \dots, 1)$ is a codeword?

The word $(1,\ldots,1)$ is in your code iff there exists a polynomial $p(x)$ such that $$\frac{x^n-1}{x-1} = p(x) g(x).$$ Since the code is cyclic, $g(x)$ divides $x^n-1$, and so $(1,\ldots,1)$ is in your code iff there exists a polynomial $p(x)$ such that $$\frac{x^n-1}{g(x)} = p(x)(x-1).$$ In other words, $(1,\ldots,1)$ is in your code iff $$x-1 \mid \frac{x^n-1}{g(x)}.$$ I'll let you complete the proof, using the fact that $x-1$ divides $x^n-1$ but not $\frac{x^n-1}{x-1}$.