1 Introduction

Linear codes over finite rings have been studied since the early 1970s in [3, 11], that study has regained attention by the works of Nechaev in [8] and Hammons et al in [4] on some efficient nonlinear binary codes. These works deal with nonlinear binary codes such as the Nordstrom-Robinson, Kerdock, Preparata, Goethals and Delsarte–Goethals codes which are considered as binary images under the Gray map of linear codes over the ring \(Z_{4}\). Since then, many researchers have paid more and more attentions to study the codes over finite rings. In [15], Wolfmann showed that the Gray image of a linear single-root negacyclic code over \(Z_{4}\) is a distance invariant binary cyclic code (not necessarily linear). This result was later generalized to a \((1+2^{k})\) constacyclic code over \(Z_{2^{k+1}}\) by Tapia-Recillas and Vega in [13], where the corresponding Gray image was a binary distance invariant quasi-cyclic code. In [7], Ling and Blackford generalized most of the results of [13, 15] to the ring \(Z_{p^{k+1}}\), where \(p\) is any prime and \(k\) is a positive integer.

\((1+u)\) constacyclic codes over \(F_{2}+uF_{2}\) were first introduced by Qian et al in [9], where it was proved that the Gray image of a linear single-root \((1+u)\) constacyclic code over \(F_{2}+uF_{2}\) is a binary distance invariant linear cyclic code. In [1], Abular and Siap extended the Gray map of [9] to an arbitrary length over \(F_{2}+uF_{2}\) and the generator polynomial of the correspoding Gray image was obtained, some optimal binary codes were also constructed via the Gray map. Amarra et al in [2] discussed the Gray image of a single-root \((1-u)\) constacyclic code over \(F_{p^k}+uF_{p^k}\), which was a quasi-cyclic code over \(F_{p}\). Later, the result of [2] were extended to single-root \((1+u^{t})\) constacyclic codes over \(F_{q}[u]/\langle u^{t+1}\rangle \) and single-root \((1-u^{m})\) constacyclic codes over \(F_{p^k}[u]/\langle u^{m+1}\rangle \) in [12] and [14] respectively, where the Gray images were quasi-cyclic codes. Kai et al in [5] showed that the Gray image of a linear \((1+\lambda u)\) constacyclic code with an arbitrary length over \(F_{p}+uF_{p}\) was a distance invariant linear code over \(F_{p}\). The Gray image of a single-root \((1+u+u^{2})\) constacyclic code over the ring \(F_{2}[u]/\langle u^{3}\rangle \) were proved to be a binary distance invariant linear cyclic code in [10], but the generator polynomials of the corresponding Gray images in [10] and [5] were not acquired. In this paper, we extend the result of [1] about the Gray map to the polynomial residue ring \(R_{k}\), where the generator polynomials of the corresponding Gray images are obtained and some optimal linear cyclic code over \(F_{2}\) and \(F_{4}\) are constructed via the Gray map.

2 Preliminaries

Let \(R_{k}\) denote the ring \(F_{2^m}[u]/\langle u^{k} \rangle \), where \(2^{j-1}+1\le k\le 2^{j}\) for some positive integer \(j\) and \(u^{k}=0\). If \(x^{n}-1=f_{1}f_{2}\cdots f_{q}\) is the factorization of \((x^{n}-1)\) into a product of monic basic irreducible pairwise coprime polynomials over \(R_{k}\) for an odd positive integer \(n\), then this factorization is unique and can be directly carried over \(R_{k}\) from over \(F_{2^m}\). Let \(C\) be a code of length \(N=2^{e}n\) over \(R_{k}\), where \(e\) is a non-negative integer. For some fixed unit \(\alpha \) of \(R_{k}\), the \(\alpha \) constacyclic shift \(\nu _{\alpha }\) on \(R_{k}^{N}\) is the shift \(\nu _{\alpha }(c_{0},c_{1},\cdots ,c_{N-1})=(\alpha c_{N-1},c_{0},c_{1},\cdots ,c_{N-2})\). The code C is said to be an \(\alpha \) constacyclic code if \(\nu (C)=C\). Now, we identify a codeword \(c=(c_{0},c_{1},\cdots ,c_{N-1})\) with its polynomial representation \(c(x)=c_{0}+c_{1}x+\cdots +c_{N-1}x^{N-1}\), then \(xc(x)\) corresponds to an \(\alpha \) constacyclic shift of \(c(x)\) in the ring \(R_{k}[x]/\langle x^{N}-\alpha \rangle \). Thus \(\alpha \) constacyclic codes of length \(N\) over \(R_{k}\) can be identified as ideals in the ring \(R_{k}[x]/\langle x^{N}-\alpha \rangle \). In the following, we let \(j\) be a positive integer and \(2^{j-1}+1\le k\le 2^{j}\).

3 A class of matrices over \(F_{2^{m}}\)

Definition 3.1

If \(j=1\), then \(A_{2}=\left( {\begin{array}{ll} {1} &{} {0} \\ {1} &{} {1} \\ \end{array}} \right) \). If \(j>1\), then \(A_{2^{j}}=\left( {\begin{array}{cc} {A_{2^{j-1}}} &{} {0} \\ {A_{2^{j-1}}} &{} {A_{2^{j-1}}} \\ \end{array}} \right) \).

From the definition of matrix \(A_{2^{j}}\), we see that there are \(2^{j}\) rows and \(2^{j}\) columns in \(A_{2^{j}}\). Besides, the first row of \(A_{2^{j}}\) is \((1,\underbrace{0,\cdots ,0}_{(2^{j}-1)~zeros})\), the first and \(2^{j}\)th columns of \(A_{2^{j}}\) are \(A_{2^{j}}(1)\) and \(A_{2^{j}}(2^{j})\) respectively, where \(A_{2^{j}}(1)=(\underbrace{1,1,\cdots ,1}_{2^{j}~ones})^ {T}\) and \(A_{2^{j}}(2^{j})=(\underbrace{0,\cdots ,0}_{(2^{j}-1)~ones},1)^ {T}\).

Lemma 3.1

\(A_{2^{j}}\) is an invertible matrix over \(F_{2^m}\).

Proof

From the definition of matrix \(A_{2^{j}}\), we see that \(A_{2^{j}}\) is a lower triangular matrix and each element of its main diagonal is one. So \(A_{2^{j}}\) is invertible over \(F_{2^m}\). \(\square \)

Lemma 3.2

Let \({\small B_{2^{j}}=\left( {\begin{array}{cccc} {0} &{} {0} &{} {\cdots } &{} {0} \\ {\vdots } &{} {\vdots } &{} {\vdots } &{} {\vdots }\\ {0} &{} {0} &{} {\cdots } &{} {0} \\ {1} &{} {0} &{} {\cdots } &{} {0} \\ \end{array}} \right) }\) with \(2^{j}\) rows and \(2^{j}\) columns, then \(B_{2^{j}}A_{2^{j}}=(A_{2^{j}}(2^{j}),\underbrace{0,\cdots ,0}_{(2^{j}-1)~zero~vectors})\) in \(F_{2^{m}}\).

Proof

Since the first row of \(A_{2^{j}}\) is \((1,\underbrace{0,\cdots ,0}_{(2^{j}-1)~zeros})\), then \(B_{2^{j}}A_{2^{j}}=B_{2^{j}}=(A_{2^{j}}(2^{j}),\underbrace{0,\cdots ,0}_{(2^{j}-1)~zero~vectors})\) in \(F_{2^{m}}\). \(\square \)

Theorem 3.3

Let \(H_{2^{j}}=\left( {\begin{array}{cccccc} {1} &{} {1} &{} {0} &{} {\cdots } &{} {0} &{} {0} \\ {0} &{} {1} &{} {1} &{} {\cdots } &{} {0} &{} {0} \\ {0} &{} {0} &{} {1} &{} {\cdots } &{} {0} &{} {0} \\ {\vdots } &{} {\vdots } &{} {\vdots } &{} {\vdots } &{} {\vdots } &{} {\vdots }\\ {0} &{} {0} &{} {0} &{} {\cdots } &{} {1} &{} {1} \\ {0} &{} {0} &{} {0} &{} {\cdots } &{} {0} &{} {1} \\ \end{array}} \right) \) and \(D_{2{j}}=\left( {\begin{array}{ccccc} {0} &{} {1} &{} {0}&{} {\cdots } &{} {0} \\ {0} &{} {0} &{} {1}&{} {\cdots } &{} {0}\\ {\vdots } &{} {\vdots } &{} {\vdots } &{} {\vdots } &{} {\vdots }\\ {0} &{} {0} &{} {0} &{} {\cdots } &{} {1}\\ {1} &{} {0} &{} {0}&{} {\cdots } &{} {0}\\ \end{array}} \right) \), where \(H_{2^{j}}\) and \(D_{2^{j}}\) are both square matrices with \(2^{j}\) rows and \(2^{j}\) columns, then \(H_{2^{j}}A_{2^{j}}=A_{2^{j}}D_{2^{j}}\) in \(F_{2^{m}}\).

Proof

We prove the result by induction on \(j\). In \(F_{2^{m}}\), if \(j=1\), then

$$\begin{aligned} H_{2}A_{2}=\left( {\begin{array}{ll} {1} &{} {1} \\ {0} &{} {1} \\ \end{array}} \right) \left( {\begin{array}{ll} {1} &{} {0} \\ {1} &{} {1} \\ \end{array}} \right) =\left( {\begin{array}{ll} {0} &{} {1} \\ {1} &{} {1} \\ \end{array}} \right) =\left( {\begin{array}{ll} {1} &{} {0} \\ {1} &{} {1} \\ \end{array}} \right) \left( {\begin{array}{ll} {0} &{} {1} \\ {1} &{} {0} \\ \end{array}} \right) =A_{2}D_{2}. \end{aligned}$$

Suppose \(H_{2^{j_{1}}}A_{2^{j_{1}}}=A_{2^{j_{1}}}D_{2^{j_{1}}}\) for some positive integer \(j_{1}\), then

$$\begin{aligned} H_{2^{j_{1}}}A_{2^{j_{1}}}=(A_{2^{j_{1}}}(2^{j_{1}}), A_{2^{j_{1}}}(1),\cdots ,A_{2^{j_{1}}}(2^{j_{1}}-1)). \end{aligned}$$

From lemma 3.2, we can get

$$\begin{aligned}&H_{2^{j_{1}+1}}A_{2^{j_{1}+1}} = \left( {\begin{array}{cc} {H_{2^{j_{1}}}} &{} {B_{2^{j_{1}}}} \\ {0} &{} {H_{2^{j_{1}}}} \\ \end{array}} \right) \left( {\begin{array}{cc} {A_{2^{j_{1}}}} &{} {0} \\ {A_{2^{j_{1}}}} &{} {A_{2^{j_{1}}}} \\ \end{array}} \right) =\left( {\begin{array}{cc} {H_{2^{j_{1}}}A_{2^{j_{1}}}+B_{2^{j_{1}}}A_{2^{j_{1}}}} &{} {B_{2^{j_{1}}}A_{2^{j_{1}}}} \\ {H_{2^{j_{1}}}A_{2^{j_{1}}}} &{} {H_{2^{j_{1}}}A_{2^{j_{1}}}} \\ \end{array}} \right) \\&\quad \!=\! \left( {\begin{array}{cc} {(0,A_{2^{j_{1}}}(1),\cdots ,A_{2^{j_{1}}}(2^{j_{1}}-1))} &{} {(A_{2^{j_{1}}}(2^{j_{1}}),\underbrace{0,\cdots ,0}_{(2^{j_{1}}-1)~ zero~vectors})} \\ {(A_{2^{j_{1}}}(2^{j_{1}}),A_{2^{j_{1}}}(1),\cdots ,A_{2^{j_{1}}}(2^{j_{1}}-1))} &{} {(A_{2^{j_{1}}}(2^{j_{1}}),A_{2^{j_{1}}}(1),\cdots ,A_{2^{j_{1}}}(2^{j_{1}}-1))} \\ \end{array}} \right) . \end{aligned}$$

so \(H_{2^{j_{1}+1}}A_{2^{j_{1}+1}}=A_{2^{j_{1}+1}}D_{2^{j_{1}+1}}\), which gives the proof. \(\square \)

4 A new Gray map and the structure of the corresponding Gray image

Let \(a,b\) be two elements in \(R_{k}\), then \(a,b\) can be written as \(a=\sum \limits _{i = 0}^{k-1}u^{i}r_{i}(a)\) and \(b=\sum \limits _{i = 0}^{k-1}u^{i}r_{i}(b)\) respectively, where \(r_{i}(a),r_{i}(b)\in F_{2^{m}}\) for \(0\le i\le k-1\). It is easy to check that \(r_{i}(a+b)=r_{i}(a)+r_{i}(b)\) for \(0\le i\le k-1\).

Definition 4.1

For an arbitrary element \(a\) in \(R_{k}\), a new Gray map \(\Phi _{k}\) from \(R_{k}\) to \(F_{2^{m}}^{2^{j}}\) is defined as follows:

$$\begin{aligned} \Phi _{k}(a)=(\underbrace{0,\cdots ,0}_{(2^{j}-k)~zeros},r_{0}(a),r_{1}(a),\cdots ,r_{k-1}(a))A_{2^{j}}. \end{aligned}$$

From the definition of \(\Phi _{k}\), we see that this Gray map is linear that because

$$\begin{aligned} \Phi _{k}(a+b)&= (\underbrace{0,\cdots ,0}_{(2^{j}-k)~ zeros},r_{0}(a+b),r_{1}(a+b),\cdots ,r_{k-1}(a+b))A_{2^{j}}\\&= (\underbrace{0,\cdots ,0}_{(2^{j}-k)~ zeros},r_{0}(a),r_{1}(a),\cdots ,r_{k-1}(a))A_{2^{j}}\\&+\,(\underbrace{0,\cdots ,0}_{(2^{j}-k)~ zeros},r_{0}(b),r_{1}(b),\cdots ,r_{k-1}(b))A_{2^{j}}\\&= \Phi _{k}(a)+\Phi _{k}(b). \end{aligned}$$

According to lemma 3.1, \(A_{2^{j}}\) is an invertible matrix over \(F_{2^{m}}\), so \(\Phi _{k}\) is a bijection from \(R_{k}\) to \(F_{2^{m}}^{2^{j}}\). we identify a codeword \(c=(c_{0},c_{1},\cdots ,c_{N-1})\in R_{k}^{N}\) with its polynomial representation \(c(x)=c_{0}+c_{1}x+\cdots +c_{N-1}x^{N-1}\) and denote \(P_{i}[c(x)]=\sum \limits _{l = 0}^{N-1}r_{i}(c_{l})x^{l}\) for \(0\le i\le k-1\), then \(c(x)=\sum \limits _{i = 0}^{k-1}u^{i}P_{i}[c(x)]\). Thus, the Gray map \(\Phi _{k}\) can be extended to \(R_{k}[x]\) in an obvious way.

Definition 4.2

For an arbitrary codeword \(c=(c_{0},c_{1},\cdots ,c_{N-1})\in R_{k}^{N}\), its polynomial representation is \(c(x)=c_{0}+c_{1}x+\cdots +c_{N-1}x^{N-1}\). The polynomial Gray map \(\Phi _{k}\) from \(R_{k}[x]\) to \(F_{2^{m}}[x]\) is defined as follows:

$$\begin{aligned} \Phi _{k}[c(x)]=(\underbrace{0,\cdots ,0}_{(2^{j}-k)~ zeros},P_{0}[c(x)],P_{1}[c(x)],\cdots ,P_{k-1}[c(x)])A_{2^{j}}\left( {\begin{array}{c} {1} \\ {x^{N}} \\ {\vdots } \\ {x^{(2^{j}-1)N}} \\ \end{array}} \right) . \end{aligned}$$

Obviously, \(\Phi _{k}\) is not only linear, but also a bijection from \(R_{k}[x]\) to \(F_{2^{m}}[x]\).

Definition 4.3

Let \(W_{L}\) be the Lee weight of the element of \(R_{k}\) and \(W_{H}\) be the Hamming weight of the element of \(F_{2^{m}}^{2^{j}}\). We define that \(W_{L}(a)=W_{H}[\Phi _{k}(a)]\) for an arbitrary element \(a\) in \(R_{k}\). The Lee weight of a codeword in \(R_{k}[x]\) is the rational integer sum of the Lee weight of its coefficients. The Lee distance between two codewords \(c\) and \(\acute{c}\) is defined as the Lee weight of \((c-\acute{c})\).

The following lemma 4.1 is straightforward from the definitions of the polynomial Gray map and Lee distance.

Lemma 4.1

The polynomial Gray map \(\Phi _{k}\) is not only a linear bijection from \(R_{k}[x]\) to \(F_{2^{m}}[x]\), but also a distance-preserving map from (\(R_{k}[x]\), Lee distance) to (\(F_{2^{m}}[x]\), Hamming distance).

Theorem 4.2

If \(C\) is a \((1+u)\) constacyclic code of length \(N\) over \(R_{k}\), then \(\Phi _{k}(C)\) is a linear cyclic code of length \(2^{j}N\) over \(F_{2^m}\).

Proof

It only needs to prove \(\Phi _{k}[xc(x)]=x\Phi _{k}[c(x)]\). In fact, \(x^{N}=1+u\) in \(R_{k}[x]/\langle x^{N}-(1+u)\rangle \), so \(x^{2^{j}N}=1\). For an arbitrary codeword \(c(x)=c_{0}+c_{1}x+\cdots +c_{N-1}x^{N-1}\in C\), it can be written in the form \(c(x)=\sum \limits _{i = 0}^{k-1}u^{i}P_{i}[c(x)]\). Then, we have \(xc(x)=(1+u)c_{N-1}+c_{0}x+c_{1}x^{2}+\cdots +c_{N-2}x^{N-1}=\sum \limits _{i = 0}^{k-1}u^{i}P_{i}[xc(x)]\), where \(P_{0}[xc(x)]=r_{0}[(c_{N-1})]+xP_{0}[c(x)]+x^{N}r_{0}(c_{N-1})\) and \(P_{i}[xc(x)]=r_{i}[(1+u)c_{N-1}]+\sum \limits _{l = 0}^{k-2}r_{i}(c_{l})x^{l+1}=[r_{i-1}(c_{N-1})+r_{i}(c_{N-1})]+xP_{i}[c(x)]+x^{N}r_{i}(c_{N-1})\) for \(1\le i\le k-1\). Therefore

$$\begin{aligned} \Phi _{k}[xc(x)]&= (\underbrace{0,\cdots ,0}_{(2^{j}-k)~ zeros},P_{0}[xc(x)],P_{1}[xc(x)],\cdots ,P_{k-1}[xc(x)])A_{2^{j}}\left( {\begin{array}{c} {1} \\ {x^{N}} \\ {\vdots } \\ {x^{(2^{j}-1)N}} \\ \end{array}} \right) \\&= (\underbrace{0,\cdots ,0}_{(2^{j}-k)~ zeros},r_{0}(c_{N-1}),\sum \limits _{i = 0}^{1}r_{i}(c_{N-1}),\cdots ,\sum \limits _{i = k-2}^{k-1}r_{i}(c_{N-1}))A_{2^{j}}\left( {\begin{array}{c} {1} \\ {x^{N}} \\ {\vdots } \\ {x^{(2^{j}-1)N}} \\ \end{array}} \right) \\&+x^{N}(\underbrace{0,\cdots ,0}_{(2^{j}-k)~ zeros},r_{0}(c_{N-1}),r_{1}(c_{N-1}),\cdots ,r_{k-1}(c_{N-1}))A_{2^{j}}\left( {\begin{array}{c} {1} \\ {x^{N}} \\ {\vdots } \\ {x^{(2^{j}-1)N}} \\ \end{array}} \right) \\&+x(\underbrace{0,\cdots ,0}_{(2^{j}-k)~ zeros},P_{0}[c(x)],P_{1}[c(x)],\cdots ,P_{k-1}[c(x)])A_{2^{j}}\left( {\begin{array}{c} {1} \\ {x^{N}} \\ {\vdots } \\ {x^{(2^{j}-1)N}} \\ \end{array}} \right) \\&= (\underbrace{0,\cdots ,0}_{(2^{j}-k)~ zeros},r_{0}(c_{N-1}),r_{1}(c_{N\!-\!1}),\cdots ,r_{k\!-\!1}(c_{N-1}))(H_{2^{j}}A_{2^{j}}\!+\!A_{2^{j}}D_{2^{j}})\\&\times \left( {\begin{array}{c} {1} \\ {x^{N}} \\ {\vdots } \\ {x^{(2^{j}-1)N}} \\ \end{array}} \right) +x\Phi _{k}[c(x)]. \end{aligned}$$

By theorem 3.3, \(\Phi _{k}[xc(x)]=x\Phi _{k}[c(x)]\). \(\square \)

5 The generator polynomial of the Gray image

Lemma 5.1

In \(F_{2^m}[x]\), \(A_{2^{j}}\left( {\begin{array}{c} {1} \\ {x^{N}} \\ {\vdots } \\ {x^{(2^{j}-1)N}} \\ \end{array}} \right) =\left( {\begin{array}{c} {1} \\ {1+x^{N}}\\ {\vdots } \\ {(1+x^{N})^{2^{j}-1}} \\ \end{array}} \right) \).

Proof

We prove the result by induction on \(j\). In \(F_{2^m}[x]\), if \(j=1\), then \(A_{2}\left( {\begin{array}{c} {1} \\ {x^{N}} \\ \end{array}} \right) =\left( {\begin{array}{ll} {1} &{} {0} \\ {1} &{} {1}\\ \end{array}} \right) \left( {\begin{array}{c} {1} \\ {x^{N}} \\ \end{array}} \right) =\left( {\begin{array}{c} {1} \\ {1+x^{N}} \\ \end{array}} \right) \).

Suppose \(A_{2^{j_{1}}}\left( {\begin{array}{c} {1} \\ {x^{N}} \\ {\vdots } \\ {x^{(2^{j_{1}}-1)N}} \\ \end{array}} \right) =\left( {\begin{array}{c} {1} \\ {1+x^{N}}\\ {\vdots } \\ {(1+x^{N})^{2^{j_{1}}-1}} \\ \end{array}} \right) \) for some positive integer \(j_{1}\) in \(F_{2^m}[x]\), then

$$\begin{aligned} A_{2^{j_{1}+1}}\left( {\begin{array}{c} {1} \\ {x^{N}} \\ {\vdots } \\ {x^{(2^{j_{1}+1}-1)N}} \\ \end{array}} \right)&= \left( {\begin{array}{ll} {A_{2^{j_{1}}}} &{} {0} \\ {A_{2^{j_{1}}}} &{} {A_{2^{j_{1}}}} \\ \end{array}} \right) \left( {\begin{array}{c} {1} \\ {x^{N}} \\ {\vdots } \\ {x^{(2^{j_{1}+1}-1)N}} \\ \end{array}} \right) \\ \!&= \!\left( \!{\begin{array}{c} {A_{2^{j_{1}}}\left( {\begin{array}{c} {1} \\ {x^{N}} \\ {\vdots } \\ {x^{(2^{j_{1}}-1)N}} \\ \end{array}} \right) } \\ {(1+x^{2^{j_{1}}N})A_{2^{j_{1}}}\left( {\begin{array}{c} {1} \\ {x^{N}} \\ {\vdots } \\ {x^{(2^{j_{1}}-1)N}} \\ \end{array}} \right) } \\ \end{array}} \!\right) \!=\!\left( \!{\begin{array}{c} {1} \\ {1+x^{N}}\\ {\vdots } \\ {(1+x^{N})^{2^{j_{1}+1}-1}}\\ \end{array}} \!\right) . \end{aligned}$$

This gives the proof. \(\square \)

Let \(n\) be an odd positive integer and let \(x^{n}-1=f_{1}f_{2}\cdots f_{q}\) be the factorization of \((x^{n}-1)\) into a product of monic basic irreducible pairwise coprime polynomials in \(F_{2^{m}}[x]\), then the following lemma is straightforward from the theorem 4 and lemma 3 of [7].

Lemma 5.2

Let \(C\) be a \((1+u)\) constacyclic code of length \(N=2^{e}n\) over \(R_{k}\), then \(C=\langle f_{1}^{k_{1}}f_{2}^{k_{2}}\cdots f_{q}^{k_{q}}\rangle \), where \(0\le k_{i}\le 2^{e}k\) for \(i=0,1,\cdots ,q\). Furthermore, \(|C|=2^{m(kN-\eta )}\), where \(\eta =\sum \limits _{i = 1}^{q}{k_{i}deg(f_{i})}\).

Theorem 5.3

Let \(C=\langle f_{1}^{k_{1}}f_{2}^{k_{2}}\cdots f_{q}^{k_{q}}\rangle \) be a \((1+u)\) constacyclic code of length \(N=2^{e}n\) over \(R_{k}\), where \(e\) is a non-negative integer and \(0\le k_{i}\le 2^{e}k\) for \(i=0,1,\cdots ,q\). Then the Gray image \(\Phi _{k}(C)\) is a linear cyclic code of length \(2^{j}N\) over \(F_{2^{m}}\) and \(\Phi _{k}(C)=\langle f_{1}^{k_{1}+2^{e}(2^{j}-k)}f_{2}^{k_{2}+2^{e}(2^{j}-k)}\cdots f_{q}^{k_{q}+2^{e}(2^{j}-k)}\rangle \).

Proof

By theorem 4.2, \(\Phi _{k}(C)\) is a linear cyclic code of length \(2^{j}N\) over \(F_{2^{m}}\). So, we only need to prove \(\Phi _{k}(C)=\langle f_{1}^{k_{1}+2^{e}(2^{j}-k)}f_{2}^{k_{2}+2^{e}(2^{j}-k)}\cdots f_{q}^{k_{q}+2^{e}(2^{j}-k)}\rangle \). In fact, we denote \(c(x)=f_{1}^{k_{1}}f_{2}^{k_{2}}\cdots f_{q}^{k_{q}}\in C\), then \(c(x)=\sum \limits _{i = 0}^{k-1}u^{i}P_{i}[c(x)]=\sum \limits _{i = 0}^{k-1}(1+x^{N})^{i}P_{i}[c(x)]\). By lemma 5.1,

$$\begin{aligned} \Phi _{k}[c(x)]&= (\underbrace{0,\cdots ,0}_{(2^{j}-k)~ zeros},P_{0}[c(x)],P_{1}[c(x)],\cdots ,P_{k-1}[c(x)])A_{2^{j}}\left( {\begin{array}{c} {1} \\ {x^{N}} \\ {\vdots } \\ {x^{(2^{j}-1)N}} \\ \end{array}} \right) \\&= (\underbrace{0,\cdots ,0}_{(2^{j}-k)~ zeros},P_{0}[c(x)],P_{1}[c(x)],\cdots ,P_{k-1}[c(x)])\left( {\begin{array}{c} {1} \\ {1+x^{N}} \\ {\vdots } \\ {(1+x^N)^{2^{j}-1}} \\ \end{array}} \right) \\&= (1+x^{N})^{2^{j}-k}\sum \limits _{i = 0}^{k-1}(1+x^{N})^{i}P_{i}[c(x)]=(1+x^{N})^{2^{j}-k}c(x)\in \Phi _{k}(C). \end{aligned}$$

So \(\langle (1+x^{N})^{2^{j}-k}f_{1}^{k_{1}}f_{2}^{k_{2}}\cdots f_{q}^{k_{q}}\rangle \subseteq \Phi _{k}(C)\). Comparing the number of codewords, we have \(\Phi _{k}(C)=\langle (1+x^{N})^{2^{j}-k}f_{1}^{k_{1}}f_{2}^{k_{2}}\cdots f_{q}^{k_{q}}\rangle \). Since \(1+x^{N}=(f_{1}f_{2}\cdots f_{q})^{2^{e}}\) in \(F_{2^{m}}[x]\), then we get the result. \(\square \)

6 Examples

Let \(\omega \) be a primitive element of \(F_{4}\). In \(F_{2}[x]\), \(x^{3}-1=Q_{1}Q_{2}\), where \(Q_{1}=x+1\) and \(Q_{2}=x^{2}+x+1\). In \(F_{4}[x]\), \(x^{3}-1=g_{1}g_{2}g_{3}\), where \(g_{1}=x+1\), \(g_{2}=x+\omega \) and \(g_{3}=x+\omega ^{2}\). In \(F_{2}[x]\) and \(F_{4}[x]\), \(x^{7}-1=f_{1}f_{2}f_{3}\), where \(f_{1}=x+1\), \(f_{2}=x^{3}+x+1\) and \(f_{3}=x^{3}+x^{2}+1\).

Example 1

Let \(k=2\) and \(m=1\) in definition 4.2 and theorem 5.3, we get the result of Abularub et al about the Gray map in [1]. Now, we let \(k=2\) and \(m=2\), we can get some other optimal codes. For example, \(C_{1}=\langle g_{1}g_{2}g_{3}^{3}\rangle \) is a \((1+u)\) constacyclic code of length \(N=6\) over \(F_{4}+uF_{4}\). According to theorem 5.3, \(\Phi _{2}(C_{1})=\langle g_{1}g_{2}g_{3}^{3}\rangle \), which is a [4, 7, 12] linear cyclic code over \(F_{4}\) and an optimal code. Table 1 presents several optimal linear codes over \(F_{4}\) obtained from \((1+u)\) constacyclic codes over \(F_{4}+uF_{4}\) of some lengths.

Table 1 Optimal linear codes over \(F_{4}\) obtained from \((1+u)\) constacyclic codes over \(F_{4}+uF_{4}\)

Tables 2, 3, 4, 5, 6 and 7 present some optimal codes obtained from \((1+u)\) constacyclic codes of some lengths over \(R_{k}\) under the Gray map.

Table 2 Optimal binary linear codes obtained from \((1+u)\) constacyclic codes over \(F_{2}[u]/\langle u^{3}\rangle \)
Table 3 Optimal linear codes over \(F_{4}\) obtained from \((1+u)\) constacyclic codes over \(F_{4}[u]/\langle u^{3}\rangle \)
Table 4 Optimal binary linear codes obtained from \((1+u)\) constacyclic codes over \(F_{2}[u]/\langle u^{4}\rangle \)
Table 5 Optimal linear codes over \(F_{4}\) obtained from \((1+u)\) constacyclic codes over \(F_{4}[u]/\langle u^{4}\rangle \)
Table 6 Optimal binary linear codes obtained from \((1+u)\) constacyclic codes over \(F_{2}[u]/\langle u^{8}\rangle \)
Table 7 Optimal binary linear codes obtained from \((1+u)\) constacyclic codes over \(F_{2}[u]/\langle u^{16}\rangle \)

7 Conclusion

In this paper, we extend the result of [1] about the Gray map to the polynomial residue ring \(R_{k}=F_{2^m}[u]/\langle u^{k} \rangle \), where \(2^{j-1}+1\le k\le 2^{j}\) for some positive integer \(j\). Some optimal linear cyclic code over \(F_{2}\) and \(F_{4}\) have been constructed via the Gray map. A nature problem is to extend the results to the ring \(F_{q}[u]/\langle u^{k} \rangle \).