1 Introduction

In coding theory, the class of linear codes is one of the most studied codes because of their rich algebraic structure and their well-defined mathematical properties. A linear code of length n over a finite field \(\mathbb {F}_{q}\) is a subspace of \(\mathbb {F}_{q}^{n}.\) In the early history of coding theory, researchers mainly studied linear codes over finite fields, especially over \({{\mathbb {Z}}}_{2}.\) Later, codes over rings have been considered by many researchers since the early seventies. However, they became a very popular research area with the work of Hammons et al. [9]. In [9], Hammons and coauthors showed that some well-known non-linear codes such as the Kerdock and Preparata codes, are actually Gray images of linear codes over \({{\mathbb {Z}}}_{4}.\) This work has led researchers to study codes over different rings, such as \({{\mathbb {Z}} }_{2^{k}}\), \({{\mathbb {Z}}}_{p^{k}}\) and \(\mathbb {F}_{q}+u\mathbb {F}_{q}.\) The reader may find some of such studies in [6, 8, 10].

In 2010, Borges et. al. introduced a new class of codes over rings, called \({ {\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive codes [3]. They defined \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive codes as subgroups of \({{\mathbb {Z}} _{2}^{r}\times {{\mathbb {Z}}_{4}^{s}}}.\) In fact, \({{\mathbb {Z}}_{2}{{\mathbb {Z}} _{4}}}\)-additive codes are generalization of binary linear codes and quaternary linear codes. If we take \(s=0,\) then we have the binary linear codes of length r and if \(r=0,\) then \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive codes are quaternary linear codes over \({{\mathbb {Z}}}_{4}\) of length s. Although the class of \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive codes is a very new family of codes, they have some applications in the field of Steganography [11]. In [1], a number of optimal binary linear codes were constructed as images of \({{\mathbb {Z}}_{2}{ {\mathbb {Z}}_{4}}}\)-additive cyclic codes using the Gray map. In [5], Borges et. al. generalized the study of \({{\mathbb {Z}}}_{2}{{\mathbb {Z}}}_{4}\)-additive cyclic codes to \({{\mathbb {Z}}}_{p^{r}}{{\mathbb {Z}}}_{p^{s}}\)-additive cyclic codes where p is a prime number and, r and s are coprimes with p.

The class of \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive codes is a very huge class. This implies that the number of distinct \({{\mathbb {Z}}_{2}{ {\mathbb {Z}}_{4}}}\)-additive codes is huge compared to the number of linear codes over \({{\mathbb {Z}}}_{2}\) or the number of linear codes over \({{\mathbb {Z }_{4}.}}\) In [7], Steven Dougherty et. al. studied the number of \({ {\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive codes. Moreover, Siap and Aydogdu studied counting the number of generator matrices of \({{\mathbb {Z}}_{2}{ {\mathbb {Z}}_{8}}}\)-additive codes in [12].

In this paper, we are interested in finding the exact number of distinct \({ {\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes of length \(n=r+s,\) for any positive integer r and any positive odd integer s. If s is any positive odd integer, then the ring \({{{\mathbb {Z}}_{4}}}\left[ x\right] {/}\left\langle x^{s}-1\right\rangle\) is a principal ideal ring and hence cyclic codes of length s over \({{{\mathbb {Z}}_{4}}}\) are principal ideals. We will provide a formula for the number of separable \({{\mathbb {Z}}_{2}{ {\mathbb {Z}}_{4}}}\)-additive cyclic codes of length n and another formula for the number of non-separable \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes of length n. Then, we have generalized our approach to provide the exact number of \({{\mathbb {Z}}_{p}{{\mathbb {Z}}_{p^{2}}}}\)-additive cyclic codes of length \(n=r+s,\) for any prime p,  any positive integer r and any positive integer s where \(\gcd \left( p,s\right) =1.\) The condition that \(\gcd \left( p,s\right) =1\) will guarantee that the ring \({{{\mathbb {Z}}_{p^{2}} }}\left[ x\right] {/}\left\langle x^{s}-1\right\rangle\) is a principal ideal ring and hence cyclic codes of length s over \({{{\mathbb {Z}}_{p^{2}}}}\) are principal ideals. As an application of our study, we will provide examples of the exact number of \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes and \({{\mathbb {Z}}}_{3}{{\mathbb {Z}}}_{9}\)-additive cyclic codes of different lengths.

2 \({{\mathbb {Z}}_2{{\mathbb {Z}}_4}}\)-additive and \({{\mathbb {Z}}_2{{\mathbb {Z}}_4}}\)-cyclic codes

In this section, we give the definitions of \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive and \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes, and we also give some properties of these codes. A comprehensive study of these codes can be found in [1] and in [3].

Definition 1

A non-empty subset \({\mathcal {C}}\) of \({{\mathbb {Z}}_{2}^{r}\times {{\mathbb {Z}} _{4}^{s}}}\) is called a \({{\mathbb {Z}}_2{{\mathbb {Z}}_4}}\)-additive code if \({ \mathcal {C}}\) is a subgroup of \({{\mathbb {Z}}_{2}^{r}\times {{\mathbb {Z}}_{4}^{s} }}.\)

If \({\mathcal {C}}\) is a \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive code, then it is isomorphic to an abelian group \({{\mathbb {Z}}}_{2}^{\gamma }\times {{\mathbb {Z}}}_{4}^{\delta }\) with the order of \({\mathcal {C}}\) given by \(|{ \mathcal {C}}|=2^{\gamma }4^{\delta }.\) Also, the number of order two codewords in \({\mathcal {C}}\) is \(2^{\gamma +\delta }.\) Let \(\kappa\) be the dimension of the binary linear code obtained by taking the subcode of \({ \mathcal {C}}\) containing all order-two codewords. In this case, the code \({\mathcal {C}}\) will be referred to as of type \(\left( r,s;\gamma ,\delta ;\kappa \right) .\)

Let \(\varphi :{{\mathbb {Z}}}_{4}\rightarrow {{\mathbb {Z}}}_{2}^{2}\) be the usual Gray map defined by \(\varphi (0)=00\), \(\varphi (1)=01\), \(\varphi (2)=11\) and \(\varphi (3)=10.\) \(\varphi\) can be extended to a map \(\Phi\) defined by

$$\begin{aligned} \Phi :{{\mathbb {Z}}_{2}^{r}\times {{\mathbb {Z}}_{4}^{s}}}\rightarrow & {} {\mathbb { Z}}_{2}^{n} \\ \left( u_{0},u_{1},\ldots u_{r-1}|v_{0},v_{1},\ldots v_{s-1}\right)\rightarrow & {} \left( u_{0},u_{1},\ldots u_{r-1}|\varphi (v_{0}),\varphi (v_{1}),\ldots \varphi (v_{s-1})\right) \end{aligned}$$

where \(n=r+2s\), \(\left( u_{0},u_{1},\ldots u_{r-1}|v_{0},v_{1},\ldots v_{s-1}\right) \in {{\mathbb {Z}}_{2}^{r}\times {{\mathbb {Z}}_{4}^{s}}}.\) The Gray image \(\Phi ({\mathcal {C}})\) is a binary code (not necessary linear since \(\Phi\) is not linear).

Example 2

Let \({\mathcal {C}}\) be a \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive code generated by

$$\begin{aligned} \left( \begin{array}{cc|cccc} 1 &{} 0 &{} 0 &{} 0 &{} 2 &{} 2 \\ 1 &{} 1 &{} 1 &{} 1 &{} 0 &{} 2 \end{array} \right) . \end{aligned}$$

Hence, \({\mathcal {C}} =\{00|0000,10|0022,11|1102,01|1120,00|2200,10|2222,11|3302,01|3320\}\).

  • The order of \({\mathcal {C}}\) is \(2^{1}4^{1}\), so \(\gamma =1\) and \(\delta =1.\)

  • \(r=2,s=4\) and \(\kappa =1\).

  • Therefore, \({\mathcal {C}}\) is of type (2, 4; 1, 1; 1).

Definition 3

Let \({\mathcal {C}}\) be a \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive code of length \(n=r+s.\) \({\mathcal {C}}\) is called a \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic code if \(c=\left( u_{0},u_{1},\ldots u_{r-1}|v_{0},v_{1},\ldots v_{s-1}\right)\) is a codeword in \({\mathcal {C}},\) then

$$\begin{aligned} \sigma \left( c\right) =\left( u_{r-1},u_{0},\ldots u_{r-2}|v_{s-1},v_{0},\ldots v_{s-2}\right) \end{aligned}$$

is also in \({\mathcal {C}}.\)

Let \(\mathcal {R}_{r,s}={{\mathbb {Z}}}_{2}[x]/\langle x^{r}-1\rangle \times { {\mathbb {Z}}}_{4}[x]/\langle x^{s}-1\rangle .\) Then any element \(c=\left( u_{0},u_{1},\ldots u_{r-1}|v_{0},v_{1},\ldots v_{s-1}\right)\) \(\in {\mathbb { Z}_{2}^{r}\times {{\mathbb {Z}}_{4}^{s}}}\) can be identified with an element in \(\mathcal {R}_{r,s}\) as follows:

$$\begin{aligned} c(x)= & {} \left( u_{0}+u_{1}x+\cdots +u_{r-1}x^{r-1},v_{0}+v_{1}x+\cdots +v_{s-1}x^{s-1}\right) \\= & {} \left( u(x),v(x)\right) \end{aligned}$$

This is one-one correspondence between the elements of \({{\mathbb {Z}} _{2}^{r}\times {{\mathbb {Z}}_{4}^{s}}}\) and the elements of \(\mathcal {R}_{r,s}.\) Therefore, we can identify \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes with polynomials of \(\mathcal {R}_{r,s}\). The following theorem gives the generator polynomials of \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes when s is an odd integer. Throughout this paper, we will use the notation f instead of the polynomial \(f\left( x\right) .\)

Theorem 4

([1]) Let \({\mathcal {C}}\) be a \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\) -additive cyclic code in \(\mathcal {R}_{r,s}\) with odd integer s. Then \({ \mathcal {C}}\) can be identified as

$$\begin{aligned} {\mathcal {C}}=\langle (f,0),(l,g+2a)\rangle , \end{aligned}$$

where \(f|(x^{r}-1)\,mod\,2\), \(a|g|(x^{s}-1)\,mod\,4,\) l is a binary polynomial satisfying \(\deg (l)<\deg (f),\) and \(f|\dfrac{x^{s}-1}{a}l.\)

Lemma 5

Let \({\mathcal {C}}=\left\langle (f,0),(l,g+2a)\right\rangle\) be a \({\mathbb { Z}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic code in \(\mathcal {R}_{r,s}\) with odd integer swhere the generators satisfy the conditions in Theorem 4. Then the generators \(f,\,l,\,g\) and a are unique.

Proof

The proof is similar to the proof of Theorem 3 in [2]. \(\square\)

Example 6

Let \({\mathcal {C}}\) be a \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic code in \({{\mathbb {Z}}}_{2}[x]/\langle x^{7}-1\rangle \times {{\mathbb {Z}}} _{4}[x]/\langle x^{7}-1\rangle\) generated by \(\langle (f,0),(l,g+2a)\rangle ,\) where

$$\begin{aligned} f= & {} x^{7}-1,\,l=1+x^{2}+x^{3}, \\ a= & {} 3+2x+3x^{2}+x^{3},\,g=1+x+x^{2}+x^{3}+x^{4}+x^{5}+x^{6}. \end{aligned}$$

The code \({\mathcal {C}}\) has the following generator matrix

$$\begin{aligned} G=\left( \begin{array}{cccccccccccccc} 1 &{} 0 &{} 1 &{} 1 &{} 0 &{} 0 &{} 0 &{} 3 &{} 1 &{} 3 &{} 3 &{} 1 &{} 1 &{} 1 \\ 1 &{} 1 &{} 1 &{} 0 &{} 1 &{} 0 &{} 0 &{} 2 &{} 2 &{} 2 &{} 0 &{} 2 &{} 0 &{} 0 \\ 0 &{} 1 &{} 1 &{} 1 &{} 0 &{} 1 &{} 0 &{} 0 &{} 2 &{} 2 &{} 2 &{} 0 &{} 2 &{} 0 \\ 0 &{} 0 &{} 1 &{} 1 &{} 1 &{} 0 &{} 1 &{} 0 &{} 0 &{} 2 &{} 2 &{} 2 &{} 0 &{} 2 \end{array} \right) . \end{aligned}$$

Furthermore, the binary image of \({\mathcal {C}}\) under the Gray map that we defined above is an optimal binary linear code with parameters [21, 5, 10].

Definition 7

Let \({\mathcal {C}}\) be a \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive code. \({ \mathcal {C}}\) is called separable if \({\mathcal {C}}={\mathcal {C}}_{X}\times { \mathcal {C}}_{Y}\), where

$$\begin{aligned} {\mathcal {C}}_{X}\times {\mathcal {C}}_{Y}=\{(a,b)\,|\,\text {there are codewords }(a,c_{2}),(c_{1},b)\in {\mathcal {C}}\}. \end{aligned}$$

Corollary 8

([4]) Let \({\mathcal {C}}=\langle (f,0),(l,g+2a)\rangle\) be a \({ {\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic code. Then, \({\mathcal {C}}\) is separable if and only if \(l=0.\)

3 The number of \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes

Let \({\mathcal {C}}\) be a \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic code in \(\mathcal {R}_{r,s},\) where s is an odd integer. Then \({\mathcal {C}}\) can be uniquely identified as

$$\begin{aligned} {\mathcal {C}}=\langle (f,0),(l,g+2a)\rangle , \end{aligned}$$
(1)

where \(f|(x^{r}-1)\,mod\,2\), \(a|g|(x^{s}-1)\,mod\,4,\) l is a binary polynomial satisfying \(\deg (l)<\deg (f)\) and \(f|\dfrac{\left( x^{s}-1\right) }{a}l.\) In this section, we are interested to determine a formula for the number of distinct \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes of length \(n=r+s.\) Before starting our main work, we will give a few remarks which are related to our work.

Remark

  1. 1.

    The generator polynomials in Eq. 1 are unique.

  2. 2.

    The only restrictions on the polynomial l are \(\deg (l)<\deg (f)\) and \(f|\dfrac{\left( x^{s}-1\right) }{a}l.\) This makes the number of \({ {\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic code in \(\mathcal {R}_{r,s}\) to be huge compared to the number of cyclic codes over \({{\mathbb {Z}}_{2}}\) or over \({{{\mathbb {Z}}_{4}.}}\) Moreover, the existence of the polynomial l as a part of the generators will make the problem of finding a general formula for the number of \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic code a challenging problem.

  3. 3.

    If r is odd then, \(\left( x^{r}-1\right) =\widetilde{f_{1}} \widetilde{f_{2}}\ldots \widetilde{f_{t}}\mod 2,\) is factored as a product of the irreducible factors \(\widetilde{f_{1},}\widetilde{f_{2},}\ldots , \widetilde{f_{t}}\). Any factor (not equal 1) of \(\left( x^{r}-1\right)\) will be labeled as \(f_{i}\) where \(i\in \left\{ 1,2,\ldots ,2^{t}-1\right\} .\) The same is applied for \(\left( x^{s}-1\right) \mod 4.\)

The number of \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes of length \(n=r+s,\) where r is any integer and s is an odd integer will be given in Corollary 14. But first we will find the number of these codes when r and s are odd positive integers. For the results from Lemma 9 until Theorem 13, we will always assume that r and s are any odd positive integers.

Lemma 9

Let \({\mathcal {C}}=\langle \left( f,0\right) ,\left( l,g+2a\right) \rangle\) be a cyclic code in \({\mathbb {\ Z}}_{2}[x]/\langle x^{r}-1\rangle \times {{\mathbb {Z}}}_{4}[x]/\langle x^{s}-1\rangle\), where \(f|(x^{r}-1)\,mod\,2\), \(a|g|(x^{s}-1)\,mod\,4,\,l\) is a binary polynomial satisfying \(\deg (l)<\deg (f)\) and \(f|\dfrac{\left( x^{s}-1\right) }{a}l.\) If \(\gcd \left( f,\dfrac{\left( x^{s}-1\right) }{a}\right) =1,\) then \({ \mathcal {C}}\) is a separable code.

Proof

By Corollary 12 in [1], the polynomial \(l=0.\) Hence, \({\mathcal {C}}\) is separable. \(\square\)

Lemma 10

The number of separable \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes in \(\mathcal {R}_{r,s}\) is \(2^{w_{1}}3^{w_{2}}\) where \(w_{1}\) is the number of irreducible factors of \(\left( x^{r}-1\right) \text { mod }2\) and \(w_{2}\) is the number of irreducible factors of \(\left( x^{s}-1\right) \text {mod }4.\)

Proof

Since \({\mathcal {C}}\) is separable then \({\mathcal {C}}=\langle \left( f,0\right) ,\left( 0,g+2a\right) \rangle ={\mathcal {C}}_{1}\times {\mathcal {C }}_{2},\) where \({\mathcal {C}}_{1}=\left\langle f\right\rangle\) is a binary cyclic code of length r and \({\mathcal {C}}_{2}=\left\langle g+2a\right\rangle\) is a quaternary cyclic code over \({\mathbb {Z}}_{4}\) of length s. The result follows from the fact that there are \(2^{w_{1}}\) binary cyclic codes of length r and \(3^{w_{2}}\) quaternary cyclic codes over \({\mathbb {Z}}_{4}\) of length s. \(\square\)

In order to count the number of non-separable cyclic codes in \({\mathbb {\ Z}} _{2}[x]/\langle x^{r}-1\rangle \times {{\mathbb {Z}}}_{4}[x]/\langle x^{s}-1\rangle\), by Lemma 9 we must always have \(\gcd \left( f, \dfrac{\left( x^{s}-1\right) }{a}\right) >1.\) Hence, when we consider non-separable \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes, we will always assume that \(\gcd \left( f,\dfrac{\left( x^{s}-1\right) }{a} \right) >1.\)

Lemma 11

Suppose that \({\mathcal {C}}=\left\langle \left( f,0\right) ,\left( l,g+2a\right) \right\rangle\) is a non-separable \(\mathbb { Z}_{2}{\mathbb {Z}}_{4}\)-additive cyclic code in \({\mathbb {\ Z}}_{2}[x]/\langle x^{r}-1\rangle \times {{\mathbb {Z}}}_{4}[x]/\langle x^{s}-1\rangle\) with \(\gcd \left( r,s\right) =1.\) Then

$$\begin{aligned} {\mathcal {C}}=\langle \left( \left( x-1\right) Q_{1},0\right) ,\left( Q_{1},g+2a\right) \rangle , \end{aligned}$$

where \(Q_{1}|(x^{r}-1)\,mod\,2,\,a|g|(x^{s}-1)\,mod\,4\) and \(\left( x-1\right)\) is not a factor of a.

Proof

Let \({\mathcal {C}}=\langle \left( f,0\right) ,\left( l,g+2a\right) \rangle\) be a non-separable cyclic code in \({\mathbb {\ Z}}_{2}[x]/\langle x^{r}-1\rangle \times {{\mathbb {Z}}}_{4}[x]/\langle x^{s}-1\rangle ,\) with \(\gcd (r,s)=1.\) Since \(\gcd \left( r,s\right) =1,\) then the only common factors of \(\left( x^{r}-1\right)\) and \(\left( x^{s}-1\right)\) \(\mod 2\) are 1 and \(\left( x-1\right) .\) Suppose that \(a=\left( x-1\right) J\) for some binary polynomial J. Since \(f|\dfrac{\left( x^{s}-1\right) }{a}l\) and \(\gcd \left( f,\dfrac{\left( x^{s}-1\right) }{a}\right) =1\), we get \(f|l,\) which is a contradiction unless \(l=0\), and hence the code is separable. Now, suppose that \(\left( x-1\right)\) is not a factor of f. Then, \(\gcd \left( f,\frac{x^{s}-1}{a}\right) =1\) and again l must be zero giving that \({ \mathcal {C}}\) is a separable code. Hence, in order for \({\mathcal {C}}\) to be a non-separable code, we must have \(\gcd \left( f,\frac{x^{s}-1}{a}\right) =x-1.\) This implies that \(f=\left( x-1\right) Q_{1}\) and \(\dfrac{x^{s}-1}{a} =\left( x-1\right) Q_{2},\) with \(\gcd \left( Q_{1},Q_{2}\right) =1.\) Since \(f|\dfrac{\left( x^{s}-1\right) }{a}l,\) then \(Q_{1}|Q_{2}l\) which implies that \(Q_{1}|l\) and \(l=Q_{1}V.\) Since \(\deg l<\deg f\) and \(f=\left( x-1\right) Q_{1}\), then \(l=Q_{1}.\) Thus, \({\mathcal {C}}=\langle \left( \left( x-1\right) Q_{1},0\right) ,\left( Q_{1},g+2a\right) \rangle ,\) where \(\left( x-1\right)\) is not a factor of a. \(\square\)

Theorem 12

Let \({\mathcal {C}}=\langle \left( f,0\right) ,\left( l,g+2a\right) \rangle\) be a non-separable cyclic code in \({\mathbb {\ Z}} _{2}[x]/\langle x^{r}-1\rangle \times {{\mathbb {Z}}}_{4}[x]/\langle x^{s}-1\rangle\) and let \(x^{r}-1=\widetilde{f_{1}}\widetilde{f_{2}}\ldots \widetilde{f_{t}}\mod 2\) and \(x^{s}-1=\widetilde{g_{1}}\widetilde{g_{2}} \ldots \widetilde{g_{w}}\mod 4\) be the factorizations of \(x^{r}-1\) and \(x^{s}-1\) into irreducible polynomials in \({{\mathbb {Z}}}_{2}[x]\) and \({\mathbb { Z}}_{4}[x]\), respectively, with \(\gcd (r,s)=1.\) Then, the number of non-separable \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes is given by

$$\begin{aligned} 2^{t}3^{w-1}. \end{aligned}$$

Proof

By Lemma 11, we know that \({\mathcal {C}}=\langle \left( \left( x-1\right) Q_{1},0\right) ,\left( Q_{1},g+2a\right) \rangle ,\) where \(Q_{1}|(x^{r}-1)\,mod\,2,\,a|g|(x^{s}-1)\,mod\,4\) and \(\left( x-1\right)\) is not a factor of a. Since \(x^{r}-1=\widetilde{f_{1}}\widetilde{f_{2}}\ldots \widetilde{f_{t}}\mod 2,\) then \(\left( x^{r}-1\right)\) has \(2^{t}\) different factors and \(Q_{1}\) has \(2^{t-1}\) choices (because \(\left( x-1\right)\) cannot be a factor of \(Q_{1}\)). For the polynomials a and g , we must have \(a\,|\,g\,|\left( x^{s}-1\right)\) and \(\left( x-1\right)\) is not a factor of a. Hence, the number of choices for a and g is

$$\begin{aligned}&\left( \begin{array}{c} w \\ 0 \end{array} \right) 2^{w}+\left( \begin{array}{c} w-1 \\ 1 \end{array} \right) 2^{w-1}+\left( \begin{array}{c} w-2 \\ 2 \end{array} \right) 2^{w-2}+\ldots +\left( \begin{array}{c} w-1 \\ w-1 \end{array} \right) 2^{1} \\&\quad =2^{w}+2\left[ \left( \begin{array}{c} w-1 \\ 1 \end{array} \right) 2^{w-2}+\left( \begin{array}{c} w-2 \\ 2 \end{array} \right) 2^{w-3}+\ldots +\left( \begin{array}{c} w-1 \\ w-2 \end{array} \right) 2^{1}+\left( \begin{array}{c} w-1 \\ w-1 \end{array} \right) 2^{0}\right] \\&\quad =2^{w}+2\left[ \begin{array}{c} \left( \begin{array}{c} w-1 \\ 0 \end{array} \right) 2^{w-1}+\left( \begin{array}{c} w-1 \\ 1 \end{array} \right) 2^{w-2}+\left( \begin{array}{c} w-2 \\ 2 \end{array} \right) 2^{w-3}+\ldots +\left( \begin{array}{c} w-1 \\ w-2 \end{array} \right) 2^{1} \\ +\left( \begin{array}{c} w-1 \\ w-1 \end{array} \right) 2^{0}-\left( \begin{array}{c} w-1 \\ 0 \end{array} \right) 2^{w-1} \end{array} \right] \\&\qquad 2^{w}+2\left[ 3^{w-1}-2^{w-1}\right] \\&\quad =2\times 3^{w-1}. \end{aligned}$$

Therefore, if \(\gcd (r,s)=1,\) then the number of non-separable cyclic codes is \(2^{t-1}\times 2\times 3^{w-1}=2^{t}3^{w-1}.\) \(\square\)

Our next theorem gives the number of non-separable cyclic codes for any odd integers r and s.

Theorem 13

Let \({\mathcal {C}}=\langle \left( f,0\right) ,\left( l,g+2a\right) \rangle\) be a non-separable cyclic code in \({\mathbb {\ Z}} _{2}[x]/\langle x^{r}-1\rangle \times {{\mathbb {Z}}}_{4}[x]/\langle x^{s}-1\rangle\). Assume that \(x^{r}-1=\widetilde{f_{1}}\widetilde{f_{2}} \ldots \widetilde{f_{t}}\) and \(x^{s}-1=\widetilde{g_{1}}\widetilde{g_{2}} \ldots \widetilde{g_{w}}\) are the factorizations of \(x^{r}-1\) and \(x^{s}-1\) into irreducible polynomials in \({{\mathbb {Z}}}_{2}[x]\) and \({{\mathbb {Z}}} _{4}[x]\), respectively. The number of non-separable \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes is given by

$$\begin{aligned} \left[ \sum _{i=1}^{2^{t}-1}\left( \sum _{j=0}^{w-1}2^{w-j}\sum _{k}^{{}}\left( 2^{\deg (m_{ijk})}-1\right) \right) \right] , \end{aligned}$$
(2)

where \(m_{ijk}=\gcd \left( f_{i},\frac{x^{s}-1}{a_{ijk}}\right) >1\) and \(a=a_{ijk}\) is the collection of all polynomials that satisfy the following conditions:

  1. 1.

    \(f_{i}|\left( \frac{x^{s}-1}{a_{ijk}}l\right) mod\,2\).

  2. 2.

    \(f_{i}\) is not a factor of \(a_{ijk}\) \(mod\,2.\)

  3. 3.

    \(a_{ijk}\) has exactly j factors of \(x^{s}-1.\)

  4. 4.

    The sum k runs over all the choices for a satisfying the above conditions.

Proof

Suppose that \({\mathcal {C}}\) is a non-separable \({{\mathbb {Z}}_{2}{{\mathbb {Z}} _{4}}}\)-additive cyclic code in \(\mathcal {R}_{r,s}\) of the form \({\mathcal {C} }=\) \(\langle (f,0),(l,g+2a)\rangle\) where

$$\begin{aligned} l\ne 0,\,f\,|\,\left( x^{r}-1\right) mod\,2,\,a\,|\,g\,|\,\left( x^{s}-1\right) mod\,4 \, \text {and} \,f\,|\,\left( \frac{x^{s}-1}{a}l\right) mod\,2\,\text {with} \,\deg (l)<\deg (f). \end{aligned}$$

We use the following diagram in order to give a clear picture of the proof. In the above theorem, we get the first sum by considering the condition \(f\,|x^{r}-1\) for a \({{\mathbb {Z}}}_{2}{{\mathbb {Z}}}_{4}\)-additive cyclic code \({ \mathcal {C}}\) and we have the other sums in a similar approach.

If \(f=1,\) then l must be 0 and hence the code is separable. Thus f is a polynomial of degree at least 1 satisfying the condition \(f\,|\,\left( x^{r}-1\right) .\) This will give \(\left( {\begin{array}{c}t\\ 1\end{array}}\right) +\left( {\begin{array}{c}t\\ 2\end{array}}\right) +\cdots +\left( {\begin{array}{c}t \\ t-1\end{array}}\right) +\left( {\begin{array}{c}t\\ t\end{array}}\right) =2^{t}-1\) different choices for f. So f runs over all the factors of \(x^{r}-1\) except for 1. That is, \(f=f_{i},\) \(i\in \{1,2,\ldots ,2^{t}-1\}\). This explains the first sum in Eq. 2. Now we will consider the polynomials g and a. We choose these polynomials among the ones that satisfy \(a|\,g|\left( x^{s}-1\right) mod\,4.\)

Case 1:

\(a=1\). Since \(f_{i}\,|\left( \frac{x^{s}-1}{a} l\right) ,\) then \(f_{i}\,|\left( x^{s}-1\right) l.\) This will produce \(\left( {\begin{array}{c} w\\ 0\end{array}}\right) +\left( {\begin{array}{c}w\\ 1\end{array}}\right) +\left( {\begin{array}{c}w\\ 2\end{array}}\right) +\cdots +\left( {\begin{array}{c}w\\ w\end{array}}\right) =2^{w}\) different choices for g with \(a_{{}}\,|\,g_{{}}\,|\,x^{s}-1\).

Case 2:

\(a=\widetilde{g_{i_1}}\), \(i\in \{1,2,...,w\}\), i.e., a has only one factor of \(x^s-1\). Again, since we know that \(a_{}\,|\,g_{}\,|\,x^{s}-1,\) then, we have \(\left( {\begin{array}{c}w-1\\ 0\end{array}}\right) +\left( {\begin{array}{c}w-1\\ 1\end{array}}\right) +\left( {\begin{array}{c} w-1\\ 2\end{array}}\right) +\cdots +\left( {\begin{array}{c}w-1\\ w-1\end{array}}\right) =2^{w-1}\) different choices for \(g_{}.\)

Case 3:

\(a=\widetilde{g_{i_{1}}}\widetilde{g_{i_{2}}}\ldots \widetilde{g_{i_{j}}},\) i.e., a has exactly j irreducible factors of \(x^{s}-1\), \(\,2\le j\le w-1\). Similar to the above cases we have \(2^{w-j}\) different choices for \(g_{{}}.\) It is important to emphasize that a cannot be equal to \(x^{s}-1\) since we must have \(f_{i}\,|\,\frac{x^{s}-1}{a}l\) with \(\deg (l)<\deg (f_{i}).\) So, we take \(j<w.\)

Note that the polynomial l satisfies the condition (1) in the theorem above. Suppose that \(f_{i}\) is a factor of \(a_{ijk}\) \(mod\,2.\) Then \(a_{ijk}=f_{i}T\,mod\,2.\) If \(f_{i}\,|\,\left( \frac{x^{s}-1}{f_{i}T}l\right)\) \(\text {mod }2\) and since s is odd, then \(f_{i}|\,l\) which contradicts the fact that \(\deg l<\deg f_{i}.\) Thus, \(f_{i}\) is not a factor of \(a_{ijk}\) \(mod\,2.\) This implies that the polynomial a must satisfy the conditions in the theorem to be one of the generators.

Finally, we will consider the polynomial l. Let \(m_{ijk}=\gcd \left( f_{i}, \dfrac{x^{s}-1}{a_{ijk}}\right) .\) Then, \(f_{i}=q_{1}m_{ijk}\) and \(\dfrac{ x^{s}-1}{a_{ijk}}=q_{2}m_{ijk}\) with \(\gcd \left( q_{1},q_{2}\right) =1.\) Since \(f_{i}\,|\,\left( \dfrac{x^{s}-1}{a_{ijk}}l\right) ,\)

$$\begin{aligned} \frac{x^{s}-1}{a_{ijk}}l= & {} f_{i}M \\ q_{2}m_{ijk}l= & {} q_{1}m_{ijk}M \\ q_{2}l= & {} q_{1}M. \end{aligned}$$

Hence, \(q_{1}|\,q_{2}l.\) Since \(\gcd \left( q_{1},q_{2}\right) =1,\) \(q_{1}|\,l,\) and \(l=q_{1}q_{3}=\dfrac{f_{i}}{m_{ijk}}q_{3}.\) Since \(\deg l<\deg f_{i}\), \(q_{3}\) may be any polynomial of degree less than the degree of \(m_{ijk}.\) Hence, there are \(2^{\deg \left( m_{ijk}\right) }\) different choices for l. However, if \(l=0\) then we get a separable code. Thus, there are \(2^{\deg \left( m_{ijk}\right) }-1\) choices for l which produces non-separable codes. Consequently, the number of non-separable \({\mathbb {Z}} _{2}{\mathbb {Z}}_{4}\)-additive cyclic codes is

$$\begin{aligned} \left[ \sum _{i=1}^{2^{t}-1}\left( \sum _{j=0}^{w-1}2^{w-j}\sum _{k}^{{}}\left( 2^{\deg (m_{ijk}(x))}-1\right) \right) \right] . \end{aligned}$$

\(\square\)

Our next result gives the number of \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes for any integer r and any odd integer s. Let \(r=2^{v}N\) where N is an odd integer. Then, we know that \(\left( x^{r}-1\right) =\left( x^{N}-1\right) ^{2^{v}}=\widetilde{f_{1}}^{2^{v}} \widetilde{f_{2}}^{2^{v}}\ldots \widetilde{f_{t}}^{2^{v}}\) is the factorization of \(\left( x^{r}-1\right)\) into powers of irreducible polynomials. The number of binary cyclic codes of length r is \(\left( 2^{v}+1\right) ^{t}.\) Based on this fact, our previous results can be applied for any integer r.

Corollary 14

Suppose that \(\left( x^{r}-1\right) =\left( x^{N}-1\right) ^{2^{v}}=\widetilde{f_{1}}^{2^{v}}\widetilde{f_{2}} ^{2^{v}}\ldots \widetilde{f_{t}}^{2^{v}}\) is the factorization of \(\left( x^{r}-1\right)\) into powers of irreducible polynomials in \({{\mathbb {Z}}} _{2}[x]\) and \(x^{s}-1=\widetilde{g_{1}}\widetilde{g_{2}}...\widetilde{g_{w}}\) be the factorization \(x^{s}-1\) into irreducible polynomials in \({{\mathbb {Z}}} _{4}[x].\)

  1. 1.

    The number of separable \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\) -additive cyclic codes is \(\left( 2^{v}+1\right) ^{t}3^{w}.\)

  2. 2.

    If \(\left( r,s\right) =1\), then the number of non-separable \({\mathbb {Z }_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes is \(\left( 2^{v}+1\right) ^{t}3^{w-1}.\)

  3. 3.

    If \(\left( r,s\right) \ne 1\), then the number of non-separable \({ {\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes is

    $$\begin{aligned} \left[ \sum _{i=1}^{\left( 2^{v}+1\right) ^{t}-1} \left( \sum _{j=0}^{w-1}2^{w-j}\sum _{k}^{{}}\left( 2^{\deg (m_{ijk}(x))}-1\right) \right) \right] . \end{aligned}$$

Proof

The proof follows from Lemma 10, Theorems 12 and 13\(\square\)

4 Examples

Example 15

Let \(r=9\) and \(s=7\). Then,

$$\begin{aligned} x^{9}-1= & {} x^{9}-1=(1+x)(1+x+x^{2})(1+x^{3}+x^{6})\text { in}\,{{\mathbb {Z}}} _{2}[x]\text { and} \\ x^{7}-1= & {} (x+3)(x^{3}+2x^{2}+x+3)(x^{3}+3x^{2}+2x+3)\,\text {in}\,{{\mathbb {Z}}} _{4}[x]. \end{aligned}$$

The number of separable \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes is \(2^{3}3^{3}=216\). Since \(\gcd \left( r,s\right) =1\), the number of non-separable \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes is \(2^{3}3^{2}=72\) by Theorem 12. Hence, the total number of \({\mathbb { Z}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes of length \(n=r+s=16\) is \(216+72=288\).

Example 16

Let \(r=7=s\). Then

$$\begin{aligned} x^{7}-1= \;& {} (x-1)(x^{3}+x+1)(x^{3}+x^{2}+1)\,\text{in}\,{{\mathbb {Z}}}_{2}[x]\,\text {and} \\ x^{7}-1= \;& {} (x+3)(x^{3}+2x^{2}+x+3)(x^{3}+3x^{2}+2x+3)\,\text{in}\,{{\mathbb {Z}}}_{4}[x]. \end{aligned}$$

Label the factors of \(\left( x^{7}-1\right) \mod 2\) as: \( f_{1}=(1+x),\,f_{2}=(1+x+x^{3}),\,f_{3}=(1+x^{2}+x^{3}),\,f_{4}=(1+x)(1+x+x^{3}),\,f_{5}=(1+x)(1+x^{2}+x^{3}),\,f_{6}=(1+x+x^{3})(1+x^{2}+x^{3}),\,f_{7}=x^{7}-1.\) Label the factors of \(\left( x^{7}-1\right)\) in \({{\mathbb {Z}}}_{4}[x]\) as

$$\begin{aligned} g_{1}= & {} (3+x),g_{2}=(3+x+2x^{2}+x^{3}),g_{3}=(3+2x+3x^{2}+x^{3}), \\ g_{4}= & {} (3+x)(3+x+2x^{2}+x^{3}),g_{5}=(3+x)(3+2x+3x^{2}+x^{3}), \\ g_{6}= & {} (3+x+2x^{2}+x^{3})(3+2x+3x^{2}+x^{3}),g_{7}=x^{7}-1. \end{aligned}$$

First, let \({\mathcal {C}}\) be a separable \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic code with \({\mathcal {C}}=\langle \left( f,0\right) ,\left( 0,g+2a\right) \rangle\). By Lemma 10, there are \(2^{3}3^{3}=216\) separable \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes.

Now, we will find the number of non-separable \({{\mathbb {Z}}_{2}{\ {\mathbb {Z}} _{4}}}\)-additive cyclic codes. According to Theorem 13, the number of non-separable \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes with \(r=s=7\) is

$$\begin{aligned} \sum _{i=1}^{7}\left( \sum _{j=0}^{2}2^{3-j}\sum _{k}^{{}}\left( 2^{\deg (m_{ijk})}-1\right) \right) , \end{aligned}$$

where the number of choices for the polynomial f is 7. Let \(f=(1+x)=f_{1}\). Based on Theorem 13, we have the number of codes for this choice of f to be

$$\begin{aligned} \sum _{j=0}^{2}2^{3-j}\sum _{k}^{{}}\left( 2^{\deg (m_{1jk})}-1\right) . \end{aligned}$$

If \(j=0,\) then \(a_{1,0,k}\) is the collection of all polynomials that do not contain \(f_{1}\mod 2\) and have 0 factors of \(x^{7}-1.\) Hence, there is only one choice for \(a=1\) and in this case \(k=1\) with

$$\begin{aligned} m_{1,0,1}(x)=\gcd \left( 1+x,x^{7}-1\right) =(1+x)=f_{1}(x). \end{aligned}$$

If \(j=1,\) then \(a_{1,1,k}\) is the collection of all polynomials that do not contain \(f_{1}\mod 2\) and have 1 factor of \(\left( x^{7}-1\right) \mod 2.\) Hence, there are two choices as \(g_{2},\,g_{3}\) and in this case \(k=1,2\) with

$$\begin{aligned} m_{1,1,1}= & {} \gcd \left( 1+x,\frac{x^{7}-1}{g_{2}}\right) =(1+x)=f_{1},\text { and} \\ m_{1,1,2}= & {} \gcd \left( 1+x,\frac{x^{7}-1}{g_{3}}\right) =(1+x)=f_{1}. \end{aligned}$$

If \(j=2,\) then \(a_{1,2,k}\) is the collection of all polynomials that do not contain \(f_{1} \mod 2\) and have 2 factors of \(x^{7}-1.\) Hence there is only 1 choice as \(g_{6}\) and in this case \(k=1\) with

$$\begin{aligned} m_{1,2,1}=\gcd \left( 1+x,\frac{x^{7}-1}{g_{6}}\right) =(1+x)=f_{1}. \end{aligned}$$

Thus the number of codes when \(f=f_{1}\) is

$$\begin{aligned} 8\left( 2^{1}-1\right) +4\left[ \left( 2^{1}-1\right) +\left( 2^{1}-1\right) \right] +2\left( 2^{1}-1\right) =18. \end{aligned}$$

If \(f=f_{2}=(1+x+x^{3}),\) then a similar approach as above will give

$$\begin{aligned} 8\left( 2^{3}-1\right) +4\left[ \left( 2^{3}-1\right) +\left( 2^{3}-1\right) \right] +2\left( 2^{3}-1\right) =126\text { codes.} \end{aligned}$$

If \(f=f_{3}=(1+x^{2}+x^{3}),\) then a similar approach as above will give

$$\begin{aligned} 8\left( 2^{3}-1\right) +4\left[ \left( 2^{3}-1\right) +\left( 2^{3}-1\right) \right] +2\left( 2^{3}-1\right) =126\text { codes.} \end{aligned}$$

If \(f=(1+x)(1+x+x^{3})=f_{4}\) then a similar approach as above will give

$$\begin{aligned} 8\left[ 2^{4}-1\right] +4\left[ (2^{3}-1)+(2^{1}-1)+(2^{4}-1)\right] +2\left[ (2^{3}-1)+(2^{1}-1)\right] =228\text { codes.} \end{aligned}$$

If \(f=(1+x)(1+x^{2}+x^{3})=f_{5}\) then we get the same number of codes as in the case \(f=f_{4}\) above. Hence, there are 228 codes with \(f=f_{5}.\)

If \(f=f_{6}=f=(1+x+x^{3})(1+x^{2}+x^{3}),\) then we have

\(j=0\). In this case there is only one choice for \(a=1\) and \(k=1\) with

$$\begin{aligned} m_{6,0,1}=\gcd \left( f_{6},x^{7}-1\right) =f_{6}. \end{aligned}$$

If \(j=1\), then there are 3 choices for a and \(k=1,2,3\) with

$$\begin{aligned} m_{6,1,1}= & {} \gcd \left( f_{6},\frac{x^{7}-1}{g_{1}}\right) =f_{6} \\ m_{6,1,2}= & {} \gcd \left( f_{6},\frac{x^{7}-1}{g_{2}}\right) =\left( 1+x^{2}+x^{3}\right) \\ m_{6,1,3}= & {} \gcd \left( f_{6},\frac{x^{7}-1}{g_{3}}\right) =\left( 1+x+x^{3}\right) . \end{aligned}$$

If \(j=2,\) then there are 2 choices for a and \(k=1,2\) with

$$\begin{aligned} m_{6,2,1}= & {} \gcd \left( f_{6},\frac{x^{7}-1}{g_{4}}\right) =\left( 1+x^{2}+x^{3}\right) \\ m_{6,2,2}= & {} \gcd \left( f_{6},\frac{x^{7}-1}{g_{5}}\right) =\left( 1+x+x^{3}\right) . \end{aligned}$$

Hence in this case, the number of codes is

$$\begin{aligned} \sum _{j=0}^{2}2^{3-j}\sum _{k}^{{}}\left( 2^{\deg (m_{i,j,k})}-1\right)= & {} 8 \left[ 2^{6}-1\right] +4\left[ (2^{6}-1)+(2^{3}-1)+(2^{3}-1)\right] \\&+\,2\left[ (2^{3}-1)+(2^{3}-1)\right] \\= & {} 504+308+28=840. \end{aligned}$$

If \(f=f_{7}=x^{7}-1,\) then we get

$$\begin{aligned} \sum _{j=0}^{2}2^{3-j}\sum _{k}^{{}}\left( 2^{\deg (m_{i,j,k})}-1\right)= & {} 2^{3}\left[ 2^{7}-1\right] +2^{2}\left[ \left( 2^{6}-1\right) +\left( 2^{4}-1\right) +\left( 2^{4}-1\right) \right] \\&+\,2\left[ \left( 2^{3}-1\right) +\left( 2^{3}-1\right) +\left( 2^{1}-1\right) \right] \\= & {} 1016+372+30=1418\text { codes.} \end{aligned}$$

Therefore, the total number of non-separable \({{\mathbb {Z}}_{2}{{\mathbb {Z}} _{4} }}\)-additive cyclic codes when \(r=s=7\) is

$$\begin{aligned} 18+126+126+228+228+840+1418=2984. \end{aligned}$$

Example 17

Let \(r=9\) and \(s=15\). Then,

$$\begin{aligned} x^{9}-1= & {} (1+x)(1+x+x^{2})(1+x^{3}+x^{6})\text { in}\,{{\mathbb {Z}}}_{2}[x]\, \text {and} \\ x^{15}-1= & {} (3+x)(1+x+x^{2})(1+3x+2x^{2}+x^{4})(1+2x^{2}+3x^{3}+x^{4}) \\&(1+x+x^{2}+x^{3}+x^{4})\text { in}\,{{\mathbb {Z}}}_{4}[x]. \end{aligned}$$

Hence, by Lemma 10, the number of separable \({{\mathbb {Z}}_{2}{ {\mathbb {Z}}_{4}}}\)-additive cyclic codes for \(r=9\) and \(s=7\) is \(2^{3}3^{5}=1944\). By Theorem 13, the number of non-separable \({ {\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes is

$$\begin{aligned} \sum _{i=1}^{2^{3}-1}\left( \sum _{j=0}^{4}2^{5-j}\sum _{k}^{{}}\left( 2^{\deg (m_{i,j,k})}-1\right) \right) . \end{aligned}$$

Let us label the factors of \(x^{9}-1\) as

$$\begin{aligned} f_{1}= & {} (1+x),f_{2}=(1+x+x^{2}),f_{3}=(1+x^{3}+x^{6}), \\ f_{4}= & {} (1+x)(1+x+x^{2}),f_{5}=(1+x)(1+x^{3}+x^{6}), \\ f_{6}= & {} (1+x+x^{2})(1+x^{3}+x^{6}),f_{7}=x^{9}-1, \end{aligned}$$

and label the factors of \(x^{15}-1\) as

$$\begin{aligned} \begin{array}{rcl} g_{1} &{}=&{}(3+x),g_{2}=(1+x+x^{2}),g_{3}=(1+3x+2x^{2}+x^{4}), \\ g_{4} &{}=&{}(1+2x^{2}+3x^{3}+x^{4}),g_{5}=(1+x+x^{2}+x^{3}+x^{4}), \\ g_{6} &{}=&{}(3+x)(1+x+x^{2}),g_{7}=(3+x)(1+3x+2x^{2}+x^{4}), \\ \vdots &{}\vdots &{}\vdots \\ g_{30} &{}=&{}(3+x)(1+x+x^{2})(1+3x+2x^{2}+x^{4})(1+2x^{2}+3x^{3}+x^{4}), \\ g_{31} &{}=&{}x^{15}-1. \end{array} \end{aligned}$$

Note that since \(\gcd \left( f_{3},x^{15}-1\right) =1\), f cannot be chosen as to be \(f_{3}.\) We start calculating the cyclic codes which correspond to \(f=f_{1}=1+x.\)

If \(j=0,\) then \(k=1,\,a=1,\) and

$$\begin{aligned} m_{1,0,1}=\gcd \left( 1+x,x^{15}-1\right) =1+x. \end{aligned}$$

If \(j=1,\) then, \(k\in \{1,2,3,4\}\) and

$$\begin{aligned} m_{1,1,1}=m_{1,1,2}=m_{1,1,3}=m_{1,1,4}=1+x \end{aligned}$$

If \(j=2,\) then, \(k\in \{1,2,3,4,5,6\}\) and

$$\begin{aligned} m_{1,2,1}=m_{1,2,2}=\cdots =m_{1,2,6}=1+x \end{aligned}$$

For \(j=3,\) then, \(k\in \{1,2,3,4\}\) and

$$\begin{aligned} m_{1,3,1}=m_{1,3,2}=m_{1,3,3}=m_{1,3,4}=1+x \end{aligned}$$

Finally, for \(j=4,\)

$$\begin{aligned} m_{1,4,1}= & {} \gcd \left( f_{1},\frac{x^{15}-1}{a_{1,4,1}(x)}\right) =1+x, \text { where} \\ a_{1,4,1}= & {} (1+x+x^{2})(1+3x+2x^{2}+x^{4})(1+2x^{2}+3x^{3}+x^{4})(1+x+x^{2}+x^{3}+x^{4}). \end{aligned}$$

Consequently, we have

$$\begin{aligned}&32\cdot (2^{1}-1)+16\cdot [\underbrace{(2^{1}-1)+\cdots +(2^{1}-1)} _{\text {4 times}}\ ]+8\cdot [\underbrace{(2^{1}-1)+\cdots +(2^{1}-1)} _{\text {6 times}}\ ] \\&\quad +4\cdot [\underbrace{(2^{1}-1)+\cdots +(2^{1}-1)}_{\text {4 times}}\ ]+2\cdot (2^{1}-1)=32+64+48+16+2=162 \end{aligned}$$

\({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes for \(f=f_{1}=1+x.\) If we take \(f=f_{2}\), then we have

$$\begin{aligned}&32\cdot (2^{2}-1)+16\cdot [\underbrace{(2^{2}-1)+\cdots +(2^{2}-1)} _{\text {4 times}}\ ]+8\cdot [\underbrace{(2^{2}-1)+\cdots +(2^{2}-1)} _{\text {6 times}}\ ] \\&\quad +4\cdot [\underbrace{(2^{2}-1)+\cdots +(2^{2}-1)}_{\text {4 times}}\ ]+2\cdot (2^{2}-1)=96+192+144+48+6=486\text { codes.} \end{aligned}$$

For \(f=f_{4},\) by applying Theorem 13, we get

$$\begin{aligned}&32\cdot (2^{3}-1)+16\cdot [(2^{2}-1)+(2^{1}-1)+\underbrace{ (2^{3}-1)+\cdots +(2^{3}-1)}_{\text {3 times}}\ ] \\&\quad +8\cdot [\underbrace{(2^{2}-1)+\cdots +(2^{2}-1)}_{\text {3 times}}+ \underbrace{(2^{1}-1)+\cdots +(2^{1}-1)}_{\text {3 times}}+\underbrace{ (2^{3}-1)+\cdots +(2^{3}-1)}_{\text {3 times}}\ ] \\&\quad +4\cdot [\underbrace{(2^{2}-1)+\cdots +(2^{2}-1)}_{\text {3 times}}+ \underbrace{(2^{1}-1)+\cdots +(2^{1}-1)}_{\text {3 times}}+(2^{3}-1)] \\&\quad +2\cdot [(2^{2}-1)+(2^{1}-1)]=32\cdot 7+16\cdot 25+8\cdot 33+4\cdot 19+2\cdot 4=972 \end{aligned}$$

\({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes. Furthermore, we calculate the number of \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes as

$$\begin{aligned} \text {for }f_{5}\longrightarrow & {} 162, \\ \text {for }f_{6}\longrightarrow & {} 486, \\ \text {for }f_{7}\longrightarrow & {} 972. \end{aligned}$$

Finally the total number of non-separable additive cyclic code \({\mathcal {C}} \subseteq {{\mathbb {Z}}}_{2}[x]/\langle x^{9}-1\rangle \times {{\mathbb {Z}}} _{4}[x]/\langle x^{15}-1\rangle\) is

$$\begin{aligned} 162+486+972+162+486+972=3240, \end{aligned}$$

and the total number of \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes is \(1944+3240=5184\).

5 The number of \({{\mathbb {Z}}_{p}{{\mathbb {Z}}_{p^{2}}}}\)-additive cyclic codes

Let p be any prime number, r is any positive integer and s is any positive integer relatively prime with p. In this case, the ring \({ {\mathbb {Z}}}_{p^{2}}[x]/\langle x^{s}-1\rangle\) will be a principal ideal ring. In this section, we are interested to generalize our previous results and find formulas for the number of separable and non-separable \({{\mathbb {Z}} _{p}{{\mathbb {Z}}_{p^{2}}}}\)-additive cyclic codes of length \(n=r+s.\) In [5], Borges et. al. studied the structure of \({{\mathbb {Z}}_{p^{r}}{ {\mathbb {Z}}_{p^{s}}}}\)-additive cyclic codes. Hence, based on this work if \({ \mathcal {C}}\) is an additive cyclic code over \({{\mathbb {Z}}_{p}{{\mathbb {Z}} _{p^{2}}}}\) of length \(n=r+s\), then \({\mathcal {C}}\) is generated by

$$\begin{aligned} {\mathcal {C}}=\langle \left( f,0\right) ,\left( l,g+pa\right) \rangle \end{aligned}$$

where \(f|(x^{r}-1)\,mod\,p\), \(a|g|(x^{s}-1)\,mod\,p^{2},\) l is a polynomial over \({\mathbb {Z}}_{p}[x]\) satisfying \(\deg (l)<\deg (f),\) and \(f|\dfrac{ x^{s}-1}{a}l.\) As in the case of \({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes, the above generators are unique. Moreover, the code \({\mathcal {C}}\) is separable if and only if the polynomial \(l=0.\)

Lemma 18

The number of separable \({{\mathbb {Z}}_{p}{{\mathbb {Z}}_{p^{2}} }}\)-additive cyclic codes of length \(n=r+s\) is \({(p^v+1)}^{w_{1}}3^{w_{2}}\) where \(\left( x^{r}-1\right)=\left( x^{N}-1\right)^{p^v}, \text{ }w_{1}\) is the number of irreducible factors of \(\left( x^{r}-1\right) \text { mod }p\) and \(w_{2}\) is the number of irreducible factors of \(\left( x^{s}-1\right) \text {mod }p^{2}.\)

Proof

The proof is similar to the proof of Lemma 10. \(\square\)

In fact, as we have showed in the proof of Theorem 13, the number of \({\mathbb {Z}}_{2}{\mathbb {Z}}_{4}\)-additive cyclic codes are determined only by the generator polynomials of the code \({\mathcal {C}}\). Hence, the same proof can easily be applied to give the exact number of \({{\mathbb {Z}}_{p}{{\mathbb {Z}} _{p^{2}}}}\)-additive cyclic codes of length \(n=r+s.\)

Corollary 19

Let \({\mathcal {C}}=\langle \left( f,0\right) ,\left( l,g+pa\right) \rangle\) be a non-separable cyclic code in \({{\mathbb {Z}}} _{p}[x]/\langle x^{r}-1\rangle \times {{\mathbb {Z}}}_{p^{2}}[x]/\langle x^{s}-1\rangle \text{ with } (r,s)\neq 1\). Assume that \(x^{r}-1=(\widetilde{f_{1}}\widetilde{f_{2}} \ldots \widetilde{f_{t}})^{p^v}\) and \(x^{s}-1=\widetilde{g_{1}}\widetilde{g_{2}} \ldots \widetilde{g_{w}}\) are the factorizations of \(x^{r}-1\) and \(x^{s}-1\) into irreducible polynomials in \({{\mathbb {Z}}}_{p}[x]\) and \({{\mathbb {Z}}} _{p^{2}}[x]\), respectively. The number of \({{\mathbb {Z}}_{p}{{\mathbb {Z}}_{p^{2}} }}\)-additive cyclic codes is given by

$$\begin{aligned} \left[ \sum _{i=1}^{({p^v+1})^{t}-1}\left( \sum _{j=0}^{w-1}2^{w-j}\sum _{k}^{{}}\left( p^{\deg (m_{ijk})}-1\right) \right) \right] , \end{aligned}$$

where \(m_{ijk}=\gcd \left( f_{i},\frac{x^{s}-1}{a_{ijk}}\right) >1\) and \(a=a_{ijk}\) is the collection of all polynomials that satisfy the following conditions:

  1. 1.

    \(f_{i}|\left( \frac{x^{s}-1}{a_{ijk}}l\right) mod\,p\).

  2. 2.

    \(f_{i}\) is not a factor of \(a_{ijk}\) \(mod\,p.\)

  3. 3.

    \(a_{ijk}\) has exactly j factors of \(x^{s}-1.\)

  4. 4.

    The sum k runs over all the choices for a satisfying the above conditions.

Proof

The proof of this corollary is very similar to the proof of Theorem 13. So we skip it. \(\square\)

Example 20

Let \({\mathcal {C}}\) be a \({{\mathbb {Z}}}_{3}{{\mathbb {Z}}}_{9}\)-additive cyclic code in \({\mathbb {\ Z}}_{3}[x]/\langle x^{7}-1\rangle \times {{\mathbb {Z}}} _{9}[x]/\langle x^{7}-1\rangle\). Hence, \(p=3,\,r=7=s.\) Therefore,

$$\begin{aligned} x^{7}-1= & {} (2+x)(1+x+x^{2}+x^{3}+x^{4}+x^{5}+x^{6})\,in\,{{\mathbb {Z}}}_{3}[x]\, \text {and} \\ x^{7}-1= & {} (8+x)(1+x+x^{2}+x^{3}+x^{4}+x^{5}+x^{6})\,in\,{{\mathbb {Z}}}_{9}[x]. \end{aligned}$$

Label the factors of \(\left( x^{7}-1\right) \mod 3\) as: \(f_{1}=(2+x),\,f_{2}=(1+x+x^{2}+x^{3}+x^{4}+x^{5}+x^{6}),\) and \(f_{3}=\left( x^{7}-1\right) .\) Label the factors of \(\left( x^{7}-1\right)\) in \({\mathbb { Z}}_{9}[x]\) as: \(g_{1}=(8+x),\,g_{2}=(1+x+x^{2}+x^{3}+x^{4}+x^{5}+x^{6}),\) and \(g_{3}=\left( x^{7}-1\right)\).

First, let \({\mathcal {C}}\) be a separable \({{\mathbb {Z}}_{3}{{\mathbb {Z}}_{9}}}\)-additive cyclic code with \({\mathcal {C}}=\langle \left( f,0\right) ,\left( 0,g+3a\right) \rangle\). By Lemma 18, there are \(2^{3}3^{3}=216\) separable \({{\mathbb {Z}}_{3}{{\mathbb {Z}}_{9}}}\)-additive cyclic codes.

Based on Corollary 19, the number of non-separable \({ {\mathbb {Z}}_{3}{{\mathbb {Z}}_{9}}}\)-additive cyclic codes with \(r=s=7\) is

$$\begin{aligned} \sum _{i=1}^{3}\left( \sum _{j=0}^{1}2^{2-j}\sum _{k}^{{}}\left( 3^{\deg (m_{ijk})}-1\right) \right) , \end{aligned}$$

where the number of choices for the polynomial f is 3. First, take \(f=(2+x)=f_{1}\). Hence, the number of codes for this choice of f is

$$\begin{aligned} \sum _{j=0}^{1}2^{2-j}\sum _{k}^{{}}\left( 3^{\deg (m_{1jk})}-1\right) . \end{aligned}$$

If \(j=0,\) then \(a_{1,0,k}\) is the collection of all polynomials that do not contain \(f_{1}\mod 3\) and have 0 factors of \(x^{7}-1.\) Hence, there is only one choice for \(a=1\) and in this case \(k=1\) with

$$\begin{aligned} m_{1,0,1}(x)=\gcd \left( 2+x,x^{7}-1\right) =(2+x)=f_{1}(x). \end{aligned}$$

If \(j=1,\) then \(a_{1,1,k}\) is the collection of all polynomials that do not contain \(f_{1}\mod 3\) and have 1 factor of \(\left( x^{7}-1\right) \mod 3.\) Hence, there is only one choice which is \(g_{2}\) and in this case \(k=1\) with

$$\begin{aligned} m_{1,1,1}=\gcd \left( 2+x,\dfrac{x^{7}-1}{g_{2}}\right) =(2+x)=f_{1}. \end{aligned}$$

Thus the number of codes when \(f=f_{1}\) is

$$\begin{aligned} 4\left( 3^{1}-1\right) +2\left( 3^{1}-1\right) =12. \end{aligned}$$

Now, if \(f=f_{2}=(1+x+x^{2}+x^{3}+x^{4}+x^{5}+x^{6})\) then similarly we have

$$\begin{aligned} 4\left( 3^{6}-1\right) +2\left( 3^{6}-1\right) =4368\text { codes.} \end{aligned}$$

If \(f=f_{3}=x^{7}-1,\) then we get

$$\begin{aligned} \sum _{j=0}^{1}2^{2-j}\sum _{k}^{{}}\left( 3^{\deg (m_{i,j,k})}-1\right)= & {} 2^{2}\left[ 3^{7}-1\right] +2\left[ \left( 3^{6}-1\right) +\left( 3^{1}-1\right) \right] \\= & {} 8744+1460=10204\text { codes.} \end{aligned}$$

Therefore, the total number of non-separable \({{\mathbb {Z}}_{3}{{\mathbb {Z}}_{9}} }\)-additive cyclic codes when \(r=s=7\) is

$$\begin{aligned} 12+4368+10204=14584. \end{aligned}$$

Note that the number of non-separable \({{\mathbb {Z}}}_{2}{{\mathbb {Z}}}_{4}\)-additive cyclic codes for \(r=s=7\) is 2984.

6 Conclusion

\({{\mathbb {Z}}_{2}{{\mathbb {Z}}_{4}}}\)-additive cyclic codes were studied recently by many researchers [1, 3, 4]. In this paper, we focused on counting the exact number of \({{\mathbb {Z}}_{2}{ {\mathbb {Z}}_{4}}}\)-additive cyclic codes of length \(n=r+s,\) for any positive integer r and any positive odd integer s. Moreover, we provided formulas which give the exact number of separable and non-separable \({{\mathbb {Z}}_{2}{ {\mathbb {Z}}_{4}}}\)-additive cyclic codes. We then generalized our results to find the number of separable and non-separable \({{\mathbb {Z}}_{p}{{\mathbb {Z}} _{p^{2}}}}\)-additive cyclic codes of length \(n=r+s,\) for any prime p,  any positive integer r and any positive integer s where \(\gcd \left( p,s\right) =1\).