1 Introduction

A code of length \(n\) and dimension \(k\) over a finite field \({\mathbb {F}}_q\) is a linear \(k\)-dimensional subspace of \({\mathbb {F}}_q^n\). A \([n,k]_q\)-code \(\mathcal C\) is called cyclic if it is invariant by the shift permutation, i.e., if \((a_1,a_2,\dots ,a_n)\in \mathcal C\) then the shift \((a_n,a_1,\ldots ,a_{n-1})\) is also in \(\mathcal C\). The cyclic code \(\mathcal C\) can be viewed as an ideal in the group algebra \({\mathbb {F}}_qC_n\), where \(C_n\) is the cyclic group of order \(n\). We note that \({\mathbb {F}}_qC_n\) is isomorphic to \(\mathcal R_n=\frac{{\mathbb {F}}_q[x]}{\langle x^n-1\rangle }\) and since subspaces of \(\mathcal R_n\) are ideals and \(\mathcal R_n\) is a principal ideal domain, it follows that each ideal is generated by a polynomial \(g(x)\in {\mathcal {R}}_n\), where \(g\) is a divisor of \(x^n-1\).

Codes generated by a polynomial of the form \(\frac{x^n-1}{g(x)}\), where \(g\) is an irreducible factor of \(x^n-1\), are called minimal cyclic codes. Thus, each minimal cyclic code is associated of natural form with an irreducible factor of \(x^n-1\) in \({\mathbb {F}}_q[x]\). An example of minimal cyclic code is the Golay code that was used on the Mariner Jupiter-Saturn Mission (see [7]), the BCH code used in communication systems like VOIP telephones and Reed–Solomon code used in two-dimensional bar codes and storage systems like compact disc players, DVDs, disk drives, etc (see [5, Sects. 5.8 and 5.9]). The advantage of the cyclic codes, with respect to other linear codes, is that they have efficient encoding and decoding algorithms (see [5, Sect. 3.7]).

For each element of \(g\in {\mathcal {R}}_n\), \(\omega (g)\) is defined as the number of non-zero coefficients of \(g\) and is called the Hamming weight of the word \(g\). Denote by \(A_j\) the number of codewords with weight \(i\) and by \(d=\min \{i>0| A_i\ne 0\}\) the minimum distance of the code. A \([n,k]_q\)-code with minimum distance \(d\) will be denoted by \([n,k,d]_q\)-code. The sequence \(\{A_i\}_{i=0}^n\) is called the weight distribution of the code and \(A(z):=\sum _{i=0}^n A_iz^i\) is its weight enumerator. The importance of the weight distribution is that it allows us to measure the probability of non-detecting an error of the code: For instance, the probability of undetecting an error in a binary symmetric channel is \(\sum \limits _{i=0}^n A_i p^i(1-p)^{n-i}\), where \(p\) is the probability that, when the transmitter sends a binary symbol (\(0\) or \(1\)), the receptor gets the wrong symbol.

The weight distribution of irreducible cyclic codes has been determined for a small number of special cases. For a survey about this subject see [3, 4] and their references.

In this article, we show all the possible weight distributions of length \(n\) over a finite field \({\mathbb {F}}_q\) in the case that every prime divisor of \(n\) divides \(q-1\).

2 Preliminaries

Throughout this article, \({\mathbb {F}}_q\) denotes a finite field of order \(q\), where \(q\) is a power of a prime, \(n\) is a positive integer such that \(\text{ gcd }(n,q)=1\), \(\theta \) is a generator of the cyclic group \({\mathbb {F}}_q^*\) and \(\alpha \) is a generator of the cyclic group \({\mathbb {F}}_{q^2}^*\) such that \(\alpha ^{q+1}=\theta \). For each \(a\in {\mathbb {F}}_q^*\), \(\mathop {\mathrm{ord}}\nolimits _q a\) denotes the minimal positive integer \(k\) such that \(a^k=1\), for each prime \(p\) and each integer \(m\), \(\nu _p(m)\) denotes the maximal power of \(p\) that divides \(m\) and \(\mathop {\mathrm{rad}}(m)\) denotes the radical of \(m\), i.e., if \(m=p_1^{\alpha _1}p_2^{\alpha _2},\ldots , p_l^{\alpha _l}\) is the factorization of \(m\) in prime factors, then \(\mathop {\mathrm{rad}}(m)=p_1p_2,\ldots , p_l\). Finally, \(a_{_{\div b}}\) denotes the integer \(\frac{a}{\gcd (a,b)}\).

Since each irreducible factor of \(x^n-1\in {\mathbb {F}}_q[x]\) generates an irreducible cyclic code of length \(n\), then a fundamental problem of code theory is to characterize these irreducible factors. The problem of finding a “generic algorithm” to split \(x^n-1\) in \({\mathbb {F}}_q[x]\), for any \(n\) and \(q\), is an open one and only some particular cases are known. Since \(x^n-1=\prod _{d|n} \varPhi _d(x)\), where \(\varPhi _d(x)\) denotes the \(d\)-th cyclotomic polynomial (see [8] Theorem 2.45), it follows that the factorization of \(x^n-1\) strongly depends on the factorization of the cyclotomic polynomial that has been studied by several authors (see [6, 9, 11] and [2]).

In particular, a natural question is to find conditions in order to have all the irreducible factors binomials or trinomials. In this direction, some results are the following ones

Lemma 1

[1, Corollary 3.3] Suppose that

  1. 1.

    \(\mathop {\mathrm{rad}}(n)|(q-1)\) and

  2. 2.

    \(8\not \mid n\) or \(q\not \equiv 3 \pmod 4\).

Then the factorization of \(x^n-1\) in irreducible factors of \({\mathbb {F}}_q[x]\) is

$$\begin{aligned} \prod _{t|m}{\mathop {\mathop {\prod }\limits _{{1\le u\le \gcd (n,q-1)}}}\limits _{\gcd (u,t)=1}} (x^t-\theta ^{ul}), \end{aligned}$$

where \(m=n_{_{\div (q-1)}}\) and \(l=(q-1)_{_{\div n}}\). In addition, for each \(t\) such that \(t|m\), the number of irreducible factors of degree \(t\) is \(\frac{\varphi (t)}{t}\cdot \gcd (n,q-1)\), where \(\varphi \) denotes the Euler Totient function.

Lemma 2

[1, Corollary 3.6] Suppose that

  1. 1.

    \(\mathop {\mathrm{rad}}(n)|(q-1)\) and

  2. 2.

    \(8\mid n\) and \(q\equiv 3 \pmod 4\).

Then the factorization of \(x^n-1\) in irreducible factors of \({\mathbb {F}}_q[x]\) is

$$\begin{aligned} {\mathop {\mathop {\prod }\limits _{t|m'}}\limits _{t\mathrm{odd}}}{\mathop {\mathop {\prod }\limits _{{1\le w\le \gcd (n,q-1)}}} \limits _{\gcd (w,t)=1}} (x^t-\theta ^{wl})\cdot \prod _{t|m'}\prod _{ u\in {\mathcal {S}}_t} \Big (x^{2t}-(\alpha ^{ul'}+\alpha ^{qul'})x^t+\theta ^{ul'}\Big ), \end{aligned}$$

where \(m'=n_{_{\div (q^2-1)}}\) and \(l=(q-1)_{_{\div n}}\), \(l'=(q^2-1)_{_{\div n}}\), \(r=\min \{\nu _2(\frac{n}{2}),\nu _2(q+1)\}\) and \({\mathcal {S}}_t\) is the set

$$\begin{aligned} \left\{ u\in {\mathbb {N}}\left| \begin{array}{l}{1\le u\le \gcd (n, q^2-1), \gcd (u,t)=1} \\ {2^r\not \mid u \text { and }\ u< \{qu\}_{\gcd (n,q^2-1))}}\end{array}\right. \right\} , \end{aligned}$$

where \(\{a\}_b\) denotes the remainder of the division of \(a\) by \(b\), i.e., it is the number \(0\le c<b\) such that \(a\equiv c\pmod b\) .

Moreover, for each \(t\) odd such that \(t|m'\), the number of irreducible binomials of degree \(t\) and \(2t\) is \(\dfrac{\varphi (t)}{t}\cdot \gcd (n,q-1)\) and \(\dfrac{\varphi (t)}{2t}\cdot \gcd (n,q-1)\) respectively, and the number irreducible trinomials of degree \(2t\) is

$$\begin{aligned} {\left\{ \begin{array}{ll} \dfrac{\varphi (t)}{t}\cdot 2^{r-1} \gcd (n,q-1),&{} \quad \text {if } t \text { is even}\\ \dfrac{\varphi (t)}{t}\cdot (2^{r-1}-1) \gcd (n,q-1),&{} \quad \text {if } t \text { is odd}. \end{array}\right. } \end{aligned}$$

3 Weight distribution

Throughout this section, we assume that \(\mathop {\mathrm{rad}}(n)\) divides \(q-1\) and \(m\), \(m'\) \(l\), \(l'\) and \(r\) are as in the Lemmas 1 and 2. The following results characterize all the possible cyclic codes of length \(n\) over \({\mathbb {F}}_q\) and show explicitly the weight distribution in each case.

Theorem 1

If \(8\not \mid n\) or \(q\not \equiv 3 \pmod 4\), then every irreducible code of length \(n\) over \({\mathbb {F}}_q\) is an \([n, t, \frac{n}{t}]_q\)-code where \(t\) divides \(m\) and its weight enumerator is

$$\begin{aligned} A(z)=\sum _{j=0}^{t} {t\atopwithdelims ()j}(q-1)^j z^{j\frac{n}{t}}=\Big (1+(q-1)z^{\frac{n}{t}}\Big )^t. \end{aligned}$$

Proof

As a consequence of Lemma 1, every irreducible factor of \(x^n-1\) is of the form \(x^t-a\) where \(t|n\) and \(a^{n/t}=1\), so every irreducible code \(\mathcal C\) of length \(n\) is generated by a polynomial of the form

$$\begin{aligned} g(x)=\frac{x^n-1}{x^t-a}=\sum _{j=0}^{n/t-1} a^{\frac{n}{t}-1 -j} x^{t j} \end{aligned}$$

and \(\{g(x), xg(x), \dots , x^{t-1}g(x)\} \) is a basis of the \({\mathbb {F}}_q\)-linear subspace \(\mathcal C\). Thus, every codeword in \(\mathcal C\) is of the form \(a_0g+a_1xg+\cdots +a_{t -1} x^{t-1}g \), with \(a_j\in {\mathbb {F}}_q\) and

$$\begin{aligned} \omega \left( a_0g+a_1xg+\cdots +a_{t -1} x^{t-1}g\right) = \omega (a_0g)+ \omega (a_1xg)+\cdots + \omega \left( a_{t -1} x^{t-1}g\right) . \end{aligned}$$

Since \(\omega (g)=\frac{n}{t}\), it follows that

$$\begin{aligned} \omega \left( a_0g+a_1xg+\cdots +a_{t -1} x^{t-1}g\right) =\frac{n}{t} \#\{j| a_j\ne 0\}. \end{aligned}$$

Clearly we have \({A}_k = 0\), for all \(k\) that is not divisible by \(\frac{n}{t}\). On the other hand, if \(k = j\frac{n}{t}\), then exactly \(j\) elements of this base have non-zero coefficients in the linear combination and each non-zero coefficient can be chosen of \( q-1 \) distinct forms. Hence \({A}_k = {t \atopwithdelims ()j} (q-1)^ j. \) Then the weight distribution is

$$\begin{aligned} A_k = {\left\{ \begin{array}{ll} 0, &{} \quad \hbox {if } t \not \mid k \\ {t \atopwithdelims ()j}(q-1)^j, &{} \quad \hbox {if }k = j\frac{n}{t}, \end{array}\right. } \end{aligned}$$

as we want to prove. \(\square \)

Remark 1

The previous result generalizes Theorem 3 in [10] (see also Theorem 22 in [4]).

Remark 2

As a direct consequence of Lemma 1, for all positive divisor \(t\) of \(m\), there exist \(\frac{\varphi (t)}{t} \gcd (n,q-1)\) irreducible cyclic \([n,t,\frac{n}{t}]_q\)-codes.

In order to find the weight distribution in the case that \(q\equiv 3 \pmod 4\) and \(8|n\), we need some additional lemmas.

Lemma 3

Let \(t\) be a positive integer such that \(t\) divides \(m'\) and assume that \(q\equiv 3 \pmod 4\) and \(8\not \mid n\). If \(x^{2t}-(a+a^q)x^t+a^{q+1} \in {\mathbb {F}}_q[x] \) is an irreducible trinomial, where \(a=\alpha ^{ul'}\in {\mathbb {F}}_{q^2}\), and \(g(x)\) is the polynomial \( \dfrac{x^{n}-1}{x^{2t}-(a + a^q)x^t + a^{q+1}}\in {\mathbb {F}}_q[x]\), then \(\nu _2(u)\le r-2\) and

$$\begin{aligned} \omega (g(x)-\lambda x^tg(x))={\left\{ \begin{array}{ll} \frac{n}{t}\left( 1-\frac{1}{2^{r-\nu _2(u)} }\right) ,&{} \quad \text {if }\, \lambda \in \Lambda _u\\ \frac{n}{t},&{} \quad \text {if }\, \lambda \notin \Lambda _u, \end{array}\right. } \end{aligned}$$

where \(\Lambda _u=\left\{ \left. \dfrac{a^{i}-a^{qi}}{a^{i+1} - a^{q(i+1)}} \right| i=0,1,\ldots , 2^{r-\nu _2(u)}-2\right\} \).

Proof

Since \(x^{2t}-(a+a^q)x^t+a^{q+1} \) is an irreducible trinomial in \({\mathbb {F}}_q[x]\), then \(\gcd (t,u)=1\), \(2^r\not \mid u\) and \(a\ne -a^q\). In particular, \(\mathop {\mathrm{ord}}\nolimits _{q^2} a\) does not divide either \(q-1\) or \(2(q-1)\). Observe that

$$\begin{aligned}\mathop {\mathrm{ord}}\nolimits _{q^2} a&=\frac{q^2-1}{\gcd ( q^2-1, ul')}=\frac{q^2-1}{\gcd \left( q^2-1, u \frac{q^2-1}{\gcd (q^2-1,n)}\right) }\\&=\frac{\gcd (q^2-1, n)}{\gcd (q^2-1,n,u)}\\&=\frac{2^r\gcd (q-1, n)}{\gcd ( 2^r(q-1),n,u)}, \end{aligned}$$

and for each odd prime \(p\), we have

$$\begin{aligned} \nu _p\left( \frac{2^r\gcd (q-1, n)}{\gcd ( 2^r(q-1),n,u)}\right) \le \nu _p(\gcd (q-1, n))\le \nu _p(q-1). \end{aligned}$$
(1)

Therefore, \(\mathop {\mathrm{ord}}\nolimits _{q^2} a\not \mid 2(q-1)\) implies that \(\nu _2(\mathop {\mathrm{ord}}\nolimits _{q^2} a)>\nu _2(2(q-1))=2\), and since

$$\begin{aligned} \nu _2 \left( \frac{2^r\gcd (q-1, n)}{\gcd ( 2^r(q-1),n,u)}\right)&=r+1-\min \Big \{\nu _2(\gcd ( 2^r(q-1),n)),\nu _2(u))\Big \}\\&=r+1-\min \{r+1,\nu _2(u))\}=r+1-\nu _2(u), \end{aligned}$$

we conclude that \(\nu _2(u)\le r-2\).

On the other hand

$$\begin{aligned} g(x)&= \frac{x^{n}-1}{x^{2t} - (a + a^q)x^t + a^{q+1}}\\&= \frac{x^{n}-1}{a-a^q}\left( \frac{1}{x^t-a} - \frac{1}{x^t-a^q} \right) \\&= \displaystyle {\sum _{j=1}^{n/t-1}\left( \frac{a^{j}-a^{qj}}{a-a^q}\right) x^{ n-t-tj} },\\ \end{aligned}$$

is a polynomial whose degree is \(n-2t\) and every non-zero monomial is such that its degree is divisible by \(t\). Now, suppose that there exist \(1\le i<j\le \frac{n}{t} -2\) such that the coefficients of the monomials \(x^{n-t-jt}\) and \(x^{n-t-it}\) in the polynomial \(g_{\lambda }:=g(x)-\lambda x^t g(x)\) are simultaneously zero. Then

$$\begin{aligned} \frac{a^{j} - a^{qj}}{a - a^q} = \lambda \frac{a^{j+1} - a^{q(j+1)}}{a - a^q} \quad \hbox {and}\quad \frac{a^{i} - a^{qi}}{a - a^q} = \lambda \frac{a^{i+1} - a^{q(i+1)}}{a - a^q} . \end{aligned}$$

So, in the case of \(\lambda \ne 0\), we have

$$\begin{aligned} \lambda = \frac{a^{j}-a^{qj}}{a^{j+1} - a^{q(j+1)}} = \frac{a^{i}-a^{qi}}{a^{i+1} - a^{q(i+1)}}. \end{aligned}$$

This last equality is equivalent to \( a^{(q-1)(j-i)} = 1\), i.e., \(\mathop {\mathrm{ord}}\nolimits _{q^2} a\) divides \((q-1)(j-i)\). In the case of \(\lambda =0\), we obtain that \(\mathop {\mathrm{ord}}\nolimits _{q^2} a\) divides \((q-1)j\) and \((q-1)i\) by the same argument. Therefore, we can treat this case as a particular case of the above one making \(i = 0\). It follows that \(\frac{2^r\gcd (q-1, n)}{\gcd ( 2^r(q-1),n,u)}\) divides \((q-1)(j-i)\).

So, by Eq. (1), the condition \(\mathop {\mathrm{ord}}\nolimits _{q^2} a|(q-1)(j-i)\) is equivalent to

$$\begin{aligned} \nu _2 \left( \frac{2^r\gcd (q-1, n)}{\gcd ( 2^r(q-1),n,u)}\right) =r+1-\nu _2(u)\le \nu _2((p-1)(j-i))=1+\nu _2(j-i), \end{aligned}$$

and thus \(2^{r-\nu _2(u)}|(j-i)\).

In other words, if the coefficient of the monomial of degree \(n-t-it\) is zero, then all the coefficients of the monomials of degree \(n-t-jt\) with \(j\equiv i\pmod {2^{r-\nu _2(u)}} \) are zero. Thus, if \(\lambda \notin \Lambda _u\), then any coefficient of the form \(x^{tj}\) is zero and the weight of \(g_{\lambda }\) is \(\frac{n}{t}\). Otherwise, exactly \(\frac{n}{t}\cdot \frac{1}{2^{r-\nu _2(u)}}\) coefficients of the monomials of the form \(x^{tj}\) are zero, then the weight of \(g_{\lambda }\) is \(\frac{n}{t}(1-\frac{1}{2^{r-\nu _2(u)}})\), as we want to prove. \(\square \)

Corollary 1

Let \(g\) be a polynomial in the same condition of Lemma 3. Then

$$\begin{aligned} \# \left\{ (\mu ,\lambda ) \in {\mathbb {F}}_q^2 \left| \omega (\mu g(x) + \lambda x^{t}g(x)) = \dfrac{n}{t}\left( 1- \frac{1}{2^{r-\nu _2(u)}}\right) \right. \right\} = 2^{r-\nu _2(u)}(q-1). \end{aligned}$$

Proof

If \(\mu = 0\) and \(\lambda \ne 0\), then \(\omega (\lambda x^{t}g(x)) = \frac{n}{t}(1-\frac{1}{2^{r-\nu _2(u)}})\) and we have \((q-1)\) ways to choose \(\lambda \).

Suppose that \(\mu \ne 0\), then \(\omega (\mu g(x) + \lambda x^{t}g(x)) = \omega (g(x) + \frac{\lambda }{\mu }x^{t}g(x)),\) i.e., the weight only depends on the quotient \( \frac{\lambda }{\mu }\). By Lemma 3, there exist \(2^{r-\nu _2(u)}-1\) values of \( \frac{\lambda }{\mu }\) such that \(g(x) + \frac{\lambda }{\mu } x^tg(x)\) has weight \(\frac{n}{t}(1-\frac{1}{2^{r-\nu _2(u)}})\), so we have \((q-1)(2^{r-\nu _2(u)}-1)\) pairs of this type. \(\square \)

Theorem 2

If \(8|n\) and \(q\equiv 3 \pmod 4\), then every irreducible code of length \(n\) over \({\mathbb {F}}_q\) is one of the following class:

  1. (a)

    A \([n, t, \frac{n}{t}]_q\)-code, where \(4\not \mid t\), \(t|m'\) and its weight enumerator is

    $$\begin{aligned} A(z)=\sum _{j=0}^{t} {t \atopwithdelims ()j}(q-1)^j z^{j \frac{n}{t}}=\Big (1+(q-1)z^{\frac{n}{t}}\Big )^t. \end{aligned}$$
  2. (b)

    A \([n,2t, d ]_q\)-code, where \(t|m'\), \(d=\frac{n}{t}(1-\frac{1}{2^{r-\nu _2(u)}})\), \(0\le u\le r-2\) and its weight enumerator is

    $$\begin{aligned} A(z)=\left( 1+2^{r-\nu _2(u)}(q-1)z^d+(q-1)(q+1-2^{r-\nu _2(u)})z^{\frac{n}{t}}\right) ^t. \end{aligned}$$

    In particular, if \(\frac{n}{t2^{r-\nu _2(u)}}\not \mid k\), then \(A_k=0\).

Proof

Observe that every irreducible code is generated by a polynomial of the form \(\frac{x^n-1}{x^t-a}\), where \(a\in {\mathbb {F}}_q\), or a polynomial of the form \(g(x)=\frac{x^n-1}{(x^t-a)(x^t-a^q)}\), where \(a\) satisfies the condition of Lemma 3. In the first case, the result is the same as Theorem 1. In the second case, each codeword is of the form

$$\begin{aligned} \sum _{j=0}^ {2t-1} \lambda _j x^j g(x)=\sum _{j=0}^{t-1} h_j, \end{aligned}$$

where \(h_j=\lambda _j x^jg(x)+\lambda _{t+j} x^{t+j}g(x)\). Since, for \(0\le i<j\le t-1\), the polynomial \(h_i\) and \(h_j\) do not have non-zero monomials of the same degree, it follows that

$$\begin{aligned} \omega \left( \sum _{j=0}^{t-1} h_j\right) =\sum _{j=0}^{t-1} \omega (h_j). \end{aligned}$$

By Lemma 3, \(h_j\) has weight \(\frac{n}{t}\), \(d\) or \(0\), for all \(j = 0, \dots , t-1\). For each \(j=0,1,\dots ,t-1\), there exist \((q^2-1)\) non-zero pairs \((\lambda _j, \lambda _{j+t})\) , and by Corollary 1, we know that there exist \(2^{r-\nu _2(u)}(q-1)\) pairs with weight \(d\). Therefore, there exist

$$\begin{aligned} q^2-1 -2^{r-\nu _2(u)} (q-1) = (q-1)(q+1-2^{r-\nu _2(u)}) \end{aligned}$$

pairs with weight \(\frac{n}{t}\).

So, in order to calculate \(A_k\), we need to select the polynomials \(h_l\)’s which have weight \(d=\frac{n}{t}(1-\frac{1}{2^{r-\nu _2(u)}})\) and those ones which have weight \(\frac{n}{t}\) in such a way that the total weight is \(k\).

If we chose \(i\) of the first type and \(j\) of the second type, the first \(h_l\)’s can be chosen by \( {t \atopwithdelims ()i}(2^{r-\nu _2(u)}(q-1))^i\) ways and for the other \(t-i\) ones, there are \( {{t-i} \atopwithdelims ()j}((q-1)(q+1-2^{r-\nu _2{u}}))^j\) ways of choosing \(j\) with weight \(\frac{n}{t}\). The remaining \(h_j\)’s have weight zero. Therefore

$$\begin{aligned} A_k = {\mathop {\mathop {\sum }\limits _{k = di + \frac{n}{t}j}}\limits _{0\le i+ j\le t}}{t \atopwithdelims ()i}\left( 2^{r-\nu _2(u)}(q-1)\right) ^i{{t-i} \atopwithdelims ()j}\left( (q-1)(q+1-2^{r-\nu _2(u)})\right) ^j,\\ \end{aligned}$$

and

$$\begin{aligned} A(z)&=\sum _{0\le i+ j\le t}{t \atopwithdelims ()i,j}\left( 2^{r-\nu _2(u)}(q-1)z^d\right) ^i\left( (q+1-2^{r-\nu _2(u)})(q-1)z^{\frac{n}{t}}\right) ^j\\&=\left( 1+2^{r-\nu _2(u)}(q-1)z^d+(q-1)(q+1-2^{r-\nu _2(u)})z^{\frac{n}{t}}\right) ^t. \end{aligned}$$

In particular, the minimum distance is \(d\) and every non-zero weight is divisible by \(\gcd (d,\frac{n}{t})=\frac{n}{t2^{r-\nu _2(u)}}\). \(\square \)

Remark 3

As a direct consequence of Lemma 2, for all positive divisor \(t\) of \(m'\), there exist \(2^{r-1-\nu _2(u)}\frac{\varphi (t)}{t} \gcd (n,q-1)\) irreducible cyclic \([n,t,d]_q\)-codes if \(t\) is odd, and \(2^{r-1}\frac{\varphi (t)}{t} \gcd (n,q-1)\) irreducible cyclic \([n,2t,\frac{n}{t}(1-\frac{1}{2^r})]_q\)-codes if \(t\) is even.

Example 1

Let \(q=31\) and \(n=288=2^5\times 3\). Then \(m'=3\), \(l'=10\), \(r=4\). If \(h(x)\) denotes a irreducible factor of \(x^{288}-1\), then \(h(x)\) is a binomial of degree \(1\), \(2\), \(3\) or \(6\), or a trinomial of degree \(2\) or \(6\). The irreducible codes generated by \(\frac{x^{n}-1}{h(x)}\) (and therefore parity check polynomial is \(h\)), and its weight enumerators are shown in the following tables

 Codes generated by binomials

\(\,[n,t,\frac{n}{t}]_q\)-code

\(h(x)\)

Weight enumerator

\(\,[288,1,288]_{31}\)

\(\begin{array}{c} x + 1\\ x + 5\\ x + 6\\ x + 25\\ x + 26\\ x + 30\\ \end{array}\)

\(1+30z^{288}\)

\(\,[288,2,144]_{31}\)

\(\begin{array}{c} x^2 + 1\\ x^2 + 5\\ x^2 + 25\\ \end{array}\)

\((1+30z^{144})^2\)

\([288,3,96]_{31}\)

\(\begin{array}{c}x^3 + 5\\ x^3 + 6\\ x^3 + 25\\ x^3 + 26\\ \end{array}\)

\((1+30z^{96})^3\)

\(\,[288,6,48]_{31}\)

\(\begin{array}{c} x^6 + 5\\ x^6 + 25\\ \end{array}\)

\((1+30z^{48})^6\)

figure a
figure b