Finite Fields and Their Applications 83 (2022) 102093 Contents lists available at ScienceDirect Finite Fields and Their Applications www.elsevier.com/locate/ffa On the constructions of Zp Zp2 -linear generalized Hadamard codes ✩,✩✩ Dipak K. Bhunia ∗ , Cristina Fernández-Córdoba, Mercè Villanueva Department of Information and Communications Engineering, Universitat Autònoma de Barcelona, 08193 Cerdanyola del Vallès, Spain a r t i c l e i n f o a b s t r a c t α2 The Zp Zp2 -additive codes are subgroups of Zα p × Zp2 , and Article history: 1 Received 23 May 2022 can be seen as linear codes over Zp when α2 = 0, Zp2 - Accepted 11 July 2022 additive codes when α1 = 0, or Z2 Z4 -additive codes when Available online 21 July 2022 Communicated by James W.P. p = 2. A Zp Zp2 -linear generalized Hadamard (GH) code is a Hirschfeld GH code over Zp which is the Gray map image of a Zp Zp2 - additive code. In this paper, we generalize some known results MSC: for Zp Zp2 -linear GH codes with p = 2 to any p ≥ 3 prime 94B25 when α1 = 0. First, we give a recursive construction of Zp Zp2 - 94B60 additive GH codes of type (α1 , α2 ; t1 , t2 ) with t1 , t2 ≥ 1. We also present many different recursive constructions of Zp Zp2 - Keywords: additive GH codes having the same type, and show that we Generalized Hadamard code obtain permutation equivalent codes after applying the Gray Gray map map. Finally, according to some computational results, we Zp Zp2 -linear code see that, unlike Z4 -linear GH codes, when p ≥ 3 prime, the Zp2 -linear GH codes are not included in the family of Zp Zp2 - linear GH codes with α1 = 0. Indeed, we observe that the ✩ This work has been partially supported by the Spanish Ministerio de Ciencia e Innovación under Grant PID2019-104664GB-I00 (AEI / 10.13039/501100011033) and by the Catalan AGAUR scholarship 2020 FI SDUR 00475. ✩✩ The material in this paper was presented in part at the 12th International Workshop on Coding and Cryptography (WCC 2022), 7-11 March 2022 - Virtual [1]. * Corresponding author. E-mail address: dipak.bhunia@uab.cat (D.K. Bhunia). https://doi.org/10.1016/j.ffa.2022.102093 1071-5797/© 2022 The Author(s). Published by Elsevier Inc. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/). 2 D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 constructed codes are not equivalent to the Zps -linear GH codes for any s ≥ 2. © 2022 The Author(s). Published by Elsevier Inc. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/). 1. Introduction Let Zp and Zp2 be the ring of integers modulo p and p2 , respectively, where p is a prime. Let Znp and Znp2 denote the set of all n-tuples over Zp and Zp2 , respectively. In this paper, the elements of Znp and Znp2 will be called vectors of length n. A code over Zp of length n is a nonempty subset of Znp , and it is linear if it is a subspace of Znp . Similarly, a nonempty subset of Znp2 is a Zp2 -additive if it is a subgroup p × Zp2 . Note that a Zp Zp2 -additive α2 of Znp2 . A Zp Zp2 -additive code is a subgroup of Zα 1 code is a linear code over Zp when α2 = 0, a Zp2 -additive code when α1 = 0, or a Z2 Z4 -additive code when p = 2. The order of a vector u ∈ Zα p × Zp2 , denoted by o(u), 1 α2 is the smallest positive integer m such that mu = (0, . . . , 0 | 0, . . . , 0). The Hamming weight of a vector u ∈ Znp , denoted by wtH (u), is the number of nonzero coordinates of u. The Hamming distance of two vectors u, v ∈ Znp , denoted by dH (u, v), is the number of coordinates in which they differ. Note that dH (u, v) = wtH (u − v). The minimum distance of a code C over Zp is d(C) = min{dH (u, v) : u, v ∈ C, u = v}. In [2], a Gray map from Z4 to Z22 is defined as φ(0) = (0, 0), φ(1) = (0, 1), φ(2) = (1, 1) and φ(3) = (1, 0). There exist different generalizations of this Gray map, which go from s−1 Z2s to Z22 [3–7]. The one given in [6] can be defined in terms of the elements of a Hadamard code [7], and Carlet’s Gray map [3] is a particular case of the one given in   [7] satisfying λi φ(2i ) = φ( λi 2i ) [8]. In this paper, we focus on a generalization of s−1 Carlet’s Gray map from Zps to Zpp , also denoted by φ, which is a particular case of p × Zp2 → Zp , where n = α1 + pα2 , be an extension of α2 the one given in [9]. Let Φ : Zα 1 n the Gray map φ given by Φ((y | y  )) = (y, φ(y1 ), . . . , φ(yα 2 )),    for any y ∈ Zα p and y = (y1 , . . . , yα2 ) ∈ Zp2 . 1 α2 Let C ⊆ Zα p × Zp2 be a Zp Zp2 -additive code. We say that its Gray map image 1 α2 C = Φ(C) is a Zp Zp2 -linear code of length α1 + pα2 . Since C can be seen as a subgroup of Zα 1 +α2 p2 , it is isomorphic to an abelian structure Ztp12 × Ztp2 , and we say that C, or equivalently C = Φ(C), is of type (α1 , α2 ; t1 , t2 ). Note that |C| = p2t1 +t2 . Unlike linear codes over finite fields, linear codes over rings do not have a basis, but there exist generator matrices for these codes having minimum number of rows, that is, t1 + t2 rows. A generalized Hadamard (GH) matrix H(p, λ) = (hij ) of order N = pλ over Zp is a pλ ×pλ matrix with entries from Zp with the property that for every i, j, 1 ≤ i < j ≤ pλ, each of the multisets {his −hjs : 1 ≤ s ≤ pλ} contains every element of Zp exactly λ times [10]. An ordinary Hadamard matrix of order 4μ corresponds to a GH matrix H(2, λ) over D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 3 Z2 , where λ = 2μ [11]. Two GH matrices H1 and H2 of order N are said to be equivalent if one can be obtained from the other by a permutation of the rows and columns and adding the same element of Zp to all the coordinates in a row or in a column. We can always change the first row and column of a GH matrix into zeros and we obtain an equivalent GH matrix which is called normalized. From a normalized GH matrix H, we denote by FH the code consisting of the rows of H, and CH = ∪α∈Zp (FH + α1), where FH + α1 = {h + α1 : h ∈ FH } and 1 denotes the all-one vector. The code CH over Zp is called generalized Hadamard (GH) code [12]. Note that CH is generally a non- linear code over Zp . Moreover, if it is of length N , it has pN codewords and minimum distance N (p − 1)/p. The Zp Zp2 -additive codes such that after applying the Gray map Φ give GH codes are called Zp Zp2 -additive GH codes and the corresponding images are called Zp Zp2 - linear GH codes. The classification of Z2 Z4 -linear Hadamard codes of length 2t with α1 = 0 and α1 = 0 is given in [13,14], showing that there are (t − 1)/2 and t/2 such non-equivalent codes, respectively. Moreover, in [15], it is shown that each Z2 Z4 -linear Hadamard code with α1 = 0 is equivalent to a Z2 Z4 -linear Hadamard code with α1 = 0, so indeed there are only t/2 non-equivalent Z2 Z4 -linear Hadamard codes of length 2t . Later, in [8,16–18], an iterative construction for Zps -linear GH codes is described, the linearity is established, and a partial classification is obtained, giving the exact amount of non-equivalent non-linear such codes for some parameters. This paper is focused on Zp Zp2 -linear GH codes of length pt with α1 = 0 and p ≥ 3 prime, generalizing some results given for p = 2 in [14,19] related to the construction of such codes. For p = 3 and 2 ≤ t ≤ 8, these codes are compared with the Zp Zp2 - linear GH codes of length pt with α1 = 0 studied in [16]. This paper is organized as follows. In Section 2, we recall some properties of the Gray map considered in this paper. In Section 3, we describe a recursive construction of Zp Zp2 -linear GH codes of type (α1 , α2 ; t1 , t2 ) with t1 , t2 ≥ 1, α1 = 0, and p prime. In Section 4, we present many different recursive constructions of Zp Zp2 -linear GH codes having the same type, and show that they give permutation equivalent codes. Finally, in Section 5, we show some computational results for p = 3, which point out that, unlike Z4 -linear and Z2 Z4 -linear Hadamard codes, when p ≥ 3 prime, the Zp2 -linear GH codes are not included in the family of Zp Zp2 -linear GH codes with α1 = 0. Moreover, we observe that, for p = 3, the codes constructed in this paper are not equivalent to the Zps -linear GH codes with s ≥ 2 considered in [16] using the same Gray map. 2. Preliminary results In this section, we give the definition of the Gray map considered in this paper for elements of Zp2 . We also include some of its properties used in the paper. We consider the following Gray map φ, given in [3,20], for s = 2: 4 D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 φ : Zp2 −→ Zpp (1) u → (u0 , u1 )M, where u ∈ Zp2 ; [u0 , u1 ]p is the p-ary expansion of u, that is, u = u0 +u1 p with u0 , u1 ∈ Zp ; and M is the following matrix of size 2 × p:   0 1 2 ··· p−1 . 1 1 1 ··· 1 Let u , v  ∈ Zp2 and [u0 , u1 ]p , [v0 , v1 ]p be the p-ary expansions of u and v  , respectively, i.e. u = u0 + u1 p and v  = v0 + v1 p. We define the operation “ p ” between elements u and v  in Zp2 as u p v  = ξ0 + ξ1 p, where  1 if ui + vi ≥ p, ξi = 0 otherwise. Note that the p-ary expansion of u p v  is [ξ0 , ξ1 ]p , where ξ0 , ξ1 ∈ {0, 1}. For u, v ∈ Zp , we define u p v = 1 if u + v ≥ p and 0 otherwise. We denote in the same way, “ p ”, the component-wise operation. For u = (u | u ), v = (v | v  ) ∈ Zα p × Zp2 , we denote 1 α2     u p v = (u p v | u p v ). Note that p(u p v) = (0 | p(u p v )). From [16], we have the following results: Lemma 2.1. [16] Let u ∈ Zp2 and λ ∈ Zp . Then, φ(u + λp) = φ(u) + (λ, λ, . . . , λ). Corollary 2.1. [16] Let λ, μ ∈ Zp . Then, φ(λμp) = λφ(μp) = λμφ(p). Corollary 2.2. [16] Let u, v ∈ Zp2 . Then, φ(u) + φ(v) = φ(u + v − p(u p v)). Corollary 2.3. [16] Let u, v ∈ Zp2 . Then, φ(pu + v) = φ(pu) + φ(v). Corollary 2.4. [16] For u, v ∈ Zp2 , φ(u + v) = φ(u) + φ(v) + (ξ0 , ξ0 , . . . , ξ0 ), where ξ0 = 1 if u0 + v0 ≥ p and 0 otherwise. Proposition 2.1. [16] Let u, v ∈ Zp2 be two distinct elements. Then, φ(u) − φ(v) = φ(u − v) = (λ, . . . , λ) if u − v = λp ∈ pZp2 , and φ(u) − φ(v) contains every element of Zp exactly once if u − v ∈ Zp2 \ pZp2 . Proposition 2.2. [16] Let u, v ∈ Zp2 . Then, dH (φ(u), φ(v)) = wtH (φ(u − v)). From [21], the homogeneous weight of an element u ∈ Zp2 is defined by ⎧ ⎪ ⎨0 if u = 0, ∗ wt (u) = p if u ∈ pZp2 \ {0}, (2) ⎪ ⎩p−1 otherwise, D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 5 and the homogeneous weight of a vector u = (u1 , . . . , un ) ∈ Znp2 is wt∗ (u) = n ∗ i=1 wt (ui ). The corresponding homogeneous distance of u = (u1 , . . . , un ) and v = (v1 , . . . , vn ) ∈ Znp2 is defined as follows: n d∗ (u, v) = wt∗ (ui − vi ). (3) i=1 The Gray map Φ over Znp2 is an isometry which transforms homogeneous distances defined in Znp2 to Hamming distances defined in Znp p [20]. ∗ Then, we define the homogeneous weight of u = (u | u ) ∈ Zαp × Zp2 as wt (u) = 1 α2 ∗  wtH (u) + wt (u ). From (3), the corresponding homogeneous distance of u = (u | u ) and v = (v | v  ) ∈ Zα p × Zp2 is defined as follows: 1 α2 d∗ (u, v) = wtH (u − v) + wt∗ (u − v  ). (4) p × Zp2 is also an isometry by using α2 Note that the extension of the Gray map Φ over Zα 1 this homogeneous metric, that is, d∗ (u, v) = dH (Φ(u), Φ(v)) for all u, v ∈ Zα p × Zp2 . 1 α2 Moreover, the Zp Zp2 -linear codes obtained from this Gray map Φ are distance invariant by Proposition 2.2. 3. Construction of Zp Zp2 -linear GH codes The description of a generator matrix having minimum number of rows for Z2Z4 - additive GH codes with α1 = 0, as long as an iterative construction of these matrices, is given in [14,19]. In this section, we generalize these results for Zp Zp2 -additive GH codes with α1 = 0 and any p ≥ 3 prime. Specifically, we define an iterative construction for the generator matrices and establish that they generate Zp Zp2 -additive GH codes. The proof that the codes are GH is completely different from the binary case. Let 0, 1, 2, . . . , p2 − 1 be the vectors having the elements 0, 1, 2, . . . , p2 − 1 repeated in each coordinate, respectively. Let   1 1 ··· 1 p p ··· p A1,1 = . (5) p 0 1 ··· p−1 1 2 ··· p−1 Any matrix Atp1 ,t2 with t1 ≥ 1, t2 ≥ 2 or t1 ≥ 2, t2 ≥ 1 can be obtained by applying the following iterative construction. First, if A is a generator matrix of a Zp Zp2 -additive p × Zp2 , then we denote by A1 the submatrix of A with α2 code, that is, a subgroup of Zα 1 the first α1 columns over Zp , and A2 the submatrix with the last α2 columns over Zp2 . We start with A1,1 p . Then, if we have a matrix A = Ap t1 ,t2 , we may construct the matrices   A1 A1 ··· A1 A2 A2 · · · A2 Apt1 ,t2 +1 = (6) 0 1 ··· p−1 p·0 p · 1 ··· p · (p − 1) 6 D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 and   A1 A1 ··· A1 pA1 ··· pA1 A2 A2 ··· A2 Atp1 +1,t2 = . (7) 0 1 ··· p−1 1 ··· p−1 0 1 ··· p −1 2 Example 3.1. Let   1 1 1 3 3 A1,1 3 = 0 1 2 1 2 be the matrix described in (5) for p = 3. By using the constructions described in (6) and (7), we obtain A1,2 2,1 3 and A3 , respectively, as follows:   1 1 1 1 1 1 1 1 1 3 3 3 3 3 3 A1,2 3 = 0 1 2 0 1 2 0 1 2 1 2 1 2 1 2 , 0 0 0 1 1 1 2 2 2 0 0 3 3 6 6   1 1 1 1 1 1 1 1 1 3 3 3 3 3 3 3 3 ··· 3 3 A2,1 3 = 0 1 2 0 1 2 0 1 2 0 3 6 0 3 6 1 2 ··· 1 2 . 0 0 0 1 1 1 2 2 2 1 1 1 2 2 2 0 0 ··· 8 8 In this paper, we consider that the matrices Atp1 ,t2 are constructed recursively starting from A1,1 p in the following way. First, we add t1 − 1 rows of order p , up to obtain Ap ; 2 t1 ,1 and then we add t2 − 1 rows of order p up to achieve Ap . Note that in the first row t1 ,t2 there is always the row (1 | p). The Zp Zp2 -additive code generated by Atp1 ,t2 is denoted by Hpt1 ,t2 , and the correspond- ing Zp Zp2 -linear code Φ(Hpt1 ,t2 ) by Hpt1 ,t2 . We also write At1 ,t2 , Ht1 ,t2 , and H t1 ,t2 instead of Atp1 ,t2 , Hpt1 ,t2 , and Hpt1 ,t2 , respectively, when the value of p is clear by the context. Proposition 3.1. Let t1 , t2 ≥ 1 and p prime. Then, Hpt1 ,t2 is a Zp Zp2 -additive code of type t1 (pt1 +t2 −1 , (p − 1) pt1 +t2 +i−3 ; t1 , t2 ). (8) i=1 Proof. First, we prove this proposition for the code Hpt1 ,1 by induction on t1 ≥ 1. Note that, if t1 = 1, the code is of type (p, p − 1; 1, 1), which coincides with (8) since t1 t1 +t2 +i−3 i=1 p = 1 when t1 = t2 = 1. Assume that the type of Hpt1 ,1 is (α1 , α2 ; t1 , 1), t1 t1 +i−2 where α1 = p and α2 = (p − 1) i=1  t1 p . By using construction (7), Hpt1 +1,1 is of type (α1 , α2 ; t1 + 1, 1), where α1 = p · α1 = p · pt1 = pt1 +1 and α2 = (p − 1)α1 + p2 · α2 =  t1 t1 +i−2 t1 t1 +i t1 +1 (t1 +1)+i−2 (p − 1)pt1 + p2 (p − 1) i=1 p = (p − 1) i=0 p = (p − 1) i=1 p .  t1 Therefore, for t1 ≥ 1, the type of the code Hpt1 ,1 is (pt1 , (p − 1) i=1 pt1 +i−2 ; t1 , 1). Next, from the type of the code Hpt1 ,1 , we prove the proposition for the code Hpt1 ,t2 by induction on t2 ≥ 1. Assume that the type of Hpt1 ,t2 is (α1 , α2 ; t1 , t2 ), where α1 = t1 t1 +t2 +i−3 pt1 +t2 −1 and α2 = (p − 1) i=1 p . By using construction (6), we have that D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 7 Hpt1 ,t2 +1 is of type (α1 , α2 ; t1 , t2 + 1), where α1 = p · α1 = p · pt1 +t2 −1 = pt1 +(t2 +1)−1 and t1 t1 +t2 +i−3 t1 t1 +(t2 +1)+i−3 α2 = p · α2 = p · (p − 1) i=1 p = (p − 1) i=1 p . This completes the proof.  When we include all the elements of Zp (resp. Zp2 ) as coordinates of a vector, we place them in increasing order. We denote by Np the set {0, 1, . . . , p − 1} ⊂ Zp2 and Np− = Np \ {0}. As before, when including all the elements in those sets as coordinates of a vector, we place them in increasing order. For a set S ⊆ Zp2 and λ ∈ Zp2 , we define λS = {λj : j ∈ S}. For example, N3 = {0, 1, 2} ⊂ Z9 , N3− = {1, 2} ⊂ Z9 , 2N3− = {2, 4}, 3Z9 = {0, 3, 6}, (Z3 , Z3 ) = (0, 1, 2, 0, 1, 2) ∈ Z63 and (Z3 | Z9 , 2N3− ) = (0, 1, 2 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 2, 4) ∈ Z33 × Z11 9 . Lemma 3.1. Let λ ∈ Np− and μ ∈ Zp2 . Then, 1. λZp2 + μ = Z p2 , pZp2 if μ ∈ pZp2 , 2. λpZp2 + μ = pZp2 + μ if μ ∈ Zp2 \ pZp2 , . . . , pZp2 ) + μ(1, . . . , p − 1) is a permutation of (Zp2 \ pZp2 ) if μ ∈ Np− . 3. λ(pZp2 , p−1 4. (μNp− , .p. ., μNp− ) + λ(0, . . . , p2 − 1) is a permutation of (Zp2 , p−1 2 . . . , Zp2 ). Proof. Items 1 and 2 follow from the fact that Zp2 is a ring and pZp2 is a proper ideal of Zp2 . For Item 3, first, we have that λpZp2 = pZp2 since λ ∈ Np− . Then, note that all . . . , pZp2 ) + μ(1, . . . , p − 1) are distinct elements of Zp2 \ pZp2 . coordinates of v = (pZp2 , p−1 Since v is a vector of length p2 −p and |Zp2 \pZp2 | = p2 −p, we have that v is a permutation of the vector (Zp2 \ pZp2 ). For Item 4, let μNp− = {a1 , a2 , . . . , ap−1 } ⊂ Zp2 . By Item 1, we have that λZp2 = Zp2 . Then, (μNp− , .p. ., μNp− ) + λ(0, . . . , p2 − 1) is a permutation of 2 (Zp2 , p−1 . . . , Zp2 ) + (a1 , a2 , . . . , ap−1 ), (9) 2 where ai = (ai , .p. ., ai ) for all i ∈ {1, . . . , p − 1}. Again, since Zp2 + ai = Zp2 , (9) is a permutation of (Zp2 , p−1 . . . , Zp2 ).  Lemma 3.2. Let Hpt1 ,1 be the Zp Zp2 -additive code generated by the matrix Apt1 ,1 with t1 ≥ 2 and p prime. Let v1 , v2 , . . . , vt1 be the row vectors of Apt1 ,1 of order p2 . Let t1 v = (v | v  ) ∈ Hpt1 ,1 such that v = i=1 λi vi , where λi ∈ Np and at least one λi = 0.  Then, v contains every element of pZp2 the same number of times and one of the following conditions is satisfied: 1. There exist λ ∈ Np− such that v  contains every element of λNp− the same number of times and every element of Zp2 \ (pZp2 ∪ λNp− ) zero times. 8 D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 2. There exist λ ∈ Np− such that v  contains every element of λNp− the same number of times and every element of Zp2 \ (pZp2 ∪ λNp− ) the same number of times. 3. Every element of Zp2 \ pZp2 appears in v  the same number of times. Proof. We prove this lemma by induction on t1 . Let v1 = (v1 | v1 ) and v2 = (v2 | v2 ) be the row vectors of A2,1 2 p of order p . We have that     v1 Zp Zp ··· Zp pZp2 ··· pZp2 Np− ··· Np− = . (10) v2 0 1 ··· p−1 1 ··· p−1 0 ··· p2 − 1 Let v = (v | v  ) ∈ Hp2,1 such that v = λ1 v1 + λ2 v2 , where λ1 , λ2 ∈ Np and (λ1 , λ2 ) = (0, 0). Thus, v  = λ1 v1 + λ2 v2 . If λ2 = 0, then v  satisfies the first condition since λ1 pZp2 = pZp2 by Lemma 3.1. If λ1 = 0, then v  satisfies the second condition since λ2 Zp2 = Zp2 by Lemma 3.1. If λ1 = 0 and λ2 = 0, then after applying a suitable permutation of coordinates, we can write v  as . . . , pZp2 , 1, . . . , p − 1) + λ2 (1, . . . , p − 1, Zp2 , p−1 λ1 (pZp2 , p−1 . . . , Zp2 ). (11) By Lemma 3.1, we have that λ1 (pZp2 , p−1 . . . , pZp2 ) + λ2 (1, . . . , p − 1) is a permutation of the vector (Zp2 \ pZp2 ) and λ1 (1, . . . , p − 1) + λ2 (Zp2 , p−1 . . . , Zp2 ) is a permutation of the vector (Zp2 , p−1 . . . , Zp2 ). Therefore, v  is a permutation of the vector (Zp2 \ pZp2 , Zp2 , p−1 ..., Zp2 ), so it satisfies the third condition. Hence, the statement is true for t1 = 2. Assume that the lemma holds for the code Hpt1 ,1 with t1 ≥ 2. Now, we have to show that it is also true for Hpt1 +1,1 . Let w1 , . . . , wt1 +1 be the row vectors of Atp1 +1,1 of order p2 such that wt1 +1 = (0, . . . , p − 1 | 1, . . . , p − 1, 0, . . . , p2 − 1). Let w = (w | w ) = t1 +1  i=1 λi wi , where λi ∈ Np and at least one λi = 0. We have to show that w contains every element of pZp2 the same number of times and satisfies one of the three conditions. Let {vi = (vi | vi )}1≤i≤t1 be the set of all row vectors of Apt1 ,1 of order p2 . Let t1 v = (v | v  ) = i=1 λi vi . By construction, note that v = 0 or v contains every element of Zp the same number of times. Indeed, v is a codeword of a simplex code of length t1 −1 pt1 over Zp . Therefore, v = 0 or v = (Zp , p. . . , Zp ) up to a permutation of coordinates. On the one hand, if λi = 0 for all i ∈ {1, . . . , t1 }, then λt1 +1 = 0. In this case, w = λt1 +1 (1, . . . , p − 1, 0, . . . , p2 − 1) and it satisfies the second condition since λt1 +1 Zp2 = Zp2 by Lemma 3.1. t1 −1 On the other hand, if there exists i ∈ {1, . . . , t1 } such that λi = 0, then v = (Zp , p. . . , t1 −1 Zp ). If we consider v over Zp2 , we have that v = (Np , p. . . , Np ). In this case, up to a permutation of coordinates, we can write w as . . . , V, v  , .p. ., v  ) + λt1 +1 (1, . . . , p − 1, 0, . . . , p2 − 1), 2 (V, p−1 (12) t1 −1 where V = pv = (pZp2 , p. . . , pZp2 ) since pNp = pZp2 . If λt1 +1 = 0, then w satisfies the same condition as v  . Finally, we consider the general case, when λt1 +1 = 0. Since v  D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 9 satisfies one of the three conditions, there is a permutation of coordinates π and λ ∈ Np− such that π(v  ) = (pZp2 , .m. ., pZp2 , λNp− , . n. ., λNp− , Iλ , . r. ., Iλ ), where Iλ = (Zp2 \ (pZp2 ∪ λNp− )), for some integers m, n, r ≥ 0. Note that r = 0 if v  satisfies the first condition, and n = r if v  satisfies the third condition. Thus, we can write (12) as . . . , V, π(v  ), .p. ., π(v  )) + λt1 +1 (1, . . . , p − 1, 0, . . . , p2 − 1). 2 (V, p−1 (13) First, by Lemma 3.1, we have that (pZp2 , p−1 . . . , pZp2 ) + λt1 +1 (1, . . . , p − 1) is a per- mutation of (Zp2 \ pZp2 ), so (V, . . . , V ) + λt1 +1 (1, . . . , p − 1) is a permutation of p−1 t1 −1 2 (Zp2 \ pZp2 , p. . . , Zp2 \ pZp2 ). Next, by Lemma 3.1, we have that (pZp2 , .p. ., pZp2 ) + λt1 +1 (0, . . . , p2 − 1) is a permutation of (pZp2 , . p. ., pZp2 , Zp2 \ pZp2 , . p. ., Zp2 \ pZp2 ), (14) and (λNp− , .p. ., λNp− ) + λt1 +1 (0, . . . , p2 − 1) is a permutation of (Zp2 , p−1 2 . . . , Zp2 ). Again by Lemma 3.1, (Iλ , .p. ., Iλ ) + λt1 +1 (0, . . . , p2 − 1) is a permutation of (Zp2 , p −2p+1 2 2 . . . , Zp2 ) since |Iλ | = p − 2p + 1. Therefore, (13) is a permutation of 2 (Zp2 \ pZp2 , .k.1., Zp2 \ pZp2 , pZp2 , .k.2., pZp2 , Zp2 , .k.3., Zp2 ) for k1 = pt1 − 1 + mp, k2 = mp, and k3 = n(p − 1) + r(p2 − 2p + 1), so it satisfies the third condition. Note that the elements in pZp2 appear k2 + k3 times and the elements in Zp2 \ pZp2 appear k1 + k3 times.  Example 3.2. Let v1 = (v1 | v1 ) and v2 = (v2 | v2 ) be the row vectors of A2,1 3 of order 9. We have that     v1 Z3 Z3 Z3 3Z9 3Z9 N3− · · · N3− = . v2 0 1 2 1 2 0 ... 8 Let v = (v | v  ) ∈ H32,1 such that v = λ1 v1 + λ2 v2 , where λ1 , λ2 ∈ N3 = {0, 1, 2} and (λ1 , λ2 ) = (0, 0). Thus, v  = λ1 v1 + λ2 v2 . Now, v ∈ {λ1 v1 + λ2 v2 } λ1 ,λ2 ∈N3 (λ1 ,λ2 )=(0,0) = {v1 , 2v1 , v2 , 2v2 , v1 + v2 , 2v1 + v2 , v1 + 2v2 , 2v1 + 2v2 } = {(0, 3, 6, 0, 3, 6, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2), 10 D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 (0, 6, 3, 0, 6, 3, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4), (1, 1, 1, 2, 2, 2, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8), (2, 2, 2, 4, 4, 4, 0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 1, 1, 3, 3, 5, 5, 7, 7), (1, 4, 7, 2, 5, 8, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 0, 0, 1), (1, 7, 4, 2, 8, 5, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8, 7, 0, 8, 1, 0, 2, 1, 3), (2, 5, 8, 4, 7, 1, 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0), (2, 8, 5, 4, 1, 7, 2, 4, 4, 6, 6, 8, 8, 1, 1, 3, 3, 5, 5, 7, 7, 0, 0, 2)}. Note that v1 and 2v1 satisfy the first condition of Lemma 3.2, v2 and 2v2 satisfy the second condition, and the remaining vectors the third condition. Therefore, v  satisfies Lemma 3.2. Corollary 3.1. Let Hpt1 ,t2 be the Zp Zp2 -additive code generated by the matrix Atp1 ,t2 with t1 ≥ 2, t2 ≥ 1, and p prime. Let u = (u | u ) ∈ Hpt1 ,t2 such that o(u) = p2 . Then, u contains every element of pZp2 the same number of times and the remaining coordinates are from Zp2 \ pZp2 . Proof. Let {vi }1≤i≤t1 be the set of row vectors of Atp1 ,t2 of order p2 . Since o(u) = p2 , t1 u can be expressed as u = i=1 λi vi + w, where λi ∈ Np , at least one λi = 0, and w is a codeword of order at most p. If w = 0, then from Lemma 3.2 and construction (6), u holds the property. If w = 0, then from Lemma 3.2, construction (6), and Item 2 of Lemma 3.1, u also holds the property.  Lemma 3.3. Let Hpt1 ,1 be the Zp Zp2 -additive code of type (α1 , α2 ; t1 , 1) generated by the matrix Apt1 ,1 with t1 ≥ 2 and p prime. Let v1 , v2 , . . . , vt1 be the row vectors of Apt1 ,1 of t1 order p2 . Let v = (v | v  ) ∈ Hpt1 ,1 such that v = i=1 λi pvi , where λi ∈ Np and at least one λi = 0. Then, v = (0, .α.1., 0), and v  contains every element of pZp2 \ {0} exactly α1 /p + (pα2 − (p − 1)α1 )/p2 times and (pα2 − (p − 1)α1 )/p2 times the element 0. Proof. We prove this lemma by induction on t1 . Let v1 = (v1 | v1 ) and v2 = (v2 | v2 ) be the row vectors of A2,1 2 2,1 p of order p . Recall that Ap is the matrix given in (10). Let v = (v | v  ) ∈ Hp2,1 such that v = λ1 pv1 +λ2 pv2 , where λ1 , λ2 ∈ Np and (λ1 , λ2 ) = (0, 0). Thus, v = (0, .p. ., 0), and v  = λ1 pv1 + λ2 pv2 . If λ2 = 0, then the first p(p − 1) coordinates 2 of v  are 0 and the remaining p2 (p − 1) coordinates contain every element of pZp2 \ {0} exactly p2 times. If λ1 = 0, then the first p(p − 1) coordinates of v  contain every element of pZp2 \ {0} exactly p times and the remaining p2 (p − 1) coordinates contain every element of pZp2 exactly p(p − 1) times. Therefore, every element a ∈ pZp2 \ {0} appears p + p(p − 1) = p2 times in v  , and the element 0 appears p(p − 1) times. If λ1 = 0 and λ2 = 0, then after applying a suitable permutation of coordinates of v , we can write v  as D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 11 λ1 (0, V, . p. ., V ) + λ2 (V, W, . p. ., W ), where 0 is the all-zero vector of length (p − 1)p, V = p(1, . . . , p − 1) of length (p − 1)p, and W = (pZp2 , p−1 . . . , pZp2 ). Therefore, by Lemma 3.1, we have that every a ∈ pZp2 \ {0} appears p + (p − 1)p = p2 times in v  , and the element 0 appears (p − 1)p times. Since α1 = p2 and α2 = (p − 1)(p + p2 ) by Proposition 3.1, the statement is true for t1 = 2. Assume that the lemma holds for the code Hpt1 ,1 of type (α1 , α2 ; t1 , 1) with t1 ≥ 2. Now, we have to show that it is also true for Hpt1 +1,1 . Note that the type of Hpt1 +1,1 is (α1 , α2 ; t1 + 1, 1), where α1 = pα1 and α2 = (p − 1)α1 + p2 α2 . Let w1 , . . . , wt1 +1 be the t1 +1 row vectors of Atp1 +1,1 of order p2 . Let w = (w | w ) = i=1 λi pwi , where λi ∈ Np and  at least one λi = 0. Let {vi = (vi | vi )}1≤i≤t1 be the set of all row vectors of Apt1 ,1 of t1 order p2 . Let v = (v | v  ) = i=1 λi vi . We have that w = (0, p−1 . . . , 0, pv  , .p. ., pv  ) + λt1 +1 p(1, . . . , p − 1, 0, . . . , p2 − 1). 2 If λt1 +1 = 0, there is at least one i ∈ {1, . . . , t1 } such that λi = 0, so v  = 0. By induction hypothesis, every a ∈ pZp2 \ {0} appears α1 pα2 − (p − 1)α1 α1 pα2 − (p − 1)α1 p2 ( + ) = α1 + pα2 = + p p2 p p2 times in w , and the element 0 appears pα2 − (p − 1)α1 pα2 − (p − 1)α1 α1 (p − 1) + p2 ( ) = pα2 = p2 p2 times. Now, assume that λt1 +1 = 0. Note that p(0, 1, . . . , p2 − 1) = (pZp2 , . p. ., pZp2 ). Then, by Lemma 3.1, we have that (pv  , .p. ., pv  ) + λt1 +1 p(0, . . . , p2 − 1) contains every 2 element of pZp2 exactly p2 α2 /p = pα2 times. Therefore, since every a ∈ pZp2 \ {0} appears α1 +pα2 times in w , and the element 0 appears pα2 times, the result follows.  Example 3.3. Let v1 = (v1 | v1 ) and v2 = (v2 | v2 ) be the row vectors of A2,1 3 of order 9,  2,1 which are shown in Example 3.2. Let v = (v | v ) ∈ H3 such that v = λ1 3v1 + λ2 3v2 , where λ1 , λ2 ∈ N3 = {0, 1, 2} and (λ1 , λ2 ) = (0, 0). Thus, v  = λ1 3v1 + λ2 3v2 . Now, v ∈ {λ1 3v1 + λ2 3v2 } λ1 ,λ2 ∈N3 (λ1 ,λ2 )=(0,0) = {3v1 , 6v1 , 3v2 , 6v2 , 3v1 + 3v2 , 6v1 + 3v2 , 3v1 + 6v2 , 6v1 + 6v2 } = {(0, 0, 0, 0, 0, 0, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6), (0, 0, 0, 0, 0, 0, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3), (3, 3, 3, 6, 6, 6, 0, 0, 3, 3, 6, 6, 0, 0, 3, 3, 6, 6, 0, 0, 3, 3, 6, 6), 12 D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 (6, 6, 6, 3, 3, 3, 0, 0, 6, 6, 3, 3, 0, 0, 6, 6, 3, 3, 0, 0, 6, 6, 3, 3), (3, 3, 3, 6, 6, 6, 3, 6, 6, 0, 0, 3, 3, 6, 6, 0, 0, 3, 3, 6, 6, 0, 0, 3), (3, 3, 3, 6, 6, 6, 6, 3, 0, 6, 3, 0, 6, 3, 0, 6, 3, 0, 6, 3, 0, 6, 3, 0), (6, 6, 6, 3, 3, 3, 3, 6, 0, 3, 6, 0, 3, 6, 0, 3, 6, 0, 3, 6, 0, 3, 6, 0), (6, 6, 6, 3, 3, 3, 6, 3, 3, 0, 0, 6, 6, 3, 3, 0, 0, 6, 6, 3, 3, 0, 0, 6)}. Note that, in any case, every element a ∈ 3Z9 \ {0} = {3, 6} appears 9 times in v  , and the element 0 appears 6 times. Theorem 3.1. The Zp Zp2 -additive code Hp1,1 generated by the matrix   1 1 ··· 1 p p ··· p A1,1 = p 0 1 ··· p−1 1 2 ··· p−1 is a Zp Zp2 -additive GH code of type (p, p − 1; 1, 1). Proof. Note that Hp1,1 can be partitioned into p disjoint sets A0 , A1 , . . . , Ap−1 , where A0 = {λ(0, 1, . . . , p − 1 | 1, 2, . . . , p − 1) : λ ∈ Zp2 } and Ai = A0 + i(1 | p), i ∈ {1, . . . , p − 1}. Therefore, we can also partition Φ(Hp1,1 ) into p disjoint sets Φ(A0 ), Φ(A1 ), . . . , Φ(Ap−1 ), where Φ(Ai ) = Φ(A0 ) +i ·1, i ∈ {1, . . . , p −1}, by Lemma 2.1. Thus, it is enough to show that Φ(A0 ) is a GH matrix H(p, p). We take two distinct elements u, v ∈ A0 . We have to show that Φ(u) − Φ(v) contains every element of Zp exactly p times. Let u = λ1 (0, 1, . . . , p − 1 | 1, 2, . . . , p − 1) and v = λ2 (0, 1, . . . , p − 1 | 1, 2, . . . , p − 1), where λ1 = λ2 ∈ Zp2 . Then, u − v = (λ1 − λ2 )(0, 1, . . . , p − 1 | 1, 2, . . . , p − 1) = (x0 , . . . , xp−1 | y1 , . . . , yp−1 ). Now. we consider two cases. On the one hand, if λ1 − λ2 ∈ pZp2 \{0}, then the first p coordinates of u − v are 0, and the last p−1 coordinates contain exactly all the elements of order p from Zp2 , that is, the elements μp for μ ∈ {1, . . . , p −1}. Since φ(μp) = (μ, μ, . . . , μ), Φ(u − v) contains every element of Zp exactly p times. Therefore, Φ(u) − Φ(v) contains every element of Zp exactly p times, by Proposition 2.1. On the other hand, if λ1 − λ2 ∈ Zp2 \ pZp2 , then yi ∈ Zp2 \ pZp2 , i ∈ {1, . . . , p − 1}. In the first p coordinates, Φ(u) − Φ(v) coincides with (λ1 − λ2 )(0, 1, . . . , p − 1), so in these coordinates, it contains every element of Zp once. Since yi ∈ Zp2 \ pZp2 , Φ(u) − Φ(v) contains every element of Zp exactly 1 + 1 · (p − 1) = p times, by Proposition 2.1. Therefore, in any case, Φ(A0 ) is a GH matrix H(p, p).  Example 3.4. The Z3 Z9 -additive code H31,1 generated by the matrix A1,1 3 , given in Example 3.1, is a Z3 Z9 -additive GH code of type (3, 2; 1, 1). Indeed, we have that H31,1 = Φ(H31,1 ) = ∪λ∈Z3 (Φ(A0 ) + λ1), where A0 = {λ(0, 1, 2 | 1, 2) : λ ∈ Z9 }, and then Φ(A0 ) consists of all the rows of the GH matrix D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 13 ⎛ ⎞ 0 0 0 0 0 0 0 0 0 ⎜0 1⎟ ⎜ 1 2 0 1 2 0 2 ⎟ ⎜ ⎟ ⎜0 2 1 0 2 1 1 2 0⎟ ⎜ ⎟ ⎜0 0 0 1 1 1 2 2 2⎟ ⎜ ⎟ H(3, 3) = ⎜ ⎜0 1 2 1 2 0 2 1 0⎟⎟. (15) ⎜0 2⎟ ⎜ 2 1 1 0 2 0 1 ⎟ ⎜ ⎟ ⎜0 0 0 2 2 2 1 1 1⎟ ⎜ ⎟ ⎝0 1 2 2 0 1 1 0 2⎠ 0 2 1 2 1 0 2 0 1 The Z3 Z9 -linear code H31,1 has length N = 9, pN = 3 · 9 = 27 codewords and minimum distance N (p − 1)/p = 9(3 − 1)/3 = 6. Proposition 3.2. The Zp Zp2 -additive code Hpt1 ,1 generated by the matrix Apt1 ,1 , with t1 ≥ 2 and p prime, is a Zp Zp2 -additive GH code. Proof. Let Hpt1 ,1 be the Zp Zp2 -additive code of type (α1 , α2 ; t1 , 1) generated by Apt1 ,1 . We can write that Hpt1 ,1 = ∪λ∈Zp (A0 + λ · (1 | p)), where A0 is the set of all codewords of the code generated by Apt1 ,1 after removing the row (1 | p). Let Hpt1 ,1 = Φ(Hpt1 ,1 ). By Lemma 2.1, Hpt1 ,1 = ∪λ∈Zp (Φ(A0 ) + λ · 1). If we prove that Φ(A0 ) corresponds to the rows of a GH matrix H(p, α2 + α1 /p), then the result follows. We take two distinct elements u, v ∈ A0 . Now, we have to show that Φ(u) − Φ(v) contains every element of Zp exactly α2 + α1 /p times. We consider two cases depending on the order of u − v. First, let o(u − v) = p. Then, by Lemma 3.3, the number of 0 in Φ(u − v) is pα2 − (p − 1)α1 α1 α1 + p · = α2 + , p2 p and the number of times an element a ∈ Zp \ {0} appears in Φ(u − v) is α1 pα2 − (p − 1)α1 α1 p·( + ) = α2 + . p p2 p Thus, in this case, Φ(u−v) = Φ(u) −Φ(v) contains every element of Zp exactly α2 +α1 /p times, by Proposition 2.1. Second, let o(u − v) = p2 . Let u − v = (z | z  ). We have that z contains every element of Zp exactly α1 /p times. Moreover, by Corollary 3.1, z  contains every element of pZp2 exactly α times, α > 0, and the remaining α2 − pα coordinates of z  are from Zp2 \ pZp2 . Therefore, by Proposition 2.1, Φ(u) − Φ(v) contains every element of Zp exactly α1 /p + pα + (α2 − pα) · 1 = α2 + α1 /p times.  14 D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 Proposition 3.3. Let Hpt1 ,t2 be a Zp Zp2 -additive GH code of type (α1 , α2 ; t1 , t2 ) with t1 , t2 ≥ 1 and p prime. Then, with the above construction (6), Hpt1 ,t2 +1 is a Zp Zp2 - additive GH code of type (pα1 , pα2 ; t1 , t2 + 1). Proof. We can write that Hpt1 ,t2 = ∪λ∈Zp (A0 + λ · (1 | p)), where A0 is the set of all codewords of the code generated by At1 ,t2 after removing the row (1 | p). Let Hpt1 ,t2 = Φ(Hpt1 ,t2 ). By Lemma 2.1, Hpt1 ,t2 = ∪λ∈Zp (Φ(A0 ) + λ · 1). Since Hpt1 ,t2 is a Zp Zp2 - additive GH code of type (α1 , α2 ; t1 , t2 ), then Φ(A0 ) corresponds to the rows of a GH matrix H(p, α2 + α1 /p). Let Hpt1 ,t2 +1 = Φ(Hpt1 ,t2 +1 ). By applying a suitable permutation on the coordinates of the elements of Hpt1 ,t2 +1 , we can get an equivalent code H∗t1 ,t2 +1 of length pα1 + p2 α2 such that H∗t1 ,t2 +1 = ∪μ∈Zp (Φ(B0 ) +μ ·1), where Φ(B0 ) = {(Φ(A0 ), Φ(A0 ), . . . , Φ(A0 )) + λ · (0, 1, . . . , p − 1) : λ ∈ Zp }. Since Φ(A0 ) corresponds to the rows of a GH matrix H(p, α2 + α1 /p), then Φ(B0 ) corresponds to the rows of a GH matrix H(p, α1 + pα2 ). Therefore, Hpt1 ,t2 +1 is a Zp Zp2 -additive GH code of type (pα1 , pα2 ; t1 , t2 + 1).  Theorem 3.2. The Zp Zp2 -additive code Hpt1 ,t2 generated by the matrix Atp1 ,t2 , with t1 , t2 ≥ 1 and p prime, is a Zp Zp2 -additive GH code. Proof. It follows from Theorem 3.1, and Propositions 3.2 and 3.3.  Example 3.5. Let H31,2 be the Z3 Z9 -additive code generated by the matrix A1,2 3 given in Example 3.1. By Theorem 3.2, H31,2 = Φ(H31,2 ) is a Z3 Z9 -linear GH code of type (9, 6; 1, 2). Actually, we can write H31,2 = ∪λ∈Z3 (FH + λ1), where FH consists of all the rows of a GH matrix H(3, 9). Also, note that H31,2 has length N = 27, pN = 3 · 27 = 81 codewords and minimum distance N (p − 1)/p = 27(3 − 1)/3 = 18. Example 3.6. Let H32,1 be the Z3 Z9 -additive code generated by the matrix A2,1 3 given in Example 3.1. By Theorem 3.2, H32,1 = Φ(H32,1 ) is a Z3 Z9 -linear GH code of type (9, 24; 2, 1), which has length N = 81, pN = 3 · 81 = 243 codewords and minimum distance N (p − 1)/p = 81(3 − 1)/3 = 54. Proposition 3.4. Let Hpt1 ,t2 be a Zp Zp2 -additive GH code of type (α1 , α2 ; t1 , t2 ) with t1 , t2 ≥ 1 and p prime. Let Hpt1 ,t2 be the corresponding Zp Zp2 -linear GH code of length pt , with t ≥ 2. Then, α1 = pt−t1 , α2 = pt−1 − pt−t1 −1 and t = 2t1 + t2 − 1. Proof. Since Hpt1 ,t2 is a Zp Zp2 -linear GH code of length α1 + pα2 = pt , then |Hpt1 ,t2 | = p · pt = pt+1 . Note that |Hpt1 ,t2 | = |Hpt1 ,t2 | = p2t1 +t2 , and hence t = 2t1 + t2 − 1. By Proposition 3.1, α1 = pt1 +t2 −1 = pt−t1 . Then, since α1 + pα2 = pt , α2 = pt−1 − pt−t1 −1 .  D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 15 Remark 3.1. Let H = Hpt1 ,t2 be a Zp Zp2 -additive GH code of type (α1 , α2 ; t1 , t2 ) with t1 , t2 ≥ 1 and p prime. Let H = Φ(Hpt1 ,t2 ) be the corresponding Zp Zp2 -linear GH code of length α1 + pα2 . Then, since H is a GH code, its minimum distance is (p − 1)(α1 + pα2 ) . p Let H1 be the punctured code of H by deleting the last α2 coordinates over Zp2 . Note that, by construction, H1 is a GH code over Zp of length α1 and minimum distance (p − 1)α1 /p. Remark 3.2. Since the length of the Zp Zp2 -linear GH code Φ(Hp1,1 ) is p2 , its minimum distance is (p − 1)p2 /p = p(p − 1) by Remark 3.1. Remark 3.3. The above constructions (6) and (7) give always Zp Zp2 -linear GH codes with α2 = 0 since the starting matrix A1,1 p has α2 = 0. If α2 = 0, the Zp Zp2 -linear GH codes coincide with the codes obtained from a Sylvester GH matrix, so they are always linear and of type (pt2 −1 , 0; 0, t2 ) [12]. Therefore, we only focus on the ones with α2 = 0 to study whether they are linear or not. 4. Same type equivalent Zp Zp2 -linear GH codes In this section, we see that if we consider other starting matrices, instead of the matrix A1,1 p given in (5), and apply the same recursive constructions (6) and (7), or (6) and a new construction more general than (7), we also obtain Zp Zp2 -additive GH codes with α1 = 0. Indeed, the corresponding Zp Zp2 -linear GH codes, after applying the Gray map Φ, are permutation equivalent to the codes Φ(Hpt1 ,t2 ) of the same type constructed in Section 3. Let Sn be the symmetric group of permutations on the set {1, . . . , n}. A permutation π ∈ Sn acts linearly on vectors (c1 , . . . , cn ) ∈ Znp by permuting their coordinates as follows: π(c1 , . . . , cn ) = (cπ−1 (1) , . . . , cπ−1 (n) ). Given two permutations π1 ∈ Sn and π2 ∈ Sm , we define (π1 |π2 ) ∈ Sn+m , where π1 acts on the coordinates {1, . . . , n} and π2 on {n + 1, . . . , n + m}. Two codes C1 and C2 over Zp of length n are said to be monomially equivalent (or just equivalent) provided there is a monomial matrix M such that C2 = {cM : c ∈ C1 }. Recall that a monomial matrix is a square matrix with exactly one nonzero entry in each row and column. They are said to be permutation equivalent if there is a permutation matrix P such that C2 = {cP : c ∈ C1 }. Recall that a permutation matrix is a square matrix with exactly one 1 in each row and column and 0s elsewhere. A permutation matrix represents a permutation of coordinates, so we can also say that they are permutation equivalent if there is a permutation of coordinates π ∈ Sn such that C2 = {π(c) : c ∈ C1 }. 16 D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 Remark 4.1. Let τ = (τ1 | τ2 ) ∈ Sα1 +α2 . Then, there is a permutation τ  = (τ1 | τ2 ) ∈ Sα1 +pα2 such that, for all u ∈ Zα p × Zp2 , 1 α2 Φ(τ (u)) = τ  (Φ(u)). Example 4.1. Let p = 3 and α1 = α2 = 2. Let τ = (1, 2)(3, 4) ∈ S4 . Then, τ  = (1, 2)(3, 6)(4, 7)(5, 8) ∈ S8 . For u = (u1 , u2 | u1 , u2 ) ∈ Z23 × Z29 , τ (u) = (u2 , u1 | u2 , u1 ) and we have Φ(τ (u)) = (u2 , u1 , u2,1 , u2,2 , u2,3 , u1,1 , u1,2 , u1,3 ), where φ(ui ) = (ui,1 , ui,2 , ui,3 ) for i ∈ {1, 2}. It is easy to see that Φ(τ (u)) = τ  (Φ(u)). Remark 4.2. Let ai = i + μi p ∈ Zp2 , where i ∈ Np− and μi ∈ Np . Since φ(ai ) and φ(i) contain every element of Zp exactly once by the definition of φ, there is a permutation πi ∈ Sp such that πi (φ(ai )) = φ(i) for all i ∈ {1, 2, . . . , p − 1}. Moreover, from this permutation πi , we can define a permutation σi ∈ Sp2 on the set of the elements of Zp2 such that σi (c) = b if and only if πi−1 (φ(c)) = φ(b). Then, πi (φ(b)) = φ(c) and πi (φ(σi (c))) = φ(c), or equivalently, (πi | · · · | πi )(Φ(σi (w))) = Φ(w), (16) where w = (0, 1, . . . , p2 − 1). Example 4.2. Let p = 3. Recall that the Gray map from Z9 to Z33 is defined as φ(0) = (0, 0, 0), φ(1) = (0, 1, 2), φ(2) = (0, 2, 1), φ(3) = (1, 1, 1), φ(4) = (1, 2, 0), φ(5) = (1, 0, 2), φ(6) = (2, 2, 2), φ(7) = (2, 0, 1), φ(8) = (2, 1, 0). For a1 = 4 ∈ Z9 , since φ(4) = (1, 2, 0) and φ(1) = (0, 1, 2), π1 = (1, 2, 3) ∈ S3 . For a2 = 5 ∈ Z9 , since φ(5) = (1, 0, 2) and φ(2) = (0, 2, 1), π2 = (1, 3, 2) ∈ S3 . The permutation σ1 ∈ S9 satisfies (16), that is, Φ(σ1 (0, 1, 2, 3, 4, 5, 6, 7, 8)) = (π1−1 | · · · | π1−1 )(Φ(0, 1, 2, 3, 4, 5, 6, 7, 8)) = (0, 0, 0, 1, 2, 0, 2, 1, 0, 1, 1, 1, 2, 0, 1, 0, 2, 1, 2, 2, 2, 0, 1, 2, 1, 0, 2) = Φ(0, 4, 8, 3, 7, 2, 6, 1, 5). Therefore, σ1 (0, 1, 2, 3, 4, 5, 6, 7, 8) = (0, 4, 8, 3, 7, 2, 6, 1, 5), that is, σ1 = (2, 8, 5) (3, 6, 9) ∈ S9 . Similarly, σ2 (0, 1, 2, 3, 4, 5, 6, 7, 8) = (0, 7, 5, 3, 1, 8, 6, 4, 2) and σ2 = (2, 5, 8)(3, 9, 6) ∈ S9 . Then, for i ∈ {1, 2}, we have that (πi | · · · | πi )(Φ(σi (0, 1, 2, 3, 4, 5, 6, 7, 8))) = Φ(0, 1, 2, 3, 4, 5, 6, 7, 8). Lemma 4.1. Let a, a , b ∈ Zp2 , such that a ≡ a mod p. Then, p(a p b) = p(a p b). D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 17 Proof. Let [a0 , a1 ]p , [a0 , a1 ]p , and [b0 , b1 ]p be the p-ary expansions of a, a , and b, respec- tively. By definition, we have that a p b = ξ0 + ξ1 p and a p b = ξ0 + ξ1 p, where   1 if ai + bi ≥ p, 1 if ai + bi ≥ p, ξi = and ξi = 0 otherwise 0 otherwise. Since a ≡ a mod p, we have that a0 = a0 and hence ξ0 = ξ0 . Therefore, p(a p b) = ξ0 p = ξ0 p = p(a p b).  Corollary 4.1. Let a, b, ā, b̄ ∈ Zp2 , such that ā ≡ a mod p and b̄ ≡ b mod p. Then, p(a p b) = p(ā p b̄). Lemma 4.2. Let ai = i + μi p ∈ Zp2 , where i ∈ Np− and μi ∈ Np . Let πi ∈ Sp such that πi (φ(ai )) = φ(i). Let b, c ∈ Zp2 satisfying πi (φ(b)) = φ(c). Then, b ≡ c mod p and πi (φ(λb)) = φ(λc) for all λ ∈ Np . Proof. First, we show that b ≡ c mod p. Let y = (0, 1, . . . , p − 1) ∈ Zpp . By the definition of φ, φ(ai ) = iy + μi · 1. Thus, πi (φ(ai )) = i(πi (y)) + μi · 1. Since πi (φ(ai )) = φ(i), we have that i(πi (y)) + μi · 1 = φ(i). (17) Let b = j + μj p and c = k + μk p, where j, k, μj , μk ∈ Np . By the definition of φ, φ(b) = jy + μj · 1 and φ(c) = ky + μk · 1. Thus, πi (φ(b)) = jπi (y) + μj · 1. Since πi (φ(b)) = φ(c), we have that jπi (y) + μj · 1 = ky + μk · 1. Then, ijπi (y) + iμj · 1 = iky + iμk · 1. By (17), we have that ji(πi (y)) + jμi · 1 = jφ(i) and then jφ(i) − jμi · 1 + iμj · 1 = iky + iμk · 1. (18) By the definition of φ, φ(i) = iy. Thus, from (18), we have that (j − k)iy + (iμj − jμi − iμk ) · 1 = 0, and therefore, j = k, that is, b ≡ c mod p. Now, we prove that πi (φ(λb)) = φ(λc) for all λ ∈ Np , by induction on λ. For λ = 0, it is true trivially, and for λ = 1, it is true by the condition given in the statement. Assume that the lemma is true for λ ∈ Np− . By Corollaries 2.1, 2.2, and 2.3, φ((λ + 1)b) = φ(λb) + φ(b) + φ(p(λb p b)). Then, πi (φ((λ + 1)b)) = πi (φ(λb)) + πi (φ(b)) + πi (φ(p(λb p b))) = φ(λc) + φ(c) + πi (φ(p(λb p b))), (19) by induction hypothesis. By the definition of φ, πi (φ(p(λb p b))) = φ(p(λb p b)). Since b ≡ c mod p, we have that p(λb p b) = p(λc p c) by Corollary 4.1. Therefore, from (19), πi (φ((λ + 1)b)) = φ(λc) + φ(c) + φ(p(λc p c))) = φ((λ + 1)c). This completes the proof.  18 D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 Corollary 4.2. Let ai = i + μi p ∈ Zp2 , where i ∈ Np− and μi ∈ Np . Let πi ∈ Sp such that πi (φ(ai )) = φ(i). Then, πi (φ(λai )) = φ(λi) for all λ ∈ Np . Proposition 4.1. Let a = (a1 , . . . , ap−1 ) ∈ Zp−1 p2 such that {pa1 , . . . , pap−1 } = pZp2 \ {0}. Consider the matrix   1 1 ··· 1 p p ··· p A1,1 = . p,a 0 1 ··· p−1 a1 a2 ··· ap−1 The code generated by A1,1 p,a , denoted by Hp,a , is a Zp Zp2 -additive GH code of type 1,1 (p, p − 1; 1, 1). Moreover, the corresponding Zp Zp2 -linear code is permutation equivalent to Φ(Hp1,1 ). Proof. First, note that there is a permutation σ̄ ∈ Sp−1 such that σ̄(a1 , . . . , ap−1 ) = (a1 , . . . , ap−1 ), where (pa1 , . . . , pap−1 ) = (p, 2p, . . . , (p − 1)p). Thus, there is a permu- 1,1    tation σ = (Id | σ̄) ∈ S2p−1 such that σ(Hp,a 1,1 ) = Hp,a  , where a = (a1 , . . . , ap−1 ). By Remark 4.1, σ induces a permutation in the corresponding Zp Zp2 -linear code. There- fore, we can assume that the coordinates of a = (a1 , . . . , a2 ) are in such an order that (pa1 , . . . , pap−1 ) = (p, 2p, . . . , (p − 1)p), that is, ai = i + μi p, where i ∈ Np− and μi ∈ Np . For any i ∈ Np− , by Remark 4.2, there is a permutation πi ∈ Sp such that πi (φ(ai )) = φ(i). Let π1,1 = (Id | π1 | π2 | · · · | πp−1 ) ∈ Sp2 , where Id ∈ Sp is the identity 1,1 permutation. Next, we show that π1,1 (Φ(Hp,a )) = Φ(Hp1,1 ). Consider the matrices         v1 1 p u1 1 p A1,1 = = and A1,1 = = . p,a v2 Zp a p u2 Zp Np− Note that v1 = u1 and pv2 = pu2 . If x ∈ Hp,a 1,1 , then x can be expressed as x = αv1 +βv2 , where α ∈ Np ⊂ Zp2 and β ∈ Zp2 . By Corollary 2.3, we have that Φ(x) = Φ(αv1 ) + Φ(βv2 ) and also Φ(βv2 ) = Φ(λv2 ) + Φ(μpv2 ), where β = λ + μp and λ, μ ∈ Np . By Corollary 2.1, Φ(μpv2 ) = μΦ(pv2 ) and Φ(αv1 ) = αΦ(v1 ). Therefore, Φ(x) = Φ(λv2 ) + μΦ(pv2 ) + αΦ(v1 ). Note that π1,1 (Φ(pv2 )) = Φ(pv2 ) and π1,1 (Φ(v1 )) = Φ(v1 ). Thus, in 1,1 order to show that π1,1 (Φ(Hp,a )) = Φ(Hp1,1 ), we only need to check that π1,1 (Φ(λv2 )) = Φ(λu2 ). Since π1,1 is the identity in the first p coordinates, we just need to prove that πi (φ(λai )) = φ(λi) for all i ∈ Np− and λ ∈ Np , which is true by Corollary 4.2.  Example 4.3. Let p = 3. Let S = {(a1 , a2 ) : (3a1 , 3a2 ) = (3, 6) = 3Z9 \ {0}}. Note that S = {(1, 2), (1, 5), (1, 8), (4, 2), (4, 5), (4, 8), (7, 2), (7, 5), (7, 8)} and it can also be written as {(1 + 3x, 2 + 3y) ∈ Z29 : x, y ∈ N3 }. Therefore, in this case, we can consider 9 different starting matrices   1 1 1 3 3 A1,1 3,a = , 0 1 2 a1 a2 D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 19 where a = (a1 , a2 ) ∈ S. By Proposition 4.1, these matrices generate 9 different Z3 Z9 - 1,1 1,1 additive codes H3,a of type (3, 2; 1, 1) whose corresponding Z3 Z9 -linear codes, Φ(H3,a ), are permutation equivalent to each other. Note that if a = (1, 2), we obtain the matrix A1,1 3 given in Example 3.1. Moreover, it is clear that if we permute the coordinates of a, we also obtain Z3 Z9 -linear codes which are permutation equivalent to the previous ones. Example 4.4. Let p = 2. Consider a = (a1 ) ∈ Z4 . We have that the possible values for a1 such that {2a1 } = {2} are 1 and 3. If a1 = 1, then the matrix A1,1 1,1 2,a = A2 . In the 1,1 1,1 case that a1 = 3, then A2,a is the matrix A2 after multiplying by 3 the last row, so 1,1 H2,a = H21,1 . Theorem 4.1. Let a = (a1 , . . . , ap−1 ) ∈ Zp−1 p2 such that {pa1 , . . . , pap−1 } = pZp2 \ {0}. Let Atp,a 1 ,t2 be the matrix obtained by using constructions (6) and (7), starting with the following matrix   1 1 ··· 1 p p ··· p A1,1 = , (20) p,a 0 1 ··· p−1 a1 a2 ··· ap−1 p . Then, the codes generated by Ap,a , denoted by Hp,a , are Zp Zp2 -additive instead of A1,1 t1 ,t2 t1 ,t2 GH codes of type (α1 , α2 ; t1 , t2 ) with α1 = 0. Moreover, the corresponding Zp Zp2 -linear codes are permutation equivalent to Φ(Hpt1 ,t2 ). Proof. As in the proof of Proposition 4.1, we can assume that the coordinates of a = (a1 , . . . , ap−1 ) are in such an order that (pa1 , . . . , pap−1 ) = (p, 2p, . . . , (p−1)p). Therefore, ai = i + μi p, where i ∈ Np− and μi ∈ Np . For each i ∈ Np− , by Remark 4.2, there is a permutation πi ∈ Sp such that πi (φ(ai )) = φ(i) and σi ∈ Sp2 on the set of the elements of Zp2 such that σi (c) = b if and only if πi−1 (φ(c)) = φ(b). Again, by Remark 4.2, we also have (16), that is, (πi | · · · | πi )(Φ(σi (w))) = Φ(w), where w = (0, 1, . . . , p2 − 1). Let Atp,a 1 ,t2 = (A1 | A2 ) be the matrix A1,1 p,a if t1 = t2 = 1, or the matrix obtained by applying (6) and (7) recursively from A1,1 p,a if t1 > 1 or t2 > 1. Let Ap t1 ,t2 = (A1 | A2 ) be t1 ,t2 the matrix defined in Section 3. By construction, the second row of Ap,a contains the block of coordinates a1 , . . . , ap−1 repeated pt2 −1 (p2 )t1 −1 = p2t1 +t2 −3 times. For the -th block of coordinates a1 , . . . , ap−1 , where ∈ {1, . . . p2t1 +t2 −3 }, define I as the coordinate positions corresponding to Φ(a1 , . . . , ap−1 ) within the Gray map image of this second row. Let πt1 ,t2 ∈ Sα1 +pα2 be the permutation such that it coincides with (π1 | · · · | πp−1 ) when it is restricted to the coordinates I , for all ∈ {1, . . . , p2t1 +t2 −3 }, and it is the identity elsewhere. Note that π1,1 = (Id | π1 | · · · | πp−1 ) ∈ Sp2 , where Id ∈ Sp . Now, we consider the matrix Ātp,a 1 ,t2 = (A1 | Ā2 ) constructed with the following re- cursive construction. We start with the matrix Ā1,1 p,a = Ap,a and if Āp,a = (A1 | Ā2 ), 1,1 t1 ,t2 then   t1 ,t2 +1 A 1 A 1 · · · A 1 Ā 2 Ā 2 · · · Ā 2 Āp,a = (21) 0 1 · · · p − 1 p · 0 p · 1 · · · p · (p − 1) 20 D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 and   A1 ··· A1 pA1 ··· pA1 Ā2 ··· Ā2 Ātp,a 1 +1,t2 = σt1 +1,t2 , (22) 0 ··· p−1 1 ··· p−1 0 ··· p −1 2 where σt1 +1,t2 permutes the columns as follows. Let B be the matrix Ātp,a 1 +1,t2 before applying σt1 +1,t2 . For each block of coordinates a1 , . . . , ap−1 in the second row of B and the corresponding coordinates of the last row of B, we consider the following submatrix of B:   a1 ··· ap−1 a1 ··· ap−1 ··· a1 ··· ap−1 . (23) 0 ··· 0 1 ··· 1 ··· p2 − 1 ··· p2 − 1 Note that there are pt2 −1 (p2 )t1 −1 = p2t1 +t2 −3 such submatrices, named S1 , . . . , Sp2t1 +t2 −3 . Then, σt1 +1,t2 is the permutation such that it coincides with σi when it is restricted to the p2 columns corresponding to the columns having ai in the first row of the submatrix S for all i ∈ Np− and ∈ {1, . . . , p2t1 +t2 −3 }, and it is the identity elsewhere. By (16) and the definition of πt1 +1,t2 , we have that πt1 +1,t2 (Φ(σt1 +1,t2 (0, 1, . . . , p − 1 | 1, . . . , p − 1, 0, 1, . . . , p2 − 1)) = (0, 1, . . . , p − 1 | 1, · · · , p − 1, 0, 1, . . . , p2 − 1). (24) Let H̄p,a t1 ,t2 be the code generated by Ātp,a 1 ,t2 . Since H̄p,a t1 ,t2 is permutation equivalent to Hp,a , we also have that Φ(H̄p,a ) is permutation equivalent to Φ(Hp,a t1 ,t2 t1 ,t2 t1 ,t2 ) by Remark 4.1. Therefore, to prove the statement, we just need to show that Φ(H̄p,a t1 ,t2 ) is permutation  equivalent to Φ(Hp ). We proceed by induction. Let vj = (vj | vj ) be the j-th row of t1 ,t2 Ātp,a 1 ,t2 = (A1 | Ā2 ) and uj = (uj | uj ) be the j-th row of Atp1 ,t2 , j ∈ {1, . . . , t1 + t2 }. First, assume t1 = t2 = 1. Note that v2 contains the coordinates a1 , . . . , ap−1 exactly once and, we recall that π1,1 = (Id | π̄1,1 ) ∈ Sp2 , where Id ∈ Sp and π̄1,1 = (π1 | · · · | πp−1 ). By the proof of Proposition 4.1, π1,1 (Φ(λ1 v1 + λ2 v2 )) = Φ(λ1 u1 + λ2 u2 ) for all λ1 , λ2 ∈ Zp2 , so π1,1 (Φ(Hp,a1,1 )) = π1,1 (Φ(H̄p,a 1,1 )) = Φ(Hp1,1 ), and π̄1,1 (Φ(λ1 v1 + λ2 v2 )) =   Φ(λ1 u1 + λ2 u2 ). Now, assume that the permutation πt1 ,t2 = (Id | π̄t1 ,t2 ), where Id ∈ Sα1 , satisfies t1 +t2 t1 +t2 πt1 ,t2 (Φ( λj vj )) = Φ( λj uj ) j=1 j=1 for all λj ∈ Zp2 , so πt1 ,t2 (Φ(H̄p,a t1 ,t2 )) = Φ(Hpt1 ,t2 ) and in particular D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 21 t1 +t2 t1 +t2 π̄t1 ,t2 (Φ( λj vj )) = Φ( λj uj ). (25) j=1 j=1 Note that πt1 ,t2 is defined from the second row of Atp,a 1 ,t2 , which coincides with the second t1 ,t2 row of Āp,a by construction. First, consider the code H̄p,a t1 ,t2 +1 generated by Āp,a t1 ,t2 +1 given in (21) and Hpt1 ,t2 +1 generated by (6). Note that, for j ∈ {1, . . . , t1 + t2 }, the j-th row of Ātp,a 1 ,t2 +1 and Apt1 ,t2 +1     are (vj , . . . , vj | vj , . . . , vj ) and (uj , . . . , uj | uj , . . . , uj ), respectively, where vj = uj . By the construction of Āp,a t1 ,t2 +1 , we have that πt1 ,t2 +1 = (Id | π̄t1 ,t2 +1 ), where Id ∈ Spα1 and π̄t1 ,t2 +1 = (π̄t1 ,t2 | · · · | π̄t1 ,t2 ) ∈ Sp2 α2 . Moreover, since the first pα1 coordinates are exactly the same in both codes Φ(H̄p,a t1 ,t2 +1 ) and Φ(Hpt1 ,t2 +1 ), and πt1 ,t2 +1 is the identity in these coordinates, we can focus on the last ones. Let v = (v | v  ) ∈ H̄p,a t1 ,t2 +1 . We  t1 +t2   have that v = j=1 λj (vj , . . . , vj ) + λw, where w = (p · 0, p · 1, . . . , p · (p − 1)). Then, t1 +t2 Φ(v  ) = Φ( j=1 λj (vj , . . . , vj )) + Φ(λw) by Corollary 2.3. Applying (25) and since π̄t1 ,t2 +1 (Φ(λw)) = Φ(λw), we have that t1 +t2 π̄t1 ,t2 +1 (Φ(v  )) =π̄t1 ,t2 +1 (Φ( λj (vj , · · · , vj ))) + π̄t1 ,t2 +1 (Φ(λw)) j=1 t1 +t2 =Φ( λj (uj , . . . , uj )) + Φ(λw). j=1 Applying again Corollary 2.3, we have that Φ(H̄p,a t1 ,t2 +1 ) and Φ(Hpt1 ,t2 +1 ) are permutation equivalent by using the permutation πt1 ,t2 +1 . Second, consider the code H̄p,a t1 +1,t2 generated by Ātp,a 1 +1,t2 given in (22), and Hpt1 +1,t2 generated by (7). We have that, for j ∈ {1, . . . , t1 + t2 }, the j-th row of Ātp,a 1 +1,t2 and Atp1 +1,t2 are (vj , . . . , vj | pvj , . . . , pvj , vj , . . . , vj ) and (uj , . . . , uj | puj , . . . , puj , uj , . . . , uj ), respectively, where vj = uj . Moreover, the (t1 + 1 + t2 )-th row of Ātp,a 1 +1,t2 and Atp1 +1,t2 are σt1 +1,t2 (0, 1, . . . , p − 1 | 1, . . . , p − 1, 0, 1, . . . , p2 − 1) and (0, 1, . . . , p − 1 | 1, . . . , p − 1, 0, 1, . . . , p2 − 1), respectively. The first pα1 + (p − 1)α1 = (2p − 1)α1 coordinates are exactly the same in both codes H̄p,a t1 +1,t2 and Hpt1 +1,t2 , and hence the first pα1 + p(p − 1)α1 = p α1 coordinates are also the same in both 2 codes Φ(H̄p,a t1 +1,t2 ) and Φ(Hpt1 +1,t2 ). By the definition of π̄t1 ,t2 and σt1 ,t2 , we have that πt1 +1,t2 = (Id | π̄t1 +1,t2 ), where Id ∈ Sp2 α1 and π̄t1 +1,t2 = (π̄t1 ,t2 | · · · | π̄t1 ,t2 ), and σt1 +1,t2 = (Id | σ̄), where Id ∈ S(2p−1)α1 . Therefore, we can focus on the last coordi- nates, that is, we consider t1 +t2 λj (vj , . . . , vj ) + λσ̄(w), (26) j=1 where w = (0, 1, . . . , p2 − 1). From (26), by Corollaries 2.2 and 2.3, we have that 22 D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 t1 +t2 Φ( λj (vj , . . . , vj ) + λσ̄(w)) j=1 (27) t1 +t2 t1 +t2 = Φ( λj (vj , . . . , vj )) + Φ(λσ̄(w)) + Φ(p(( λj (vj , . . . , vj )) p λσ̄(w))). j=1 j=1 t1 +t2 t1 +t2 Applying (25), π̄t1 +1,t2 (Φ( j=1 λj (vj , . . . , vj ))) = Φ( j=1 λj (uj , . . . , uj )) and, from (24) and Lemma 4.2, π̄t1 +1,t2 (Φ(λσ̄(w))) = Φ(λw). (28) By Lemma 4.2, note that σ̄(w) ≡ w mod p. Moreover, vj ≡ uj mod p for all j ∈ {1, . . . , t1 + t2 } by construction. Thus, we also have that t1 +t2 π̄t1 +1,t2 (Φ(p(( λj (vj , . . . , vj )) p λσ̄(w))) j=1 t1 +t2 = Φ(p(( λj (uj , . . . , uj )) p λw)), (29) j=1 by Corollary 4.1 and because π̄t1 +1,t2 fixes the Gray map image of elements of order p by construction. Therefore, from the previous equations, we have that t1 +t2 π̄t1 +1,t2 (Φ( λj (vj , . . . , vj ) + λσ̄(w))) j=1 t1 +t2 t1 +t2 = Φ( λj (uj , . . . , uj )) + Φ(λw) + Φ(p(( λj (uj , . . . , uj )) p λw)) j=1 j=1 t1 +t2 = Φ( λj (uj , . . . , uj ) + λw), j=1 by Corollary 2.3. Therefore, the codes Φ(H̄p,a t1 +1,t2 ) and Φ(Hpt1 +1,t2 ) are permutation equivalent by using the permutation πt1 +1,t2 , and the result follows.  Theorem 4.2. Let a = (a1 , . . . , ap−1 ), b = (b1 , . . . , bp−1 ) ∈ Zp−1 p2 such that {pa1 , . . . , pap−1 } = {pb1 , . . . , pbp−1 } = pZp2 \ {0}. Let Atp,a 1 ,t2 be the matrix obtained by using constructions (6) and (7), starting with the matrix A1,1 t1 ,t2 p,a given in (20). From Ap,a = (A1 | A2 ), we apply the following construction   A1 ··· A1 pA1 ··· pA1 A2 ··· A2 Atp,a,b 1 +1,t2 = . (30) 0 ··· p−1 b1 ··· bp−1 0 ··· p2 − 1 D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 23 Then, the codes generated by Atp,a,b 1 +1,t2 t1 +1,t2 , denoted by Hp,a,b , are Zp Zp2 -additive GH codes of type (α1 , α2 ; t1 + 1, t2 ) with α1 = 0. Moreover, the corresponding Zp Zp2 -linear codes t1 +1,t2 Φ(Hp,a,b ) are permutation equivalent to Φ(Hpt1 +1,t2 ). Proof. Let Atp,a 1 +1,t2 be the matrix obtained from Atp,a 1 ,t2 by using construction (7). Let Hp,a t1 +1,t2 be the Zp Zp2 -additive GH code generated by Ap,a+1,t2 . By Theorem 4.1, we just t 1 t1 +1,t2 t1 +1,t2 need to show that Φ(Hp,a,b ) is permutation equivalent to Φ(Hp,a ). As in the proof of Proposition 4.1 and Theorem 4.1, we can assume that the coordi- nates of b = (b1 , . . . , bp−1 ) are in such an order that (pb1 , . . . , pbp−1 ) = (p, 2p, . . . , (p − 1)p). Therefore, bi = i + μi p, where i ∈ Np− and μi ∈ Np . Then, by using the same argument as in the proof of Theorem 4.1, we have that the Zp Zp2 -linear code obtained from Atp,a,b 1 +1,t2 is permutation equivalent to Φ(Hp,a t1 ,+1,t2 ).  Example 4.5. Let p = 2. As in Example 4.4, we have that the possible values for b1 such that {2b1 } = {2} are 1 and 3. If b1 = 1, then At2,a,b 1 +1,t2 = At2,a 1 +1,t2 . Otherwise, if b1 = 3, then At2,a,b 1 +1,t2 is the matrix At2,a 1 +1,t2 after changing the sign of the columns where b1 appears in the last row of At2,a,b 1 +1,t2 . In this last case, the Z2 Z4 -additive codes H2,a,bt1 +1,t2 t1 +1,t2 and H2,a are monomially equivalent [22], hence their corresponding Z2 Z4 -linear codes are permutation equivalent. By following the same arguments as in the proofs of Theorems 4.1 and 4.2, we can construct Zp Zp2 -linear codes that are permutation equivalent to Φ(Hpt1 ,t2 ), by starting p−1 p,a , a = (a1 , . . . , ap−1 ) ∈ Zp2 from A1,1 satisfying {pa1 , . . . , pap−1 } = pZp2 \ {0}, and by using constructions (6) and (30) recursively. Moreover, each time the construction (30) is applied, the vector b can be different as long as it satisfies that {pb1 , . . . , pbp−1 } = pZp2 \ {0} as shown in the following corollary. Corollary 4.3. Let a = (a1 , . . . , ap−1 ) ∈ Zp−1 p2 such that {pa1 , . . . , pap−1 } = pZp2 \ {0}. Let L = [b1 , . . . , bt1 −1 ] such that bi = (bi,1 , . . . , bi,p−1 ) ∈ Zp−1 p2 and {pbi,1 , . . . , pbi,p−1 } = t1 ,t2 pZp2 \ {0} for all i ∈ {1, . . . , t1 − 1}. Let Ap,a,L be the matrix obtained by using (6) and i+1,j i,j (30), starting with A1,1 p,a given in (20) and using bi in (30) to construct Ap,a,L from Ap,a,L for i ∈ {1, . . . , t1 − 1}, j ∈ {1, . . . , t2 }. Then, the codes generated by Atp,a,L 1 ,t2 , denoted by t1 ,t2 Hp,a,L , are Zp Zp2 -additive GH codes of type (α1 , α2 ; t1 , t2 ) with α1 = 0. Moreover, the t1 ,t2 corresponding Zp Zp2 -linear codes Φ(Hp,a,L ) are permutation equivalent to Φ(Hpt1 ,t2 ). Note that if a = (1, 2, . . . , p − 1), then Hp,a t1 ,t2 = Hpt1 ,t2 for all t1 , t2 ≥ 1. If t1 ,t2 b = (1, 2, . . . , p − 1), since matrix (30) coincides with matrix (7), then Hp,a,b = Hp,a t1 ,t2 . t1 ,t2 Similarly, if L = [b, . . . , b], where b = (1, 2, . . . , p − 1), then Hp,a,L = Hp,a . t1 ,t2 Example 4.6. Let S be the set given in Example 4.3. By Theorem 4.2, from each one of the possible starting matrices A1,1 3,a , described in Example 4.3, we can construct different Z3 Z9 -linear GH codes of type (α1 , α2 ; 2, 1), which are all permutation equivalent to each 24 D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 other. Specifically, for any a = (a1 , a2 ) ∈ S and b1 = (b1,1 , b1,2 ) ∈ S, the Z3 Z9 -linear codes corresponding to the Z3 Z9 -additive codes generated by ⎛ ⎞ 111 111 111 333 333 3 3 · · · 33 ⎜ ⎟ A2,1 3,a,b1 = ⎝ 012 012 012 036 036 a1 a2 · · · a1 a2 ⎠ , (31) 000 111 222 b1,1 b1,2 0 0 · · · 88 where b1,1 = (b1,1 , b1,1 , b1,1 ) and b1,2 = (b1,2 , b1,2 , b1,2 ), are all permutation equivalent to each other. Similarly, by Corollary 4.3, for any a, b1 , b2 ∈ S, b2 = (b2,1 , b2,2 ), L = [b1 , b2 ] and A2,1 3,a,b1 = (A1 | A2 ) as in (31), the Z3 Z9 -linear GH codes obtained from the following matrix   3,1 A1 A1 A1 3A1 3A1 A2 A2 · · · A2 A3,a,L = , 0 1 2 b2,1 b2,2 0 1 ··· 8 where b2,1 = (b2,1 , . . . , b2,1 ), b2,2 = (b2,2 , . . . , b2,2 ) ∈ Z99 , are all permutation equivalent to each other. Remark 4.3. Let t1 , t2 ≥ 1, a ∈ Zp−1 p2 and L = [b1 , . . . , bt1 −1 ], where bi ∈ Zp−1 p2 for all i ∈ {1, . . . , t1 − 1}. From Theorem 4.1 and Corollary 4.3, we have that if a and bi ∈ Zp−1 p2 satisfy the condition given in these results for all i ∈ {1, . . . , t1 −1}, then the Zp Zp2 -linear codes obtained from matrices Atp,a 1 ,t2 and Atp,a,L 1 ,t2 are GH codes, and they are permutation equivalent to the codes obtained from Atp1 ,t2 . It is easy to prove that if a or bi , for some i ∈ {1, . . . , t1 − 1}, do not satisfy that property, then the Zp Zp2 -linear codes obtained from Atp,a1 ,t2 and Atp,a,L 1 ,t2 are not GH codes. Indeed, Φ(u) − Φ(0) would not contain every element of Zp the same number of times, if u was a multiple of the row containing a or bi . 5. Conclusions and further research In this paper, we have seen that there are many different ways to construct ZpZp2 - linear GH codes of type (α1 , α2 ; t1 , t2 ) with t1 , t2 ≥ 1, α1 = 0, and p prime. However, we have proved that for all of them we obtain permutation equivalent codes. Thus, to study these codes, we can always focus on the construction given in Section 3. This construction generalizes the known recursive construction of Z2 Z4 -additive Hadamard codes with α1 = 0 given in [19]. Two structural properties of codes over Zp are the rank and dimension of the kernel. The rank of a code C over Zp is simply the dimension of the linear span, C, of C. The kernel of a code C over Zp is defined as K(C) = {x ∈ Znp : x + C = C} [23,24]. If the all-zero vector belongs to C, then K(C) is a linear subcode of C. Note also that if C is linear, then K(C) = C = C. We denote the rank of C as r and the dimension of the kernel as k. The parameters (r, k) can be used to distinguish between non-equivalent codes, since equivalent ones have the same value of rank and dimension of the kernel. D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 25 Table 1 Type and parameters (r, k) of Z9 -linear and Z3 Z9 -linear GH codes. p t Z9 -linear GH codes Z3 Z9 -linear GH codes (0, α2 ; t1 , t2 ) (r, k) (α1 , α2 ; t1 , t2 ) (r, k) 3 2 (0, 3; 1, 1) (3, 3) (9, 0; 0, 3) (3, 3) (3, 2; 1, 1) (4, 2) 3 (0, 9; 1, 2) (4, 4) (27, 0; 0, 4) (4, 4) (0, 9; 2, 0) (5, 2) (9, 6; 1, 2) (5, 3) 4 (0, 27; 1, 3) (5, 5) (81, 0; 0, 5) (5, 5) (0, 27; 2, 1) (6, 3) (27, 18; 1, 3) (6, 4) (9, 24; 2, 1) (10, 3) 5 (0, 81; 1, 4) (6, 6) (243, 0; 0, 6) (6, 6) (0, 81; 2, 2) (7, 4) (81, 54; 1, 4) (7, 5) (0, 81; 3, 0) (11, 3) (27, 72; 2, 2) (11, 4) 6 (0, 243; 1, 5) (7, 7) (729, 0; 0, 7) (7, 7) (0, 243; 2, 3) (8, 5) (243, 162; 1, 5) (8, 6) (0, 243; 3, 1) (12, 4) (81, 216; 2, 3) (12, 5) (27, 234; 3, 1) (20, 4) 7 (0, 729; 1, 6) (8, 8) (2187, 0; 0, 8) (8, 8) (0, 729; 2, 4) (9, 6) (729, 486; 1, 6) (9, 7) (0, 729; 3, 2) (13, 5) (243, 648; 2, 4) (13, 6) (0, 729; 4, 0) (21, 4) (81, 702; 3, 2) (21, 5) 8 (0, 2187; 1, 7) (9, 9) (6561, 0; 0, 9) (9, 9) (0, 2187; 2, 5) (10, 7) (2187, 1458; 1, 7) (10, 8) (0, 2187; 3, 3) (14, 6) (729, 1944; 2, 5) (14, 7) (0, 2187; 4, 1) (22, 5) (243, 2106; 3, 3) (22, 6) (81, 2160; 4, 1) (35, 5) In [13,14], the rank and dimension of the kernel are used to classify Z2 Z4 -linear Hadamard codes with α1 = 0 and α1 = 0, respectively. Moreover, it is also known that the family of Z2 Z4 -linear Hadamard codes with α1 = 0 includes the family of Z2 Z4 -linear Hadamard codes with α1 = 0 [15], since each Z2 Z4 -linear Hadamard code with α1 = 0 is equivalent to a Z2 Z4 -linear Hadamard code with α1 = 0. The rank and dimension of the kernel have also been used to classify Zps -linear GH codes of length pt , with s ≥ 2 and p prime [8,16–18]. Table 1 shows the type (α1 , α2 ; t1 , t2 ) and parameters (r, k) for all Z3 Z9 -linear GH codes of length 3t , with α1 = 0 and 2 ≤ t ≤ 8, considered in this paper. It also includes the type (0, α2 ; t1 , t2 ) and parameters (r, k) for all Z9 -linear GH codes of the same length considered in [16]. By looking at Table 1, we have that all Z3 Z9 -linear GH codes of length 3t , with α1 = 0 and 2 ≤ t ≤ 8, are pairwise non-equivalent since all of them have a different value of the kernel. This means that there are at least t/2 + 1 such codes for 2 ≤ t ≤ 8. Moreover, we can see that these non-linear codes are also non-equivalent to any Z9-linear GH code of the same length. Similar results can be obtained computationally for p = 5 and p = 7. This means that, unlike for p = 2, in general, for p ≥ 3 prime, the Zp2 -linear GH codes are not included in the family of Zp Zp2 -linear GH codes with α1 = 0. More 26 D.K. Bhunia et al. / Finite Fields and Their Applications 83 (2022) 102093 generally, we can also observe that the Z3 Z9 -linear GH codes of length 3t , with α1 = 0 and 2 ≤ t ≤ 8, are not equivalent to any Z3s -linear GH code of the same length with s ≥ 2, by comparing the values of (r, k) given in Table 1 with the ones given in [16, Tables 4 and 5]. Further research on this topic would be to prove these results for any t ≥ 2 and p ≥ 3 prime. References [1] D.K. Bhunia, C. Fernández-Córdoba, M. Villanueva, On Zp Zp2 -linear generalized Hadamard codes, in: Proc. of the 12th International Workshop on Coding and Cryptography (WCC 2022), 7-11 March 2022 - Virtual, 2022, pp. 7–11. [2] A.R. Hammons, P.V. Kumar, A.R. Calderbank, N.J. Sloane, P. Solé, The Z4 -linearity of Kerdock, Preparata, Goethals, and related codes, IEEE Trans. Inf. Theory 40 (2) (1994) 301–319. [3] C. Carlet, Z2k -linear codes, IEEE Trans. Inf. Theory 44 (4) (1998) 1543–1547. [4] J. Borges, C. Fernández-Córdoba, J. Rifà, Every Z2k -code is a binary propelinear code, Electron. Notes Discrete Math. 10 (2001) 100–102. [5] S.T. Dougherty, C. Fernández-Córdoba, Codes over Z2k , Gray map and self-dual codes, Adv. Math. Commun. 5 (4) (2011) 571–588. [6] T. Honold, A.A. Nechaev, Weighted modules and representations of codes, Probl. Inf. Transm. 35 (3) (1999) 205–223. [7] D.S. Krotov, On Z2k -dual binary codes, IEEE Trans. Inf. Theory 53 (4) (2007) 1532–1537. [8] C. Fernández-Córdoba, C. Vela, M. Villanueva, On Z2s -linear Hadamard codes: kernel and partial classification, Des. Codes Cryptogr. 87 (2–3) (2019) 417–435. [9] M. Shi, R. Wu, D.S. Krotov, On Zp Zpk -additive codes and their duality, IEEE Trans. Inf. Theory 65 (6) (2019) 3841–3847. [10] D. Jungnickel, On difference matrices, resolvable transversal designs and generalized Hadamard matrices, Math. Z. 167 (1) (1979) 49–60. [11] E.F. Assmus, J.D. Key, Designs and Their Codes, Cambridge University Press, 1992. [12] S.T. Dougherty, J. Rifà, M. Villanueva, Ranks and kernels of codes from generalized Hadamard matrices, IEEE Trans. Inf. Theory 62 (2) (2016) 687–694. [13] D.S. Krotov, Z4 -linear Hadamard and extended perfect codes, Electron. Notes Discrete Math. 6 (2001) 107–112. [14] K.T. Phelps, J. Rifà, M. Villanueva, On the additive (Z4 -linear and non-Z4 -linear) Hadamard codes: rank and kernel, IEEE Trans. Inf. Theory 52 (1) (2006) 316–319. [15] D.S. Krotov, M. Villanueva, Classification of the Z2 Z4 -linear Hadamard codes and their automor- phism groups, IEEE Trans. Inf. Theory 61 (2) (2015) 887–894. [16] D.K. Bhunia, C. Fernández-Córdoba, M. Villanueva, On the linearity and classification of Zps -linear generalized Hadamard codes, Des. Codes Cryptogr. 90 (2022) 1037–1058. [17] C. Fernández-Córdoba, C. Vela, M. Villanueva, On Z8 -linear Hadamard codes: rank and classifica- tion, IEEE Trans. Inf. Theory 66 (2) (2019) 970–982. [18] C. Fernández-Córdoba, C. Vela, M. Villanueva, Equivalences among Z2s -linear Hadamard codes, Discrete Math. 343 (3) (2020) 111721. [19] J. Rifà, F.I. Solov’eva, M. Villanueva, On the intersection of Z2 Z4 -additive perfect codes, IEEE Trans. Inf. Theory 54 (3) (2008) 1346–1356. [20] M. Greferath, S.E. Schmidt, Gray isometries for finite chain rings and a nonlinear ternary (36, 312 , 15) code, IEEE Trans. Inf. Theory 45 (7) (1999) 2522–2524. [21] I. Constantinescu, W. Heise, A metric for codes over residue class rings, Probl. Pereda. Inf. 33 (3) (1997) 22–28. [22] J. Borges, C. Fernández-Córdoba, J. Pujol, J. Rifà, M. Villanueva, Z2 Z4 -linear codes: generator matrices and duality, Des. Codes Cryptogr. 54 (2) (2010) 167–179. [23] H. Bauer, B. Ganter, F. Hergert, Algebraic techniques for nonlinear codes, Combinatorica 3 (1) (1983) 21–33. [24] K.T. Phelps, J. Rifà, M. Villanueva, Kernels and p-kernels of pr -ary 1-perfect codes, Des. Codes Cryptogr. 37 (2) (2005) 243–261.