Optimal p-ary cyclic codes with two zeros


As a subclass of linear codes, cyclic codes have efficient encoding and decoding algorithms, so they are widely used in many areas such as consumer electronics, data storage systems and communication systems. In this paper, we give a general construction of optimal p-ary cyclic codes which leads to three explicit constructions. In addition, another class of p-ary optimal cyclic codes are presented.

This is a preview of subscription content, access via your institution.


  1. 1.

    Charpin, P., Tietäväinen, A., Zinoviev, V.: On binary cyclic codes with distance three. Probl. Inf. Transm. 33, 3–14 (1997)

    MATH  Google Scholar 

  2. 2.

    Charpin, P., Tietäväinen, A., Zinoviev, V.: On the minimum distances of non-binary cyclic codes. Des. Codes Crypogr. 17, 81–85 (1999)

    MathSciNet  Article  Google Scholar 

  3. 3.

    Carlet, C., Ding, C., Yuan, J.: Linear codes from highly nonlinear functions and their secret sharing schemes. IEEE Trans. Inf. Theory 51(6), 2089–2102 (2005)

    Article  Google Scholar 

  4. 4.

    Ding, C., Helleseth, T.: Optimal ternary cyclic codes from monomials. IEEE Trans. Inf. Theory 59(9), 5898–5904 (2013)

    MathSciNet  Article  Google Scholar 

  5. 5.

    Ding, C., Ling, S.: A \(q\)-polynomial approach to cyclic codes. Finite Fields Appl. 20, 1–14 (2013)

    MathSciNet  Article  Google Scholar 

  6. 6.

    Ding, C., Li, C., Li, N., Zhou, Z.: Three-weight cyclic codes and their weight distributions. Discrete Math. 339(2), 415–427 (2016)

    MathSciNet  Article  Google Scholar 

  7. 7.

    Ding, C., Liu, Y., Ma, C., Zeng, L.: The weight distributions of the duals of cyclic codes with two zeros. IEEE Trans. Inf. Theory 57(12), 8000–8006 (2011)

    MathSciNet  Article  Google Scholar 

  8. 8.

    Fan, C., Li, N., Zhou, Z.: A class of optimal ternary cyclic codes and their duals. Finite Fields Appl. 37, 193–202 (2016)

    MathSciNet  Article  Google Scholar 

  9. 9.

    Fang, W., Wen, J., Fu, F.: A \(q\)-polynomial approach to constacyclic codes. Finite Fields Appl. 47, 161–182 (2017)

    MathSciNet  Article  Google Scholar 

  10. 10.

    Feng, T.: On cyclic codes of length \(2^{2^{r}}-1\) with two zeros whose dual codes have three weights. Des. Codes Crypogr. 62, 253–258 (2012)

    Article  Google Scholar 

  11. 11.

    Han, D., Yan, H.: On an open problem about a class of optimal ternary cyclic codes. Finite Fields Appl. 59, 335–343 (2019)

    MathSciNet  Article  Google Scholar 

  12. 12.

    Huffman, W., Pless, V.: Foundamentals of Error-Correcting Codes. Cambridge University Press, Cambridge (2003)

    Google Scholar 

  13. 13.

    Li, C., Yue, Q.: Weight distributions of two classes of cyclic codes with respect to two distinct order elements. IEEE Trans. Inf. Theory 60(1), 296–303 (2014)

    MathSciNet  Article  Google Scholar 

  14. 14.

    Li, N., Li, C., Helleseth, T., Ding, C., Tang, X.: Optimal ternary cyclic codes with minimun distance four and five. Finite Fields Appl. 30, 100–120 (2014)

    MathSciNet  Article  Google Scholar 

  15. 15.

    Li, N., Zhou, Z., Helleseth, T.: On a conjecture about a class of optimal ternary cyclic codes. In: 2015 Seventh Intertional Workshop on Signal Design and its Applications in Communications (IWSDA). https://doi.org/10.1109/IWSDA.2015.7458415

  16. 16.

    Liao, D., Kai, X., Zhu, S., Li, P.: A class of optimal cyclic codes with two zeros. IEEE Commun. Lett. 23(8), 1293–1296 (2019)

    Article  Google Scholar 

  17. 17.

    Luo, J., Feng, K.: Cyclic codes and sequences form generalized Coulter–Matthews function. IEEE Trans. Inf. Theory 54(12), 5345–5353 (2008)

    Article  Google Scholar 

  18. 18.

    Ma, C., Zeng, L., Liu, Y., Feng, D., Ding, C.: The weight enumerator of a class of cyclic codes. IEEE Trans. Inf. Theory 57(1), 397–402 (2011)

    MathSciNet  Article  Google Scholar 

  19. 19.

    Shi, M., Solé, P.: Optimal \(p\)-ary codes from one-weight and two-weight codes over \(\mathbb{F}_{p}+v\mathbb{F}_{p}^{*}\). J. Syst. Sci. Complex 28(3), 679–690 (2015)

    MathSciNet  Article  Google Scholar 

  20. 20.

    Wang, L., Wu, G.: Several classes of optimal ternary cyclic codes with minimal distance four. Finite Fields Appl. 40, 126–137 (2016)

    MathSciNet  Article  Google Scholar 

  21. 21.

    Xiong, M., Li, N.: Optimal cyclic codes with generalized Niho-type zeros and the weight distribution. IEEE Trans. Inf. Theory 61(9), 4914–4922 (2015)

    MathSciNet  Article  Google Scholar 

  22. 22.

    Xu, G., Cao, X., Xu, S.: Optimal \(p\)-ary cyclic codes with minimum distance four from monomials. Cryptogr. Commun. 8(4), 541–554 (2016)

    MathSciNet  Article  Google Scholar 

  23. 23.

    Yan, H., Zhou, Z., Du, X.: A family of optimal ternary cyclic codes from the Niho-type exponent. Finite Fields Appl. 54, 101–112 (2018)

    MathSciNet  Article  Google Scholar 

  24. 24.

    Zeng, X., Hu, L., Jiang, W.: The weight distribution of a class of \(p\)-ary cyclic codes. Finite Fields Appl. 16(1), 126–137 (2010)

    MathSciNet  Article  Google Scholar 

  25. 25.

    Zhou, Y., Kai, X., Zhu, S., Li, J.: On the minimum distance of negacyclic codes with two zeros. Finite Fields Appl. 55, 134–150 (2019)

    MathSciNet  Article  Google Scholar 

  26. 26.

    Zhou, Z., Ding, C.: A class of three-weight cyclic codes. Finite Fields Appl. 25, 79–93 (2014)

    MathSciNet  Article  Google Scholar 

Download references


The authors are very grateful to the anonymous reviewer for the comments which improved the presentation and quality of this paper.

Author information



Corresponding author

Correspondence to Xiwang Cao.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Y. Liu: is supported by the National Natural Science Foundation of China (No. 12001475 and 11701498), Natural Science Foundation of Jiangsu Province (No. BK20201059) and the Natural Science Foundation of the Jiangsu Higher Education Institutions of China (No. 19KJB120014). X. Cao is supported by the National Natural Science Foundation of China (No. 11771007)



According to the definition of the cyclic code \(\mathcal {C}_{p}(u,v)\), \(\mathcal {C}_{p}(1,i)\) and \(\mathcal {C}_{p}(1,j)\) are the same code if and only if \(m_{i}(x)=m_{j}(x)\), i.e., \(C_{i}=C_{j}\). Based on this fact, in the following, we will prove the codes in Sect. 3 are new. To this end, we need to show that the codes in this paper and thoes in [16] are different. To give a clear explanation, we list the main result of [16] in the following.

Theorem 4.1

([16]) Let \(m> 2\) be an integer. Let tsh be integers with \(0 \le t, s, h \le m-1\) and \(\gcd (m, t)=\gcd (m, s-h)=1\) such that the congruence

$$\begin{aligned} (p^{t}+1)v\equiv p^{s}+p^{h}\pmod {p^{m}-1} \end{aligned}$$

has solutions. Let v be a solution of it, then \(\mathcal {C}_{p}(1,v)\) is optimal with parameters \([n, n-2m, 4]\) if \(\gcd (p^{s}-v, n)=\gcd (v-1, n)=\gcd (p^{h}-v, n)=1\).

First, we will prove the codes in Sect. 3.1 are new. By the discussion above, we need to prove \(p^{k}+1\) and v which is an even solution of (5) are not in different cyclotomic cosets modulo n where \(n=\frac{2(p^{m}-1)}{p-1}\). Therefore, we need to prove \(p^{\lambda }v \not \equiv p^{k}+1 \pmod {n}\) for any integer \(\lambda \). Since m is the multiplicative order of p modulo n, we can assume that \(0\le \lambda \le m-1\). Suppose on the contrary that there is an integer \(\lambda \) such that \(p^{\lambda } v \equiv p^{k}+1 \pmod {n}\). Notice that \(\gcd (p^{t}+1, p^{m}-1)=2\), then \(\gcd (p^{t}+1, n)=2\). Therefore, when m is odd, \(p^{\lambda }v \equiv p^{k}+1 \pmod {n}\) is equivalent to

$$\begin{aligned} p^{\lambda }(p^{t}+1)v \equiv (p^{t}+1)(p^{k}+1) \pmod {n}. \end{aligned}$$

Since \((p^{t}+1)v\equiv p^{s}+p^{h}\pmod {p^{m}-1}\), then

$$\begin{aligned} p^{\lambda }(p^{s}+p^{h}) \equiv (p^{t}+1)(p^{k}+1) \pmod {n}. \end{aligned}$$

So we have

$$\begin{aligned} \frac{2(p^{m}-1)}{p-1}| (p^{t+k}+ p^{t}+ p^{k}+1 -p^{\lambda +s}-p^{\lambda +h}) \end{aligned}$$

which implies

$$\begin{aligned} 2(p^{m}-1) | (p^{t+k}+ p^{t}+ p^{k}+1 -p^{\lambda +s}-p^{\lambda +h})(p-1). \end{aligned}$$

In the following, for any integer \(\kappa \), let \(\kappa _{m}\) be the residue of \(\kappa \) modulo m, \(0 \le \kappa _{m}\le m-1\). Then by the expression above, we have

$$\begin{aligned} (p^{m}-1) | (p^{(t+k)_{m}}+ p^{t}+ p^{k}+1 -p^{(\lambda +s)_{m}}-p^{(\lambda +h)_{m}})(p-1). \end{aligned}$$

It is easy to check that \(|(p^{(t+k)_{m}}+ p^{t}+ p^{k}+1 -p^{(\lambda +s)_{m}}-p^{(\lambda +h)_{m}})(p-1)|< 2(p^{m}-1)\) and \(|(p^{(t+k)_{m}}+ p^{t}+ p^{k}+1 -p^{(\lambda +s)_{m}}-p^{(\lambda +h)_{m}})(p-1)|\ne p^{m}-1 \). So if (7) holds, \((p^{(t+k)_{m}}+ p^{t}+ p^{k}+1 -p^{(\lambda +s)_{m}}-p^{(\lambda +h)_{m}})(p-1)=0\), i.e.,

$$\begin{aligned} p^{(t+k)_{m}}+ p^{t}+ p^{k}+1 -p^{(\lambda +s)_{m}}-p^{(\lambda +h)_{m}}=0. \end{aligned}$$

So at least one of \((t+k)_{m}\), t, k, \((\lambda +s)_{m}\), \((\lambda +h)_{m}\) is zero. Otherwise, from (8), \(1\equiv 0 \pmod {p}\) which is a contradiction. So we discuss these cases one by one.

  1. (1)

    If \((t+k)_{m}=0\), then (8) becomes

    $$\begin{aligned} p^{t}+ p^{k}-p^{(\lambda +s)_{m}}-p^{(\lambda +h)_{m}}+2=0. \end{aligned}$$

    Similarly as above, at least one of t, k, \((\lambda +s)_{m}\), \((\lambda +h)_{m}\) is zero. If \(t=0\), then \(k=0\) and then \(p^{(\lambda +s)_{m}}+p^{(\lambda +h)_{m}}=4\) which is impossible when \(p>3\). So \(t\ne 0\). Similarly, we can obtain \(k\ne 0\). If \((\lambda +s)_{m}=0\), \(t\ne 0\), \(k\ne 0\), then (8) becomes \(p^{t}+ p^{k}-p^{(\lambda +h)_{m}}+1=0\). Therefore, \((\lambda +h)_{m}=0\) and then \(p^{t}+ p^{k}=0\) which is impossible.

  2. (2)

    If one of t or k is zero but not both, (8) becomes

    $$\begin{aligned} 2p^{k}-p^{(\lambda +s)_{m}}-p^{(\lambda +h)_{m}}+2=0 \end{aligned}$$


    $$\begin{aligned} 2p^{t}-p^{(\lambda +s)_{m}}-p^{(\lambda +h)_{m}}+2=0. \end{aligned}$$

    According to similar discussion as above, this case can not happen.

  3. (3)

    If \((t+k)_{m}\ne 0\), \(t\ne 0\), \(k\ne 0\) and \((\lambda +s)_{m}=0\), then (8) becomes

    $$\begin{aligned} p^{(t+k)_{m}}+ p^{t}+ p^{k} -p^{(\lambda +h)_{m}}=0 \end{aligned}$$

    which implies \((\lambda +h)_{m}>0\). Otherwise, \(1\equiv 0 \pmod {p}\) which is impossible. By simplification, (9) becomes \(p^{\alpha _{1}}+p^{\alpha _{2}}+p^{\alpha _{3}}-1=0\), \(p^{\alpha _{1}}+p^{\alpha _{2}}-p^{\alpha _{3}}+1=0\), \(p^{\alpha _{1}}-p^{\alpha _{2}}+2=0\), \(p^{\alpha _{1}}+p^{\alpha _{2}}=0\) or \(p^{\alpha _{1}}+1=0\) which are all impossible when \(p>3\) where \(\alpha _{1}, \alpha _{2}, \alpha _{3}\) are all positive integers.

  4. (4)

    Similarly as above, we can have \((\lambda +h)_{m}\ne 0\).

Summarizing the discussion above, there is a contradiction which shows that \(\mathcal {C}_{p}(1,p^{k}+1)\) is different from the codes in [16].

Furthermore, we can prove the codes in Sect. 3.2 are new by the same method. Since the proof is similar and lengthy, we omit the details.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Liu, Y., Cao, X. Optimal p-ary cyclic codes with two zeros. AAECC (2021). https://doi.org/10.1007/s00200-021-00489-5

Download citation


  • Cyclic code
  • optimal code
  • Sphere packing bound

Mathematics Subject Classification

  • 94B15
  • 11T71