Tilburg centre for Creative Computing P.O. Box 90153 Tilburg University 5000 LE Tilburg, The Netherlands http://www.uvt.nl/ticc Email: ticc@uvt.nl Copyright © S.M. Dodunekov, A. Bojilov and A.J. van Zanten 2010. March 23, 2010 TiCC TR 2010-001 Generalized Residue Codes Bulgarian Academy of Sciences, Bulgaria and TiCC, Tilburg University S.M. Dodunekov, A. Bojilov and A.J. van Zanten Generalized Residue Codes S.M. Dodunekov, A. Bojilov and A.J. van Zanten 1 Abstract A general type of code Cni ,q ,t , 1 ! i ! t , is introduced as a straightforward generalization of the well-known quadratic residue codes, using the formalism of generating polynomials over finite fields. Apart from the parameter t which has to be a divisor of " ( n ) , where " is the Euler function, these codes are defined over an arbitrary field GF ( q ) and have an arbitrary length n, with ( n, q ) # 1 . In this sense they can be seen as a generalization of quadratic residue codes, generalized quadratic residue codes, Q-codes, residue codes and of duadic, triadic and polyadic codes. 2 Contents Introduction 1. Preliminaries and the definition of generalized residue codes 2. The group U n and its subgroups of m-residues 3. Some simple properties of generalized residue codes 4. Minimum distances in generalized residue codes 5. The special case n = p 6. The special case n = p $ 7. The special case n = 2p $ 8. Extended generalized residue codes and the case n = 21 References 3 Introduction Linear cyclic codes belong to the most widely studied algebraic codes in the literature. In this Report 1 , q is meant to be the power of some prime, though very often we shall deal with q as if it were a single prime. A code C of length n over the field GF (q ) , with ( n, q ) # 1 , is called linear if it is a linear space over GF (q ) , and it is called cyclic if it is invariant under cyclic permutations. This last condition means that if c # (c0 , c1 ,.........., c n&1 ) % C , then c’= (c n &1 , c0 ,............., c n &2 ) % C . Here, the components ci , 0 ! i ! n & 1 , are all from GF (q ). The isomorphism which maps c onto c0 ' c1 x ' .............. ' cn&1 x n&1 in the polynomial ring Rn :# GF ( q )[ x] /( x n & 1 ) yields a cyclic principal ideal in that ring, generated by a unique monic polynomial g (x ) of lowest degree, with g (x ) ! x n & 1 . Usually, the code C and this ideal are identified. Very often a cyclic code is defined by prescribing the zeros of its generator polynomial g (x ) (the zeros of the code) in some extension field of GF (q ) . If x n & 1 # g ( x )h( x ) , then h(x ) defines the first row of a cyclic parity check matrix of C , and is therefore called the check polynomial. A polynomial c (x ) corresponds to a codeword of C , if and only if c ( x ) h( x ) # 0 in Rn . The polynomial h(x ) can also be interpreted as the generator polynomial of a code which is equivalent to the dual code C ( . Quadratic residue codes (QR-codes) are normally introduced as follows. Take for n a prime p and take for q also a prime different from p . Moreover, one requires that q is a quadratic residue mod p . Let Q be the set of nonzero squares in GF ( p ) and N the set of nonsquares. Let ) be a primitive n -th root of unity in some extension field of GF ( q ) . One defines the polynomials g (1) ( x ) :# * ( x & ) i ) and g ( 2 ) ( x ) :# * ( x & ) i ) . i%N i%Q These polynomials have coefficients in GF ( q ) , and they satisfy x n & 1 # ( x & 1) g (1) ( x ) g ( 2 ) ( x ) . _ _ One next defines cyclic codes Q , Q , N and N generated by the polynomials g (1) ( x ) , ( x & 1) g (1) ( x ) , g ( 2 ) ( x ) and ( x & 1) g ( 2 ) ( x ) , respectively. All four codes are called quadratic residue codes over GF ( q ) of prime length n( # p ) . As already remarked, these codes are studied intensively, e.g. with respect to their minimum distance, automorphism 1 This report is based on a paper of the first author: S.M. Dodunekov, Residual codes, Plisca Studia Mathematica Bulgarica, 2 (1981), pp. 3 – 5 (in Russian). 4 group, generating idempotent, dual code, extended code, etc. Quadratic codes have rate close to ½, and tend to have high minimum distance at least for not too large values of n . As for practical reasons, quadratic codes are easy to encode like all cyclic codes, but in general difficult to decode. For all these properties and related aspects, we refer to [1, 9, 12, 13] and to the literature mentioned in these books. Van Lint and MacWilliams in [9], Camion in [3], Delsarte in [4] and Ward in [16] generalize the above concept of quadratic codes for code length n # p m and for arbitrary fields GF ( q ) , ( q, p ) # 1 . It turns out that the methods that are used to handle quadratic residue codes can easily be generalized to give an analogous theory for these so-called generalized quadratic residue codes (GQRcodes). Berlekamp in [1, Section 15.2] defines e - residue codes, which for e # 2 are identical to quadratic residue codes, and shows that the minimum distance of such codes satisfies the inequality known as the square root bound in the case of quadratic residue codes. Binary QR-codes ( q # 2 or q # 2 l ) are the most studied quadratic residue codes by far. Also codes over GF (3) are considered occasionally.These are called Pless symmetry codes (cf. [15]). For q + 3 little is known in case of quadratic residue codes. Pless in [14] studied ‘Q-codes’ which contain as a subclass QR-codes over GF (4) . A different kind of generalization of QR – codes form the duadic codes, introduced by Leon, Masley and Pless in [7], where these are only defined for the binary case. Smid in [16] further generalizes this notion for arbitrary finite fields. Further generalizations of this type are triadic codes by Pless and Rushanan in [15] and polyadic codes by Pless and Brualdi in [2]. The duadic codes in [7] are defined for length n # p$1 p$ 2 ...... p$l , where each pi is prime and congruent to ±1 mod 8. Let S be the family of cyclotomic cosets , {0} mod n and let S1 and S 2 be subfamilies of S with S # S1 - S2 , S1 . S 2 # / . Under certain conditions, the polynomials e j ( x) # 0 i%S xi , i % {1, 2} , are the idempotent generators of duadic j codes C1 and C2 . In case that n is equal to some prime p, the families S1 and S 2 are identical to the sets of quadratic residues and non-quadratic residues mod n, respectively, and one obtains the binary quadratic residue codes of length n. In [15] and in [2] the notion of duadic code is further generalized for splittings of S into three and into m subfamilies, giving rise to triadic and m-adic codes, respectively. The codes considered in [15] are of prime power length. The same holds for the polyadic codes studied by Sharma, Bakshi and Raka in [17]. They present necessary and sufficient conditions for the existence of these codes. The codes studied in [2] are m-adic codes of prime length over GF ( q ) . In this Report we shall introduce the notion of generalized residue codes (GR-codes). Such codes constitute a straightforward generalization of quadratic residue codes, since their generating polynomials are of the form g ( x) # * ( x & ) i ) , where K stands for some i%K subgroup of U n ( :# Z n* ), the multiplicative subgroup of Z n , of index t, or for one of its cosets. Notice that for n # p , Q is the subgroup of quadratic residues of U p , while N is 5 its only coset. Therefore, by taking K :# Q which has index 2 with respect to U p , we obtain a special GR-code with t # 2 . In general, the value of the code length n, the underlying field GF ( q ) and the value of the parameter t are arbitrary, apart from the condition that t has to be a divisor of " ( n ) and q has to be an element of K. In Section 1 we present some general definitions and notions. In Section 2 we present some well-known facts about the group U n , the multiplicative group of integers mod n which are prime to n. We also derive a few less known properties of U n which will be applied in the next sections and also in a next report dealing with m-residue codes which constitute a subclass of the GR-codes, defined by the requirement that K is equal to the m subgroup U n of m-powers of the elements of U n , for some value of m. We call this particular subclass the class of m-residue codes or more generally, when we do not specify the value of m, the class of residue codes. Berlekamp in [1, Section 15.2] introduced the term e-th residue code for a type of code which is identical to our eresidue code in the case that n is a prime. For this reason we chose the name generalized residue codes for the codes considered in this Report. In Section 3 a number of simple properties of GR- codes are discussed. The subject of Section 4 is a lower bound for the minimum distance of the odd-weight codewords of a GR- code. This lower bound generalizes a well-known result for QR-codes and their generalizations. Sections 5, 6 and 7 deal respectively with the special cases n # p , n # p$ and n # 2 p$ . These cases share the property that the group U n is cyclic, which appears to be a facilitating feature. In Section 8 an example is considered which is not covered by these three special cases, i.e. n # 21 . For this n-value the group U n is not cyclic. The example for n # 21 also serves as an illustration of the notion of extended GR- code. In a next report we shall conduct a closer investigation with respect to GR-codes based on nonm cyclic groups U n and in particular to cases where K is chosen to be equal to U n . Other topics which will get our attention then is the construction of idempotent generators and the automorphism groups of GR-codes. 1. Preliminaries and the definition of generalized residue codes $ $ $ Let n # p1 1 p 2 2 .......... pl l , where p1 , p2 , ………, p l are prime numbers, and let q be an arbitrary prime (power), with q , p i , 1 ! i ! l . Hence, ( n, q ) # 1 . Let furthermore r := ord n (q ) be the multiplicative order of q modulo n , i.e. r is the least positive integer satisfying q r # 1 mod n . (1.1) * In other words, r is the order of q in the multiplicative group Z n , which usually is denoted by U n (cf. definition (1.5)). 6 Let 1 n (x ) be the n - th cyclotomic polynomial over the field of rationals ". Then 1 n (x ) is a divisor of x n & 1 , as follows from the well known expression x n &1 # * 1 d ( x ) . In the next, we shall write d/n x n & 1 # ( x & 1) P( x)1 n ( x ) . (1.2) Moreover, deg 1 n (x ) is equal to " ( n ) , where " is the well-known Euler function. Since (1.2) holds in Z [ x] , it also holds in Z q [x] and hence, we can consider 1 n (x ) as a polynomial over the finite field GF ( q ) . More specifically, we can write (cf. [8, Theorem 2.47]) deg 1 n ( x ) # " ( n) # r$ , (1.3) for some integer $ , and we have the following factorization in F [ x ] 1 n ( x ) # F1 ( x ) F2 ( x )...........F$ ( x ) (1.4) into polynomials Fi ( x ), 1 ! i ! $ , all of degree r as defined in (1.1), which are irreducible over the field F := GF ( q ) (cf. also [1] where the case n is prime is considered). We also introduce the multiplicative group of positive integers mod n , which are coprime with n , i.e. the multiplicative group of the ring Z n , represented by G :# U n # {a ! a 2 n , ( a , n ) # 1} . (1.5) Example 1.1 Take n # 6 and q # 7 . The multiplicative order of 7 mod 6 is equal to r # 1 . Let ) be a primitive 6-th root of 1 in some extension field of GF (7) . In this case it is not necessary to extend GF (7 ) , since ord 7 (5) = 6, and so we can take ) # 5 % GF (7 ) . Hence, we have 1 6 ( x ) # ( x & ) )( x & ) 5 ) = ( x & 5)( x & 3) = x 2 & x ' 1 . An alternative derivation is by applying 1 2 k ( x ) # 1 k ( & x ) and using 1 3 ( x ) # x 2 ' x ' 1 . We also know that 1 6 (x ) is a divisor of x 6 & 1 . In particular we can write x 6 & 1 # 11 ( x )1 2 ( x )1 3 ( x )1 6 ( x ) , with 11 ( x) # x & 1 , 1 2 ( x) # x ' 1 and 1 3 ( x ) # x 2 ' x ' 1 , which delivers the expression for 1 6 ( x) . Since deg 1 6 ( x) # 2 # 1.2 , it follows that $ # 2 . It appears that in GF ( 7 )[ x] we can factorize 1 6 (x ) as 7 1 6 ( x ) # x 2 & x ' 1 # F1 ( x ) F2 ( x ) :# ( x ' 2)( x ' 4) . " Example 1.2 Next we consider the case n # 12 , so U 12 # {1,5,7,11} . Let ) be a primitive 12-th root of 1 in an extension field of ". The 12-th cyclotomic polynomial over " equals 1 12 ( x ) # ( x & ) )( x & ) 5 )( x & ) 7 )( x & ) 11 ) = ( x 2 & 3 x ' 1)( x 2 ' 3 x ' 1) # x 4 & x 2 ' 1 . If we consider 112 (x) as a polynomial in GF (5)[ x ] , we have the factorization 1 12 ( x ) # F1 ( x ) F2 ( x ) :# ( x 2 ' 2 x & 1)( x 2 ' 3 x & 1) , where F1 (x ) and F2 (x) are irreducible and both of degree 2. Since 5 2 # 1 mod 12, we have r # 2 and hence $ # 2 , which illustrates again the factorization in (1.4). Similar results can be derived for q # 7 and q # 11 . In GF ( 7 )[ x] as well as in GF (11)[ x ] we have r # 2 and $ # 2 , since 7 2 # 1 and 112 # 1 mod 12. The factorizations are respectively 1 12 ( x ) # ( x 2 ' 2)( x 2 ' 4) and 1 12 ( x ) # ( x 2 ' 5 x ' 1)( x 2 & 5 x ' 1) . " Consider the group G defined in (1.5). The minimal subgroup H 3 G containing q is the cyclic group generated by q , i.e. H #2 q +# {1, q , q 2 ,......... , q r &1 } , where r # ord n (q ) . Since the factorgroup G / H has order ! G / H ! = $ , we can write 8 (1.6) $ G # ! H i # H 1 - H 2 - ......... - H $ (1.7) i #1 where the cosets H i are non-intersecting cyclotomic classes, defined by H i # xi H with representative elements x1 # 1 , x 2 ,….…., x$ . Now consider the polynomial Pi ( x ) # *(x & ) l ) , (1.8) l%H i with i % {1,2,......... , $ } , and where ) is a primitive n -th root of unity in some appropriate extension field of F # GF ( q ) . Clearly deg Pi (x ) is equal to ! H ! = r and * Pi ( x ) # 1 n ( x) . i Lemma 1.1 By appropriate indexing the polynomials Fi (x ) in (1.4), one has Pi ( x ) # Fi ( x ) , for all i % {1,2,........, $ } . Proof We write the polynomial (1.8) as Pi ( x) # * ( x & ) l ) # x r ' c r &1 x r &1 ' ....... ' c1 x ' c0 , l%H i where the coefficients cr &1 , ......., c1 , c0 are symmetric functions of the elements ) l , l % H i . Since the elements of the set H i are permuted among each other under q multiplication by q , it follows that c j # c j . Hence, c j % F for all j , 0 ! j ! r & 1 . So Pi ( x) % F [ x] , for 1 ! i ! $ . Moreover, all Pi (x ) are divisors of 1 n (x ) and Pi (x ) and Pj (x ) have no common zeros $ for i , j . Therefore, 1 n ( x ) # * Pi ( x ) is a factorization of 1 n (x) into $ polynomials i #1 over F of degree r. Eq. (1.8) is a similar factorization into $ irreducible polynomials over F of degree r. Since a decompostion of 1 n (x) into irreducible polynomials over some fixed field is unique, it follows that the Pi (x) are irreducible and equal to the polynomials Fi (x) from (1.8) in some order. # Example 1.3 Take n # 12 and q # 7 . We have U 12 # {1,5,7,11} and 1 12 ( x) # x 4 & x 2 ' 1 (cf. Example 1.2). Since H # H 1 # {1,7} and H 2 # {5,11} , it follows that P1 ( x ) # ( x & ) )( x & ) 7 ) # x 2 & () ' ) 7 ) x ' ) 8 # x 2 & ) 2 , 9 P2 ( x ) # ( x & ) 5 )( x & ) 11 ) # x 2 & () 5 ' ) 11 ) x ' ) 4 # x 2 ' ) 4 , where we used ) 12 # 1 and ) 6 = & 1 . In order to determine the constants in the above polynomials, we put 4 :# ) 2 . Then 4 is a root of the equation x 3 ' 1 # 0 . In GF ( 7 )[ x] we have x 3 ' 1 # ( x ' 1)( x & 3)( x & 5) . Since, ) 2 # &1 does not correspond to a primitive root ) , we have either ) 2 # 5 # &2 or ) 2 # 3 # &4 . The choice ) 2 # &2 gives P1 ( x ) # x 2 ' 2 , P2 ( x ) # x 2 ' 4 . The choice ) 2 # &4 gives an equivalent result, interchanging the indices 1 and 2. Comparing this with the polynomials F1 (x ) and F2 (x) (cf. again Example 1.2), illustrates Lemma 1.1. " Finally, we present an example which shows that for a given value of n and fixed values of r and $ , the cyclotomic polynomial 1 n ( x) can factorize into $ factors of degree r, but over different fields. Example 1.4 For n # 5 , we have 1 5 ( x ) # x 4 ' x 3 ' x 2 ' x ' 1 , U 5{1, 2,3, 4} and " (5) # 4 . According to eq. (1.4), the polynomial 1 5 ( x) factorizes into $ # 4/r irreducible polynomials of degree r over any field GF ( q ) with ( q, 5) # 1 and ord 5 ( q) # r . As an example we take successively q # 22 and q # 32 which have both order 2 with respect to 5. In the case q # 22 # 4 we can write 1 5 ( x) # ( x 2 ' 5 x ' 1)( x 2 ' 5 2 x ' 1) , where 5 is a zero of the irreducible (over GF (2)) polynomial x 2 ' x ' 1 . In the case q # 32 # 9 , we have the factorization 1 5 ( x ) # ( x 2 & 6 x ' 1)( x 2 ' 6 &1 x ' 1) , with 6 a zero of the irreducible polynomial (over GF (3) ) x 2 ' x & 1 . If we take q # 3 , we have ord 5 (3) = 4 and $ # 1 , and so 1 5 ( x) is irreducible in GF (3)[ x] . Something similar holds for q # 11 which also has order 4 with respect to 5, from which we conclude that 1 5 ( x) is irreducible in GF (11)[ x ] . # Suppose $ # st , t 7 2 , and let K be a subgroup of G of index t such that H 3 K 3 G. (1.9) 10 From the assumptions it follows that ! G ! = " ( n ) = r$ = rst , ! K ! = rs , ! H ! = r . (1.10) Because of (1.9) we can write, by relabeling the H - cosets, K # H 1 - H 2 - ....... - H s (1.11) and also G # y1 K - y 2 K - ........ - y t K = K1 - K 2 - ....... - K t (1.12) for some suitable elements y1 # 1 , y 2 , ……., yt in G . Combining (1.11) and (1.12), and using H i # xi H , provides us with G# ! xi , j H 1!i ! s ,1! j !t , (1.13) with xi , j :# xi y j . This is equivalent to (1.7). Since ) is a primitive n-th root of unity in some extension field of F, the polynomials s (i ) l g ( x) # * ( x & ) ) = l%K i * F j (x) , 1 ! i ! t , k (1.14) k #1 of degree rs, are divisors of x n & 1 and have coefficients in F , as can be proven in a similar way as Lemma 1.1. (cf. [1]). The polynomials F j1 (x ) ,……, F js ( x ) constitute some subset of the set of polynomials F1 (x ) ,……., F$ (x ) (or of the polynomials P1 ( x ),........, P$ ( x) ) introduced in (1.4) (in (1.8)). A simple consequence is t * g (i ) ( x) # 1 n ( x) . (1.15) i #1 Definition 1.1 The cyclic code C ni ,q ,t of length n over F with generator polynomial g ( i ) ( x ) is called a generalized residue code for any i % {1,2,...., t } . If the group K in (1.9) is identical to a subgroup U n m , where m is the least value with this property, we shall alternatively speak of an m-residue code. 11 Definition 1.2 The even-like weight subcode of C ni ,q ,t , generated by (1 & x) g ( i ) ( x) and denoted by C ni,q ,t , is called the expurgated code, while Cni ,q ,t itself in this context is called the augmented code. Remarks From the definition of the group K as a subgroup of G with index t, it follows that the codes Cni ,q ,t are only defined for t! " ( n ) . In Definition 1.2 we use the term ‘even-like’, since only in the binary case the weights of the codewords are really even. In cases when it will not give rise to confusion, we shall occasionally omit the subindices n , q and t . m A special subclass of GR -codes arises when we choose K equal to a subgroup U n consisting of the m -powers or the m -residues in U n for some n-value. We shall call the resulting codes m -residue codes. Actually, they generalize similar codes introduced by Berlekamp in [1, Section 15.2] for the case that n is equal to some prime p . More precisely, for C ip ,q ,t the group K is the subgroup of t- powers in G :# U p , i.e. the subgroup usually called G t , of those elements r for which the equation x t # r mod p has at least one solution in G . Since in general m- powers are computed by reduction mod n, we shall from now on not distinguish between the terms m-powers and m-residues (cf. also [6, Section 4.2], where the term m-th power residue is used). We shall prove t now that in case of C ip ,q ,t , the identity K # U p holds. Theorem 1.1 If n is a prime, the group K as defined in (1.9) as a group of index t with respect to G, is cyclic and consists of the t-residues of G. Proof t Since ! G / K ! # t , we have for all cosets K i , 1 ! i ! t , that K i # K1 # K . Hence, g t % K for all g % G and so G t 3 K . Now, suppose U n is cyclic. So, there exists an element a with U n #2 a + . From ! U n ! = " ( n ) # rst , we conclude that the elements a t , t a 2t , …….., a rst are all different elements of G t . So, G t :# U n # K . It is well known that a group U p with p prime, is cyclic. This proves the above statement. " In particular, when taking n # p and t # 2 , we obtain the well-known quadratic residue codes or QR codes (cf. Section 5). 12 2. The group U n and its subgroups of m-residues In the proof of Theorem 1.1, we applied the property that U p is cyclic. For the sake of convenience and for future applications, we shall present and prove a few lemmas m containing a number of properties of the groups U n and their subgroups U n of m – residues. As for the proofs of those properties which are rather well-known, we shall refer to [6]. In such proofs one can exploit the homomorphism 8 : G 9 G m for an abelian group G. In this Report however, we shall not do so. Lemma 2.1 Let n be odd, and let A be the set of odd integers in U n and B the set of even integers. Then the following relations hold: (i)!A!=!B!, and the relations b # 2a , if 2a 2 n , and b # 2( n & a ) , if 2a + n , define a one-to-one mapping from A to B; (ii) ! U 2n !=! U n !, and U 2n # A - C , where C is a set of integers c in ( n, 2n) , defined by c # n ' 4a mod 2n , if 4a % (0, n) - (2n, 3n) , and by c # n & 4a mod 2n , if 4a % ( n, 2n) - (3n, 4n) . Proof (i) Obviously, the above mapping maps A into B. The mapping is onto, since it can be reversed for all b % B . (ii) Firstly, we remark that all elements of A, are also elements of U 2n . Next, we can easily verify that n 2 c 2 2n for all a % A . Moreover, since ( a, n) = 1, we also have that (c , n ) # 1 . Conversely, if c is odd and (c, n) # 1 , we can find an a % A with c # n ' 4a or c # n & 4a mod 2n , and such that 4a is in the corresponding subset of (0, 2n) . So, there are no other elements in U 2n than those which are in A - C . " Lemma 2.2 Let n be an odd integer. (i) the relation a 9 n & a defines a one-to-one mapping from the subset A of odd integers in U n to the subset B of even integers; (ii) the mapping from U 2n to U n defined by x 9 x , if x 2 n , and x 9 x & n , if x + n , is an isomorphism. (iii) if U n is a cyclic group, then so is U 2n , and vice versa; (iv) U p and U 2 p are both cyclic, for an odd prime p. 13 Proof (i) From ( n, a ) # 1 it follows that ( n, n & a ) # 1 . Moreover, since a is odd, n & a is even. The mapping is invertible, so it is one-to-one. (ii) We know already, by Lemma 2.1, that for x % U 2n and x 2 n , we also have x % U n and that x is odd. In the group U 2n products are taken mod 2n. It follows that equalities between elements of U 2n are also true when taken mod n, or stated equivalently, they hold as equalities in U n . Since the mapping is invertible, it is an isomorphism. (iii) This follows immediately from (ii). (iv) For a prime p, we have that U p is the multiplicative group of the field GF ( p ) , and " this group has generating elements. If n is not (twice) a prime, the question of U n being cyclic or not is somewhat more complex. Let us first consider a group U kn with ( k , n) # 1 . The elements of Z n are permuted among each other when we add a fixed integer to all these elements. The same holds when we multiply all elements by a fixed integer which is prime to n . Therefore, a set {r ' ki !0 ! i 2 n} contains " ( n ) integers prime to n, for any r. If we take r such that ( r , k ) # 1 , these integers are also prime to k. It follows easily that " (kn) # " ( k )" (n) or equivalently ! U kn !=! U k !! U n !, which is of course a well-known result. More in particular, we have U kn ; U k : U n which can be proved by showing that there is an isomorphic mapping between the groups at the lhs and at the rhs of this relation. Let U k # {a1 , a 2 ,......., a" ( k ) } and U n # {b1 , b2 ,......., b" ( n ) } . The system of congruences ci , j # ai mod k , ci , j # b j mod n , has a unique solution ci , j with 0 2 ci , j 2 kn , for any pair of relevant indices i, j , according to the Chinese Remainder Theorem. It easily follows that the group U kn # {ci , j ! 0 2 i 2 " ( k ) , 0 2 j 2 " ( n)} is isomorphically mapped on U k : U n by the mapping ci , j 9 ai b j . Extending and generalizing the above arguments gives rise to the following properties. Lemma 2.3 $ $ $ (i) If n # 2 1 p2 2 ....... pl l , then U n ; U 2$1 : U p$2 ........ : U p$l ; 2 l (ii) U 2a ; C2 : C2a&2 , for a + 2 ; (iii) U n is cyclic if and only if n equals 2, 4, p a or 2 p a , for any odd prime p; (iv) Let g be a generator of U p with p odd, then at least one of the integers g and g + p is a generator of U p$ and g is also a generator of U 2 p$ when g is odd, whereas g + p is a generator of U 2 p$ when p is even; 14 (v) In U 2a the integer 5 generates the subgroup C2a&2 . The details of the proofs can be found in [6, Section 4]. Since subgroups of a cyclic group are cyclic as well, and by applying Lemma 2.3 (iii), we now have the following generalization of Theorem 1.1. Theorem 2.1 If n is equal to 2, 4, p$ or 2 p$ ,with p an odd prime, the group K of (1.9) with index t with respect to G, is identical to the group G t of t-powers of G. Example 2.1 One can easily verify the various properties of Lemmas 2.1 – 2.3 for n # 9 . Then we have U 9 # {1, 2, 4,5, 7,8} and U18 # {1,5, 7,11,13,17} . A generator of U 9 is 2, since its first six powers are 1, 2, 4, 8, 7, 5. The corresponding generator of U18 is 11 (= 2+9) (cf. Lemma 2.3 (iv)), the first six powers of which are 1, 11, 13, 17, 7, 5. Another example is n # 16 , with U16 # {1,3,5, 7,9,11,13,15} . Indeed, one can immediately verify that U16 # C2 : C4 , where C4 # {1,3,9,11} is a cyclic group of order 4, and " C2 # {1, 7} . Example 2.2 Take n # 13 and q # 3 . Since 13 is a prime, U 13 # {1,2,......,12} is a cyclic group. Furthermore, we have mod 13, that 31 # 3 , 32 # 9 and 33 # 1, and so r # ord 13 (3) # 3 , H # {1,3,9} and st # " (13) / 3 # 4 . We choose K :# H , which implies s # 1 and t # 4 . 4 It appears that the values of g 4 , g % U 13 , are 1, 3, and 9. So, we have indeed K # U 13 . Next, we extend K by adding the elements of K3 , so now K :# {1, 3, 4,9,10,12} , implying s # 2 , t # 2 . Determining the squares of all elements of U 13 shows that K # U 13 2 . Similarly, we take q # 5 , which subsequently gives r # ord 13 (5) = 4, H # {1,5,8,12} . 3 Choosing K :# H , and so s # 1, t # 3 . Again, one can easily verify that K # U 13 . " t In the next example it is shown, that when U n is not cyclic, the inclusion U n 3 K is not necessarily an equality. Example 2.3 Take n # 12 and q # 5 . It follows that r = ord 12 (5) = 2 and H # {1,5} . The group U 12 # {1,5,7,11} # C2 : C2 , which is not a cyclic group. Is is immediately clear that 15 st # " (12 ) / 2 # 2 . Choosing K # H implies s # 1 and t # 2 . Determining the squares of 2 the elements of U 12 shows that U 12 # {1} < K . Similar results are obtained for q # 7 and q # 11 . " Example 2.4 A larger example is obtained by taking n # 45 . The group U 45 contains the integers {1,2,4,7,8,11,13,14,16,17,19,22, &1, &2, &4, &7, &8, &11, &13, &14, &16, &17, &19, &22 }. So, ! U 45 != 24. From Lemma 1.5 it follows that G :# U 45 ; U 9 : U 5 ; C6 : C4 , and that G is not cyclic. Take furthermore q # 8 , which yields H # {1,8,17,19} and r # 4 , so st # 6 . Choosing K :# H gives t # 6 and s # 1 . Now, G 6 # {1,19} , which is a proper subgroup of K . So, in this case K contains more elements than just the 6-residues. However, if we choose K :# {1,8,17,19, &1, &8, &17, &19} , we have t # 3 . Now we find G 3 # K , or K is precisely the group of 3-residues. " Remark The last case in Example 2.4 shows that a group K , as defined in 1.6, can be identical to G t even when U n is not cyclic. The question when an integer a is an m-residue can in general be answered in a satisfactory way by the following lemma. In this lemma the notion of primitive root is used. An integer a with ( a, n) = 1 is said to be a primitive root mod n, if " ( n ) is the smallest positive integer such that a" ( n ) = 1 mod n. One also says that a is a primitive root of n. Lemma 2.4 Let n # 2$1 p2$ 2 ....... pl$l , and let a be some integer with ( a, n) # 1 . (i) if n possesses primitive roots, then a is an m- residue mod n, if and only if a" ( n ) / d # 1 mod n, where d # ( m, " ( n)) , and if a is an m - residue, then x m # a mod n has exactly ( m, " ( n)) solutions; (ii) the integer a is an m- residue if and only if the system of congruences x m # a mod 2$1 , x m # a mod p2$ 2 , ….., x m # a mod pl$l has at least one solution; (iii) if a is odd, and $1 7 3 , then x m # a mod 2$1 has precisely one solution for m odd, whereas for m is even, there are precisely 2d solutions with d # (m, 2$1 & 2 ) if a # 1 mod 4, $1& 2 a2 /d = 1 mod 2$1 , and there are no solutions otherwise. For proofs, we refer to [6, Section 4]. As a consequence of the previous results, we can prove the following property for the subgroup U n m consisting of the m-powers of the elements of U n . 16 Theorem 2.2 (i) Let n # 2$1 p2$ 2 ...... pl$l , and let m be some positive integer. Then the order of the group U n m is equal to " ( n) /( m, " (2$1 ))( m, " ( p2$ 2 )).....(m, " ( pl$l )) , except when $1 7 3 and m is even. (ii) If $1 7 3 and m is even, this order equals " ( n) / 2( m, 2$1 &2 )( m, " ( p2$ 2 )).......( m, " ( pl$ l )) . Proof (i) We first prove part (i) of the Lemma for the case that n is a prime power n # p$ , where $ ! 2 if p # 2 . From Lemma 2.3 (iii) and Lemma 2.4 (i) we know that in this case U n is cyclic and that if a is an m-residue mod n, there are exactly ( m, " ( n)) elements x % U n which satisfy x m # a mod n. Hence , ! U n m != " ( n) /( m, " ( n)) . Next, we assume for the sake of convenience that n is the product of two prime powers, say n # p1$1 p2$ 2 with $1 ! 2 if p1 # 2 . We know that U n ; U p$1 : U p$2 . It follows that U n m is isomorphic to the direct 1 2 m product of the subgroups U p$1 and U p$2 m . According to the first part of the proof these 1 $1 2 $1 subgroups have order " ( p1 ) /( m, " ( p1 )) and " ( p2$ 2 ) /( m, " ( p2$ 2 )) , respectively. Since ( p1 , p2 ) # 1 , we have that " ( p1$1 )" ( p2$ 2 ) # " (n) , and so ! U n m != " (n) /( m, " ( p1$ ))( m, " ( p2$ )) . (ii) In the case that $ 1 7 3 and t even, we apply the second part of Lemma 2.4 (iii). Now, ! U 2$1 m != " (2 $ ) / 2d , with d # (m, 2$ & 2 ) , and the result for ! U n m ! follows immediately. 1 2 1 1 " Example 2.5 Take n # 36 . We have that U 36 # {1,5,7,11,13,17,&1,&5,&7,&11,&13,&17} and 3 U 36 # {1,17,&1,&17} # {1,19,&1,&19} . Since " (36) # 12 , " ( 4) # 2 and " (9) # 6 , 3 Theorem 2.1 (i) yields ! U 36 != 12 /(3,2)(3,6) # 4 , which is correct. A similar calculation for n # 24 gives respectively U 24 # {1,5,7,11,13,17,19,23} , 2 2 U 24 # {1} and, by applying Theorem 2.1 (ii), ! U 24 != " ( 24) / 2( 2,2)( 2,2) # 8/2.2.2 = 1. 17 " Corollary 2.1 Let I n , m :# ! U n / U n m ! be the index of the group U n m with respect to U n . (i) For n # p$ for some odd prime p and for n # 2 p$ , one has that if m ! p$ &1 ( p & 1) , then I n , m # m . (ii) For n # 2$ , one has that if m # 25 , 5 ! $ , then I n , m # 2m for 5 2 $ & 1 , I n , m # m for 5 # $ & 1 and I n ,m # m / 2 for 5 # $ . Proof (i) Since " ( p$ ) # p$ &1 ( p & 1) for any prime p, it follows from Theorem 2.2 that I n,m # (m, " ( p$ )) # (m, p$ &1 ( p & 1)) # m . (ii) Now we apply " (2$ ) # 2$ &1 . The result for $ + 2 is obtained from Theorem 2.2 (ii) and for $ ! 2 from Theorem 2.2 (i). " It will be obvious that Corollary 2.1 is equivalent to Theorem 2.1. 3. Some simple properties of generalized residue codes Let ) be a primitive n-th root of unity lying in some extension field of F # GF ( q ) . Let R be a subset of Z n which is closed under multiplication by q, and let j be some integer coprime with n. Furthermore, we introduce polynomials g ( x ) # * ( x & ) l ) and l%R jl l gˆ ( x ) # * ( x & ) ) = * ( x & ) ) , for which we can easily prove the following property l%R l% jR (cf. also [1, Theorem 5.81]). Lemma 3.1 n &1 Let c( x ) # 0 cl x l be a polynomial with coefficients in F and degree less than n, and let l #0 n &1 cˆ ( x ) # 0 cˆl x l , where cˆ s # cl with l # sj mod n, and (j, n) = 1. Then g ( x ) divides c( x ) if l #0 and only if gˆ ( x ) divides cˆ ( x ) . Proof Let j ' be the inverse of j in G , i.e. jj ' # 1 mod n. Then we have the following series of equivalencies: g ( x ) ! c( x ) = c() l ) = 0, >l % R 18 = c() jj 'l ) # 0, >l % R = c() j 'l ) # 0, >l % jR = cˆ () l ) # 0, >l % jR = gˆ ( x ) ! cˆ ( x ) $ Now, a polynomial c( x ) is in the code C nj,q ,t , if and only if g ( j ) ( x ) ! c( x ) . Since g ( j ) ( x ) # * ( x & ) l ) = * ( x & ) jl ) , it follows from the definition prior to l%K l% jK Lemma 2.2 that g ( j ) ( x ) # gˆ (1) ( x ) , by taking R :# K and y j :# j (cf. (1.12)). The next theorem is an immediate consequence of that lemma. Theorem 3.1 The codes C ni ,q ,t , 1 ! i ! t ,all have dimension n & " ( n ) / t . Moreover, they are equivalent, and hence they have the same minimum distance. Proof The monic polynomial g ( i ) ( x ) is the product of s different irreducible polynomials over F (cf. (1.14)). Therefore, it is the unique generator of minimal degree of the code ( g ( i ) ( x )) . Hence, the dimension of this code is n & rs # n & " ( n ) / t . $ Let c ( i ) ( x ) % ( g ( i ) ( x )) be a polynomial with nonzero weight d , for every i with 1 ! i ! t . These polynomials have the following properties (cf. also [1, Section 15.2]). Theorem 3.2 t (i) * c (i ) ( x) # 0 mod 1 n (x) ; i #1 t n &1 i #1 i #0 (ii) P( x )* c ( i ) ( x ) # r ( x )0 x i for some r ( x ) % F ( x ) , where r (1) , 0 , if c (i ) (1) , 0 for all i , 1 ! i ! t , and r (1) # 0 otherwise; t (iii) P( x )* c ( i ) ( x ) # r (1)n mod x & 1 ; i #1 t n &1 i #1 i #0 (iv) P( x )* c (i ) ( x ) # r (1)n0 x i mod x n & 1 . Proof 19 (i) For each i the polynomial c ( i ) ( x ) is a multiple of g ( i ) ( x ) . The equality now follows immediately from (1.15). (ii) Multiplying the equality in (i) by P( x ) (cf. eq. (1.2)), we obtain t P( x )* c ( i ) ( x ) # 0 mod i #1 n &1 0 xi , i #0 or equivalently, t n &1 i #1 i #0 P( x )* c ( i ) ( x ) # r ( x )0 x i , with r ( x ) % F [ x] . From eq. (1.2) we have P(1)1 n (1) # n , hence P(1) , 0 . If we assume that c (i ) (1) , 0 for all i , then r (1) , 0 , whereas r (1) # 0 when c (i ) (1) # 0 for at least one i - value. (iii) This relation follows by dividing lhs and rhs of the equality in (ii) by x & 1 . t (iv) From (ii) it follows that P( x )* c ( i ) ( x ) # 0 mod i #1 n &1 0 x i . We combine this i #0 n &1 congruence with the one in (iii). We can easily verify that 0 x i = r(1) mod x &1. i #0 t According to the Chinese remainder theorem we now may conclude that P( x )* c ( i ) ( x ) i #1 n &1 = r (1)n0 x i mod x n & 1 . " i #0 Theorem 3.3 For any set of fixed values for n , q and t , the following relations hold: t (i) " C ni ,q ,t # (1 n ( x)) ; i #1 t (ii) for t 7 2 , one has 0C i n , q ,t # Rn . i #1 Proof t t i #1 t i #1 (i) Let c( x ) % " C ni ,q ,t . Then we can write c( x ) # a( x )* g ( i ) ( x ) = a( x ) 1 n (x ) by (1.15). Hence, " C ni ,q ,t < (1 n ( x)) . Equality follows by reversing the above argument. i #1 (ii) First we observe that dim (C i ' C j ) = dim C i + dim C j & dim C i . C j = ( n & rs ) ' ( n & rs ) & ( n & 2rs ) # n So, C i ' C j # R n for all i, j % {1, 2,...., t} and i , j . This implies statement (ii). " 20 Example 3.1 Take n # 13 and q # 3 . So, G = U 13 # {1,2,.........,12} . In Example 2.2 we already derived r # 3 and H # {1,3,9} . Furthermore, " (13) # 12 and so $ # 4 . The binomial x13 & 1 has the following decomposition in GF (3)[ x ] x13 & 1 # ( x & 1)113 ( x ) # ( x & 1)( x12 ' x11 ' ......... ' 1) = ( x & 1)( x 3 & x & 1)( x 3 ' x 2 & 1)( x3 ' x 2 ' x & 1)( x3 & x 2 & x & 1) . The last four factors are irreducible polynomials over GF (3) and can be identified with polynomials, Fi (x ) , i % {1,2,3,4} (cf. (1.4)). Next, we take K # H , and thus t # !G/K! = 4. Consequently we can write G # K1 - K 2 - K 3 - K 4 , K1 # {1,3,9} , K 2 # {2,5,6} , K 3 # { 4,10,12} , K 4 # {7,8,11} . Since n = 13 is a prime we have according to Theorem 1.1 or Theorem 2.1 that K is identical to U134 , as one can easily verify. Let ) be a primitive 13-th root of unity in some extension field of GF (3) . Then we define (cf. (1.14)) g (1) ( x ) # * ( x & ) l ) # ( x & ) )( x & ) 3 )( x & ) 9 ) l%K1 = x 3 & () ' ) 3 ' ) 9 ) x 2 ' () 4 ' ) 10 ' ) 12 ) x & 1 . Now, we put 4 :# ) ' ) 3 ' ) 9 for which we immediately can see that 4 3 # 4 , and so 4 % {0,1,&1} . Of course this is clear from the beginning, since the coefficients of g ( i ) ( x ) are elements of GF (3). In order to determine the values of the coefficients in g (1) ( x ) , we assume that ) is defined as a zero of the irreducible polynomial x 3 & x & 1 which has exponent 13. By straightforward calculation we get ) 3 # ) ' 1 , ) 4 # ) 2 ' ) , ) 9 # ) & 1, ) 10 # ) 2 & ) , ) 12 # ) 2 & 1 , ) ' ) 3 ' ) 9 # 0 , ) 4 ' ) 10 ' ) 12 # &1 , and hence g (1) ( x ) # x 3 & x & 1 . In a completely similar way we find g ( 2 ) ( x ) # x 3 ' x 2 ' x & 1 , g ( 3) ( x ) # x 3 ' x 2 & 1 and g ( 4 ) ( x ) # x 3 & x 2 & x & 1 . The four codes generated by these polynomials are ternary 4-residue codes according to Definition 1.1. 21 4. Minimum distances in generalized residue codes An immediate consequence of Theorem 3.2 (iv) is the following result which provides us with a lower bound for the minimum distance d of codewords c( x ) of a GR- code which have the property x & 1 % c( x ) . In the next we consider polynomials c ( i ) ( x ) % C ni ,q ,t of weight d (not necessarily the minimum weight), and such that c (i ) (1) , 0 so that we can apply Theorem 3.2. Theorem 4.1 Let d be the weight of a polynomial c ( i ) ( x ) % C ni ,q ,t , and such that c (i ) (1) , 0 . If d P is the weight of the polynomial P( x ) , then d P d t 7 n . Proof Take c (1) ( x ) % C 1 of weight d and with c (1) (1) , 0 . By suitable permutations of its coefficients, using the construction in the proof of Lemma 3.1, we can transform this polynomial into polynomials c ( 2 ) ( x ),......, c ( t ) ( x ) all of weight d and which also satisfy t (i ) c (1) , 0 , 2 ! i ! t . As a consequence of Theorem 3.2 (iv), the product * c (i ) ( x) is a i #1 nonzero multiple of x n &1 'x n&2 ' ......... ' 1 . Since this polynomial has weight n and t since * c (i ) ( x) has at most d t nonzero coefficients, the inequality now follows. " i #1 The above theorem can be considered as a generalization of a well-known result for t # 2 , i.e. for QR- codes and also for GQR-codes and other generalizations. See also [1,12,13] and [9, Theorem 6.9.2]. In case that & 1 is not an element in K , we can even derive a stronger result. Theorem 4.2 Let d be the weight of a polynomial c ( i ) ( x ) % C ni ,q ,t with c (i ) (1) , 0 . If & 1 ? K , then d P ( d 2 & d ' 1) t / 2 7 n . Proof If &1 ? K , then & 1 belongs to a coset different from K1 ( # K ) . We shall denote this coset by K &1 . Let a % G be neither in K1 nor in K &1 , so a defines a coset K a different from K1 and K &1 . If & a % K a , then & a # ak for some k % K , and hence k # &1 which is false. So, K a and K &a := & aK are two cosets different from K1 and K &1 . Continuing 22 in a similar way shows that G / K consists of pairs of cosets K i and K &i for t / 2 different values i . It also follows that K &i # & K i . In the next we shall use the labeling K 1 , K &1 , K 2 , K & 2 ,........, K t / 2 , K &t / 2 for the cosets of K . The corresponding polynomials (1.14) are denoted by g (1) ( x) , g ( &1) ( x) , g ( 2) ( x) , g ( &2 ) ( x ) , ........., g ( t / 2 ) ( x) , g ( &t / 2) ( x) . Take some fixed value i . We can write i 0m g ( i ) ( x ) # * ( x & ) l ) # * ( x & ) im ) # x rs * (1 & ) im x &1 ) # ( & x ) rs ) m%K * ( x &1 & ) &im ) l%K i m%K m%K = b ( & x ) rs g ( &i ) ( x &1 ) , with b # ( &1) rs ) i 0m m%K m%K . Since the coefficients of the polynomials g ( i ) ( x ) are elements of F , b must be an element of F as well. We can also prove this straightforwardly by making use of the invariance of K under multiplication by q . In particular we can write r &1 r &1 j #0 j #0 q 0 m # q( x1 ' x 2 ' ..... ' x s )0 q j # ( x1 ' x 2 ' .... x s )0 q j # m%K Hence, () 0 i 0m m%K )q # ) i 0m m%K and consequently ) i 0m m%K 0m. m%K % F . Comparing the coefficients of x in g ( x) and g ( x) gives immediately that b = g ( i ) ( 0) . Next, we consider c (i ) ( x) # a i ( x ) g ( i ) ( x ) , being a polynomial or codeword of C i of (i ) ( &i ) weight d and of degree e . Then c ( & i ) ( x ) # x e c ( i ) (1 / x ) # a &i ( x ) g ( & i ) ( x ) , with a &i ( x ) :# x e ai ( x &1 ) , is a codeword of C &i with the same weight d . The polynomial c ( i ) ( x)c ( &i ) ( x) stands for a codeword in the intersection code C i . C & i , which cannot be the zeroword, since it is not divisible by x & 1 . So, it has a positive weight which is at most d 2 & d ' 1 . We can do this for all values of i , 1 ! i ! t / 2 , since all codes C i are equivalent according to Theorem 3.1, and so they all have a codeword of weight d . More t/2 t/2 generally, the polynomial * c (i ) ( x)c ( &i ) ( x) is in the intersection code i #1 2 has weight at most ( d & d ' 1) t/2 "C i . C &i and i #1 . The inequality now follows from Theorem 3.2 (iv). " Theorem 4.2 can be seen as a generalization of a result of Mattson and Solomon for quadratic residue codes. See also refs. [1,9,12,13]. From Theorems 4.1 and 4.2 it appears that for determining the minimum distance of a GR- code, it is essential to distinguish between codewords c ( i ) ( x ) with c (i ) (1) , 0 and codewords with c ( i ) (1) = 0. To this end, we introduced in Definition1.2 the subcode i C n ,q ,t 3 C ni ,q ,t , generated by the polynomial ( x & 1) g ( i ) ( x ) , 1 ! i ! t , which is called the expurgated code, whereas C ni ,q ,t itself is called the augmented code (cf. [1, Section 15.2]. 23 Corrollary 4.1 If the minimum distance d of the generalized residue code C ni ,q ,t is odd, then it satisfies (i) d P d t 7 n ; (ii) d P ( d 2 & d ' 1) t / 2 7 n , if &1 ? K . It will be clear that Theorems 4.1 and 4.2 are generalizations of the lower bounds for the minimum weights of words which are in an augmented quadratic residue code, but not in the expurgated one (cf. e.g. [1,9,10,12]), which are obtained by taking t # 2 . Furthermore, since GR-codes are cyclic, we always can find polynomials c ( i ) ( x ) , such that c (i ) ( 0) , 0 for all i By exploiting this fact, we might slightly improve the bounds of Theorems 4.1 and 4.2 in the future. Remark In the proof of Theorem 4.2 we showed that a polynomial g ( i ) ( x ) is equal to the reciprocal polynomial of g ( &i ) ( x ) , when & 1 is not an element of the group K . In the case that & 1 is an element of K , there exists equality between a polynomial g ( i ) ( x ) and its own reciprocal bx rs g ( i ) ( x &1 ) . This can be shown by similar arguments. We conclude that the polynomials g ( i ) ( x ) , & t / 2 ! i ! t / 2 , are (anti-)symmetric with respect to the values of their coefficients, i.e. g ( i ) ( x ) # bx rs g ( i ) ( x &1 ) , b # g ( i ) ( 0) . Example 4.1 Take n # 7 and q # 11 . Then G # U 7 # {1,2,3,4,5,6} . One easily verifies that r = ord 7 (11) = 3 and H # {1,2,4}. Hence, since " ( 7 ) # 6 , we have $ # 2 . The only possible subgroup K of G with H ! K ! G , is K # H # U 7 2 , which implies that the resulting codes are 2-residue codes. So, K1 # {1,2,4} and K 2 # {3,5,6} . Let ) be a primitive 7th root of unity in some extension field of GF (11) . From definition (1.14) we have g (1) ( x ) # ( x & ) )( x & ) 2 )( x & ) 4 ) # x 3 & () ' ) 2 ' ) 4 ) x 2 ' () 3 ' ) 5 ' ) 6 ) x & 1 , g ( 2 ) ( x ) # ( x & ) 3 )( x & ) 5 )( x & ) 6 ) # x 3 & () 3 ' ) 5 ' ) 6 ) x 2 ' () ' ) 2 ' ) 4 ) x & 1 . In order to determine the coefficients more closely, as elements of GF (11) , we put 4 :# ) ' ) 2 ' ) 4 . Then it follows that ) 3 ' ) 5 ' ) 6 # 6(4 2 & 4 ) . It turns out that 4 satisfies the equality 4 3 & 4 2 & 4 # 0 . Now, the equation x 3 & x 2 & 4 # 0 has three 24 solutions in GF (11) , i.e. 2, 4 and 6. If we put 4 # 2 , we obtain the polynomial x 3 & 2 x 2 ' x & 1 which is reducible in GF (11)[ x ] , since it factorizes as ( x & 3)( x 2 ' x ' 4) . Putting 4 # 4 or 4 # 6 gives rise to the irreducible polynomials g (1) ( x ) # x 3 & 4 x 2 ' 6 x & 1 and g ( 2 ) ( x ) # x 3 & 6 x 2 ' 4 x & 1 . Indeed g (1) ( x ) # ( &1) x 3 g ( 2 ) ( x &1 ) , thus illustrating the equality in the proof of Theorem 4.2. Notice that & 1( # 6) ? K . " Example 4.2 Next, we take n # 5 and q # 19 . Since 19 2 = 1 mod 5 we have r # 2 . Furthermore, G # U 5 # {1,2,3,4} and " (5) # 4 , and hence $ # 2 . The subgroup H = {1, 4} of G has index 2, and therefore we take K # H # U 5 2 . The polynomials corresponding to K1 # {1,4} and K 2 # {2,3} are respectively g (1) ( x ) # ( x & ) )( x & ) 4 ) = x 2 & () ' ) 4 ) x ' 1 , g ( 2 ) ( x ) # ( x & ) 2 )( x & ) 3 ) # x 2 & () 2 ' ) 3 ) x ' 1 , where ) is a primitive 5th root in some extension field of GF (19) . The coefficient 4 :# ) ' ) 4 satisfies the equality 4 3 & 24 ' 1 # 0 . The equation x 3 & 2 x ' 1 # 0 has three roots in GF (19) , i.e. 1, 4 and 14. Putting 4 # 1 provides us with the reducible polynomial x 2 & x ' 1 = ( x & 8)( x ' 7 ) . Putting 4 # 4 or 4 # 14 gives rise to the irreducible polynomials g (1) ( x ) # x 2 & 4 x ' 1 and g ( 2 ) ( x ) # x 2 ' 5 x ' 1 In this case we have g (1) ( x ) # x 2 g (1) ( x &1 ) and also g ( 2 ) ( x ) # x 2 g ( 2 ) ( x ) , illustrating the " remark right after Theorem 4.2. Notice that now & 1( # 4) % K . Example 4.3 In Example 3.1 we derived for the case n # 13 and q # 3 the polynomials g (1) ( x ) # x 3 & x & 1 and g ( 3) ( x ) # x 3 ' x 2 & 1 . As one can verify we have here that g (1) ( x ) # ( &1) x 3 g ( 3) ( x &1 ) . Since & 1 # 12 % K 3 , this illustrates the proof of Theorem 4.2. Similarly, we have for g ( 2 ) ( x ) # x 3 ' x 2 ' x & 1 and g ( 4 ) ( x ) # x 3 & x 2 & x & 1 the relation g ( 2 ) ( x ) # ( &1) x 3 g ( 4 ) ( x &1 ) . All four 4-residue codes have the same minimum distance d , which satisfies the inequality d P ( d 2 & d ' 1) 2 7 13 according to Theorem 4.1. Since P( x ) is a constant in this case, it follows that ( d 2 & d ' 1) 2 7 13 implying d 7 3 . Since their generating 25 1 3 polynomials g (1) ( x ) and g ( 3) ( x ) have weight 3, the codes C 13 ,3, 4 and C13,3, 4 clearly have minimum distance 3 which shows that this underbound is sharp. As a consequence, C132 ,3, 4 and C134 ,3, 4 also have minimum distance 3. In order to illustrate this by constructing generating polynomials of weight 3, we apply Lemma 3.1 and the construction used in its proof. Let c( x ) :# g (1) ( x ) # x 3 & x & 1 % C 1 , and take j # 2 . Then the inverse j' mod 13 is equal to 7. From c3 # 1 , c1 # &1 , c0 # &1 it follows cÌ‚8 # 1 , cÌ‚7 # &1 , cÌ‚0 # &1 , respectively, while all other coefficients of cˆ ( x ) are equal to 0. Hence, cˆ ( x ) # x 8 & x 7 & 1 . According to Lemma 3.1 this polynomial of weight 3 generates the code C 2 (remember that 2 % K 2 ). That this polynomial indeed represents an element of C 2 :# ( g ( 2 ) ( x )) = ( x 3 ' x 2 ' x & 1) is demonstrated by the factorization x 8 & x 7 & 1 = ( x 5 ' x 4 ' x 3 & x 2 ' x ' 1)( x 3 ' x 2 ' x & 1) . In a similar way, by taking j # 7 ( % K 4 ) , and hence j' # 2 , we find that the polynomial x 6 & x 2 & 1 is a generator of C 4 . One can also verify that x 6 & x 2 & 1 # ( x 3 ' x 2 & x ' 1)( x 3 & x 2 & x & 1) . For the sake of completeness we also consider the case j # 4 ( % K 3 ) , j' # 10 , giving rise to cˆ ( x ) # & x10 ' x 4 & 1 = & ( x 7 & x 6 ' x 5 & x 3 & x 2 & 1)( x 3 ' x 2 & 1) , which is a generator of weight 3 of C 3 , different from g ( 3) ( x ) . If we take j # 3(% K1 ) , j' # 9 , the result is cˆ ( x ) # & x 9 ' x & 1 = & ( x 6 ' x 4 ' x 3 ' x 2 & x & 1) ( x 3 & x & 1) , which is another generator of weight 3 of C 1 . " Remark We know from eq. (1.14) and Theorem 3.1 that the generalized residue codes C ni ,q .t , 1 ! i ! t , have generator polynomials g ( i ) ( x ) which are all of the same minimal degree rs . Example 4.3 shows that these generators are not necessarily of the same (minimal) weight. By applying the construction as used in the proof of Lemma 3.1, we will always be able to transform these polynomials into generators of the same (minimal) weight, but not necessarily of the same degree. $ $ $ Next, we consider again the general case n # p1 1 p 2 2 ....... pl l , and we introduce the integer m # p1 p 2 ...... pl . Let u be the multiplicative order of the prime q modulo m , i.e. u is the least positive integer such that q u # 1 mod m . Then we have over the field F # GF ( q ) 1 m ( x ) # f1 ( x ) f 2 ( x )........ f @ ( x ) , (4.1) with " ( m) # u@ , and where the polynomials f i (x ) , 1 ! i ! @ , are all of degree u , and are irreducible over F (cf. eqs. (1.1), (1.3) and (1.4)). 26 Lemma 4.1 The polynomial f i ( x n / m ) , 1 ! i ! @ , is irreducible over F if and only if r # un / m . Proof By the equality 1 n ( x ) # 1 m ( x n / m ) , and by eqs. (1.4) and (2.1), it follows that F1 ( x ) F2 ( x).......F$ ( x ) # f1 ( x n / m ) f 2 ( x n / m )........ f @ ( x n / m ) . Because of the uniqueness of the canonical factorization of 1 n (x ) , the polynomials f i ( x n / m ) are irreducible if and only if $ # @ . Since all these polynomials are of degree un / m , and since the polynomials Fi (x ) are all of degree r , the Lemma now follows $ immediately. Suppose the equality r # un / m holds. Then we also have $ # @ . Therefore, if there exists a GR- code with length m , there also exists a GR- residue code with length n . Notice that this equality does not always hold. For example for q = 3, n # 8 = 2 3 and hence m # 2 , we find respectively 1 8 ( x ) # 1 2 ( x 4 ) # x 4 ' 1 , " (8) # 4 , r # 2 (since 3 2 # 1 mod 8) and u # 1 (since 31 # 1 mod 2). Hence, un / m # 1.8 / 2 # 4 , r . Now, eq.(4.1) gives 1 2 ( x) # x ' 1 , and so @ # 1 , $ # 1 and f1 ( x) # x ' 1 . Indeed, the polynomial f1 ( x 4 ) # x 4 ' 1 # ( x 2 ' x ' 1)( x 2 & x ' 1) is not irreducible in GF (3)[ x] . A similar example will be given in Example 4.4. Theorem 4.3 If r # un / m , where r , u , n and m are as defined above, then the minimum weight of a generalized residue code with length n is upperbounded by the minimum weight of a generalized residue code of length m . The same holds if only words of odd weight are considered in both codes. Proof According to Lemma 4.1 we can identify Fi ( x ) # f i ( x n / m ) . If the polynomials p ( i ) ( x) , 1 ! i ! t , are the generator polynomials of the GR-codes of length m , then g ( i ) ( x) # p (i ) ( x n / m ) are the generating polynomials of the GR- codes of length n . Therefore, if the polynomial c( x ) % F [ x] of degree ! m & 1 satisfies c( x ) # 0 mod p ( i ) ( x) , then c( x n / m ) # 0 mod g ( i ) ( x ) . Let d be the minimum weight in the code of length n . Assume that there is a codeword c (x ) in the code of length m with weight w 2 d . Then c( x n / m ) is a codeword in the code of length n . Since this codeword also has weight w , we have a contradiction. This proves the first statement. The second 27 statement follows from the fact that for x # 1 , the polynomials c (x ) and c( x n / m ) have the same value. # Example 4.4 Let n # 16 and q # 3 . Since 3 4 # 1 mod 16, it follows easily that r # ord 16 (3) = 4. For the cyclotomic polynomial 116 we find in GF (3)[ x ] the factorization into irreducible polynomials over GF (3) 116 ( x ) # 1 2 ( x 8 ) # x 8 ' 1 # ( x 4 & x 2 & 1)( x 4 ' x 2 & 1) . From r # 4 and " (16 ) # 8 , it follows that $ # 2 which is in accordance with the above factorization. Furthermore, we find G # {1,3,5,7,9,11,13,15} and H # {1,3,9,11} . Hence, we can only take K :# H as a proper subgroup of G . So, t # ! G / H !=2, s # 1, and G # H 1 - H 2 # H - 5H . According to definition (1.14), the generating polynomials g (1) ( x ) and g ( 2 ) ( x ) are equal to * ( x & ) i ) and * ( x & ) i ) , respectively, i%H i%5 H where ) is a primitive 16th root of unity in some extension field of GF (3) . One can verify that g (1) ( x ) # ( x & ) )( x & ) 3 )( x & ) 9 ( x & ) 11 ) equals either x 4 & x 2 & 1 or x 4 ' x 2 & 1 , depending on the choice of ) . To this end one has to notice that ) 8 # &1 , and that the coefficient of x 2 in the rhs is equal to 4 # 2() 4 ' ) 12 ) ' ) 10 ' ) 14 = & () 2 ' ) 6 ) , while 4 satisfies 4 2 # 1 . Furthermore, we have 1 2 (x) = x ' 1 which gives u # 1 . We cannot apply Theorem 4.3, " since n # 16 , r # 4 , m # 2 , and u # 1 do not meet the condition of that theorem. Example 4.5 Take n # 12 and q # 7 . Then G # U 12 # {1,5,7,11} and H # {1,7} . The cyclotomic polynomial for n # 12 equals 1 12 ( x ) # x 4 & x 2 ' 1 . Since 7 2 # 1 mod 12, we have r # 2 and $ # " (12 ) / r # 4 / 2 # 2 . We choose K :# H and so t # 2 . For the generating functions of the quadratic residue codes we find in this case g (1) ( x ) # ( x & ) )( x & ) 7 ) and g ( 2 ) ( x ) # ( x & ) 5 )( x & ) 11 ) , where ) is a primitive 12th root of unity in some extension field of GF ( 7 ) . By similar arguments as applied in previous examples we find g (1) ( x ) # x 2 ' 2 and g ( 2 ) ( x ) # x 2 ' 4 . Since &1 ? K , we can apply Theorem 4.2. Therefore, we compute P( x ) # x12 & 1 /( x & 1)1 12 ( x ) # x 7 ' x 6 ' 2 x 5 ' 2 x 4 ' 2 x 3 ' 2 x 2 ' x ' 1 . 28 So, d P # 8 , 8( d 2 & d ' 1) 7 12 , and hence we obtain the trivial result d 7 2 , where d is the weight of a codeword c ( x ) with c (1) , 0 . Next, we shall try to derive an upperbound for d , using Theorem 4.3. Since n # 12 # 2 2 3 , we consider m # 2.3 = 6. The order of 7 mod 6 is equal to u # 1 , and therefore un / m # 2 # r and so the condition of Theorem 4.3 is satisfied. The cyclotomic polynomial for m # 6 is equal to 1 6 ( x ) # x 2 & x ' 1 # ( x ' 2)( x ' 4) # f1 ( x ) f 2 ( x ) (cf. Example 1.1). The minimum weight of the code of length 6, generated by f1 ( x) ( f 2 ( x)) has weight 2, since f1 ( x) ( f 2 ( x)) itself is a codeword. The codes generated by g (1) ( x) # f1 ( x 2 ) and g ( 2 ) ( x) # f 2 ( x 2 ) obviously have minimum weight 2. Since 2 ! 2 , Theorem 4.3 is trivially true in this case. " 5. The special case n # p In Theorem 1.1 and in Theorem 2.1 it was stated for n-values 2, 4, p$ and 2 p$ with p an odd prime, that if a group K, as defined in (1.9), has index t with respect to G :# U n , then K is identical to the group U n t of t-residues, or stated equivalently I n ,t # t . (5.1) So, for these n-values the GR-codes belong to the subclass of t-residue codes, for all t which divide " (n ) (cf. the Introduction). In this section and in the next two sections we shall investigate these cases somewhat closer. As a first special case of the general theory, we put n equal to a single prime, i.e. n # p , which means that the codes are of prime length p . For t # 2 , we will get the classical quadratic residue codes (QR-codes). First, we take for q a prime (power) different from p . Actually, we can take for q any prime (power) which is in U p . In this case we have G # U p # {1,2,.........., p & 1} , (5.2) ! G ! = " ( p) # p & 1 , (5.3) 1 p ( x ) # x p &1 ' x p &2 ' .......... ' 1 , (5.4) while the polynomial P( x ) , defined in (1.2), is equal to the constant 1. Like in Section 1, we assume that q has order r mod p , and that H # {1, q , q 2 ,........, q r &1 } . 29 (5.5) Since ( p , q ) # 1 , we certainly have q p &1 # 1 mod p , and hence r ! p & 1 . For the invariant subgroup K of G , we can take the group U p 2 of squares mod p . It is well known that the order of this group, usually denoted by Q, is equal to ( p & 1) / 2 , and that its only coset, consisting of all nonsquares and denoted by N, has the same order. This follows immediately from the fact that if g is a generator of the multiplicative group of GF ( p ) , the even powers of g are squares, whereas the odd ones are nonsquares. Hence, if we choose q such that is a quadratic residue mod p (square), we get q ( p&1) / 2 # 1 mod p , and so r! ( p & 1) / 2 Therefore, when q is chosen to be a quadratic residue, the group H of (5.5) is either the complete group Q of 2-residues or one of its subgroups. When H < Q , it can always be extended by another quadratic residue, such that we obtain H 3 K = Q. It then follows that t # 2 , $ # 2s , and we can write (cf. (1.12)) G # K - y2 K , K # H 1 - H 2 - .......... - H s , (5.6) H 1 :# H . (5.7) The coset y 2 K in (5.6) is the set of nonsquares mod p in G . In a more conventional notation, using Q and N, relation (5.6) is written as G #Q-N, (5.8) with Q :# K and N :# y 2 K . So, for any p one can construct quadratic residue codes of length p, by choosing an appropriate value for q . In particular there exist binary quadratic residue codes if p # ±1 mod 8. For such p-values, 2 is a quadratic residue mod p. Example 5.1 Let n # p # 7 and q # 2 . It follows that r # 3 and H # {1, q, q 2 } # {1, 2, 4} . Furthermore, G # {1,2,3,4,5,6} , 1 7 ( x ) # x 6 ' x 5 ' ..... ' 1 and " ( 7 ) # 6 . Hence, $ # 6 / 3 # 2 . We define K :# H # Q # {1, 2, 4} , with N # {3,5,6} as its only coset, and so t # 2 . In particular we can write e.g. G # K - 3K , and, since s # $ / t # 1 , K#H. For the polynomials g ( i ) ( x ) we find 30 g (1) ( x ) # * ( x & ) l ) = ( x & ) )( x & ) 2 )( x & ) 4 ) # x 3 ' x ' 1 , l%Q g ( 2 ) ( x ) # * ( x & ) l ) # ( x & ) 3 )( x & ) 5 )( x & ) 6 ) # x 3 ' x 2 ' 1 , l%N where ) is a primitive 7th root of 1 in GF (23 ) (remember that r # 3 ) . The codes generated by g (1) and by g (2) are the two equivalent [7, 4, 3] 2 Hamming codes . " Example 5.2 Next we take p # 5 and q # 2 . In this case we have r # 4 . Furthermore, G # {1,2,3,4} , 1 5 ( x ) # x 4 ' x 3 ' x 2 ' x ' 1 , " (5) # 4 , while the group of squares mod 5 is equal to Q # {1,4} . However, H #2 2 +# {1, 2, 4, 3} is not a proper subgroup of G , due to the fact that 2 is not a square in this case. The only group K with H 3 K 3 G , is K # H # G . Now, $ # 4 / 4 # 1 , and hence s # t # 1 . In this trivial case we find g (1) ( x ) # * ( x & ) i ) # 1 5 ( x ) # x 4 ' x 3 ' x 2 ' x ' 1 . i%K The 1- residue code generated by g (1) ( x ) is the binary repetition code [5, 1, 5] 2 . " From the above example we may conclude that for r # p & 1 , i.e. when q # 2 generates the group G , we always will find the trivial repetition code with parameters [ p , 1, p ] 2 . Quadratic residue codes (QR-codes) are defined in the literature (cf. e.g. [1,12]) as cyclic codes generated by the polynomials g (1) ( x ) # * ( x & ) i ) and g ( 2 ) ( x ) # * ( x & ) i ) . i%Q i%N As we saw, an additional requirement for binary quadratic codes is that 2 has to be a quadratic residue itself (cf. the first lines of this section). This is true if and only if p # ±1 mod 8. If p # ±3 mod 8, then 2 ? Q which implies that 2 generates the complete group G , i.e. H # G . This is precisely the case for the 1- residue codes, as illustrated by Example 5.2. In order to study the case p # ±3 mod 8 more closely, we consider the example p # 11 . Example 5.3 For p # 11 we have G :# U11 # {1, 2,.........,10} , 1 11 ( x) # x 10 ' x 9 ' ........ ' 1 , " (11) # 10 . In this case 2 is a generator of U11 , and therefore the group K :# H #2 2 + has index 1 with respect to G, and the only resulting code is the trivial [11, 1, 11] 2 repetition code as already announced above. 31 Next we take q # 4 which yields H #2 4 +# {1, 4,5, 9, 3} . The index of this group equals 2, and it consists of all 2-residues (cf. Theorem 2.1). So, if we take K :# H , the polynomials g (1) ( x) # * ( x & ) i ) and g ( 2) ( x) # * ( x & ) i ) are the generators of two i%K 1 11, 4 , 2 equivalent quaternary 2-residue codes C i%2 K 2 11, 4 , 2 and C . Here, ) is a primitive 11-th root of unity in some appropriate extension field of GF (4) . Explicit calculations show g (1) ( x) # x 5 ' 5x 4 ' x 3 ' x 2 ' 5 2 x ' 1 , g ( 2 ) ( x ) # x 5 ' 5 2 x 4 ' x 3 ' x 2 ' 5x ' 1 , where 5 is defined by 5 2 ' 5 ' 1 # 0 . One could also take q # 3 . Again we find H # {1,3,9,5,4} , and so by defining K :# H , 1 2 we obtain two more quadratic residue codes, this time over GF (3) , i.e. C11 , 3, 2 and C11, 3, 2 . The defining irreducible generating polynomials are respectively (cf. [12, p. 482]) g (1) ( x) # x 5 ' x 4 & x 3 ' x 2 & 1 , g ( 2) ( x) # x 5 & x 3 ' x 2 & x & 1 , These codes are equivalent versions of the well-known perfect ternary Golay code G11 with parameters [11, 6, 5] 3 . So, the minimum distance d is equal to 5, which is one more than the lower bound 4 for distances in the expurgated code, as follows from Theorems 4.1 and 4.2 (cf. also Theorem 5.1). Of course, one could also take q-values with ( q,11) # 1 which are not in U11 . E.g. q # 28 is equal to 3 modulo 11. So, modulo 11, this q-value generates the group H # {1,3,9,5, 4} which again is identical with the group of quadratic residues. Since r # 5 and hence $ # 10 / 5 # 2 , it follows from eq. (1.4) that 111 ( x) has a factorization into two irreducible polynomials over GF (28 ) of degree 2. These polynomials give rise to two i equivalent quadratic residue codes of length 11 over the field GF (28 ) , denoted by C11,2 , 8 ,2 " i % {1, 2} . (Cf. also Example 1.5.) Remarks If one can prove that the minimum distance of G11 is odd (like Pless did in [13] for binary QR-codes), then Theorem 5.1 gives immediately d # 5 . By taking n # 23 and q # 2 , one can construct the binary Golay code of length 23 as a quadratic residue code (cf. [12, p. 482]). 32 p &1 For n # p the cyclotomic polynomial 1 p ( x ) is equal to 0 x i , and so the i #1 polynomial P( x ) in (1.2) is identical to 1. As an immediate consequence of Theorems 4.1 and 4.2, we have the following results for the minimum weight d for codewords of a tresidue code which have odd weight. Theorem 5.1 The weight d of a codeword c ( i ) ( x ) of a t- residue code (t>1) of length p for which c (i ) (1) , 0 , satisfies d t + p . If &1 ? K , this inequality can be strengthened to (d 2 & d ' 1)t / 2 7 p . These results clearly generalize the case t # 2 for quadratic residue codes. Notice that &1 ? Q , if and only if p # &1 mod 4. 6. The special case n # p $ As a second special case we take n # p $ , with p an odd prime, and where q is again a prime power with ( p, q ) # 1 . So, we can choose for q any prime power which, modulo p$ , is in U p$ . For t # 2 we then get the generalized quadratic residue codes (GQRcodes) as dealt with in [10]. We now have G # U p$ # {1, 2,......., p$ } \{ p, 2 p,......., p$ } , (6.1) !G!= " ( p$ ) # p$ &1 ( p & 1) , $ &1 $ &1 (6.2) $ 1 p$ ( x) # x ( p &1) p ' x ( p & 2) p ' ......... ' 1 = x p & 1/ x p $ &1 &1 . (6.3) For the polynomial P ( x ) defined in eq. (1.2) we find $ &1 $ &1 P( x) # x p & 1/ x & 1 # x p &1 $ &1 ' xp &2 ' ......... ' 1 . (6.4) Just like in Section 5, we take for q some prime power with ( p, q ) # 1 . We assume that q has order r modulo p$ , and we introduce the subgroup H of G by H # {1, q, q 2 ,........, q r &1} . $ Since we know that q" ( p ) # 1 mod p$ , it follows that r! " ( p$ ) . 33 (6.5) Like in the subcase $ # 1 , which was considered in the previous section, the group U p$ is cyclic (cf. Lemma 2.3 (iii)). Let g be a generator of this group. Then the even powers of g form the subgroup Q of squares of order " ( p$ ) / 2 . The odd powers form its only coset N containing the nonsquares and which has the same size. Hence, if we choose q $ such that it is a quadratic residue mod p$ , we get q" ( p ) / 2 # 1 mod p$ , and so r! " ( p$ ) / 2 . Thus in this case the group H of (6.5) is either the group Q of 2-residues or one of its subgroups. When H < Q it can always be extended to a group K by another quadratic residue such that we obtain H 3 K # Q . Just like in Section 5, it now follows that t # 2 , $ # 2s , and the relations (5.6), (5.7) and (5.8) also hold in this case. So, for any prime p and for any positive integer $ we can construct quadratic residue codes by choosing an appropriate value for q. Example 6.1 If n # 32 we get U 9 # {1, 2, 4,5, 7,8} and " (9) # 6 . For q # 2 we obtain the subgroup K :# H # {1, 2, 4,8, 7, 5} which has index t # 1 . The corresponding 1-residue code is a binary code of length 9 and dimension 3. Likewise we derive for other elements of U 9 : q#4 K :# H # {1, 4, 7} = U 9 2 , r # 3, t # 2 , I 9,2 # (t , " (9)) # (2, 6) # 2 , yields two equivalent quaternary 2-residue groups of length 9 and dimension 6; q#5 K :# H # {1, 5, 7,8, 4, 2} = U 9 , r # 6, t # 1 , I 9,1 # (1, 6) # 1 , yields one 5-ary code of length 9 and dimension 3; q#7 K :# H # {1, 7, 4} = U 9 2 , r # 3, t # 2 , I 9,2 # (2, 6) # 2 , yields two 7-ary quadratic residue codes of length 9 and dimension 6; q #8 K :# H # {1,8} = U 93 , r # 2 , t # 3 , I 9,3 # (3, 6) # 3 , yields three 8-ary 3-residue codes of length 9 and dimension 7. Example 6.2 For n # 27 we find U 27 # {1, 2,......, 26} \ {3, 6,........., 24} , and " (27) # 18 . 1 Since 2 is a generator of U 27 , the code C27,2,1 based on the group K :# H #2 2 + is a binary code of length 27 and dimension 9. Similarly, taking q # 5 yields a 5-ary code of length 27 and dimension 9. The choice q # 4 gives H # {1, 4,16,10,13, 25,19, 22, 7} = U 27 2 . So, defining K :# H i provides us with two equivalent quaternary quadratic residue codes C27,4,2 , i % {1, 2} , of dimension 18. 34 " Finally, we take q # 26 # 10 mod 27, giving H # {1,10,19} # U 27 6 . So, I 27,6 # 6 in accordance with Corrollary 2.1 (i). Defining K :# H yields six equivalent 6-residue codes over GF (26 ) . Since one can also write 10 # 512 mod 27, there are also six of such " codes over GF (512 ) . It follows from eq. (6.4) that the weight of the polynomial P ( x ) , defined in (1.2), is equal to p$ &1 . Substituting d P # p$ &1 in Theorems 4.1 and 4.2 shows that the inequality of Theorem 5.1 also holds for $ + 1 . Theorem 6.1 The weight d of a codeword c (i ) ( x) of a t-residue code (t>1) of length p$ for which c (i ) (1) , 0 satisfies d t + p . If &1? K this inequality can be strengthened to (d 2 & d ' 1)t / 2 7 p . Example 6.3 i Consider the quaternary 2-residue codes C27,4,2 , i % {1, 2} of Example 6.2. From Theorem 6.1 it follows that the weight d of a codeword c (i ) ( x) with c (i ) (1) , 0 satisfies d 2 & d ' 1 7 3 . Notice, that &1? K . Hence, d 7 2 . In order to apply Theorem 4.3, we study quaternary residue codes of length 3. Now the order of 4 mod 3 is equal to 1, and since 9/1 = 27/3, we are really entitled to apply it. We factorize 1 3 ( x ) in GF (4)[ x ] according to 1 3 ( x ) # x 2 ' x ' 1 # ( x ' 5 )( x ' 5 2 ) , where 5 2 ' 5 ' 1 # 0 . The codeword c ( x ) # x ' 5 (or x ' 5 2 ) clearly has weight 2, while c (1) , 0 . So, d ! 2 according to Theorem 4.3, and therefore d # 2 . Of course, the i minimum distance of the complete code C27,4,2 , i % {1, 2} equals also 2. To verify this, we factorize 1 27 ( x ) # x 27 & 1/ x 9 & 1 # x18 ' x 9 ' 1 in GF (4)[ x ] as the product of two polynomials of degree 9 as x18 ' x 9 ' 1 # ( x 9 ' 5 )( x9 ' 5 2 ) . Indeed, the (generating) codeword x 9 ' 5 (or x 9 ' 5 2 ) is a word of weight 2. " 7. The special case n # 2 p $ The third special case is when n # 2 p $ , with p some odd prime. In this case the following relations hold G # U 2 p$ # {1,3,........,2 p $ & 1} \ { p,3 p,......., ( p & 1) p $ &1 } , | G | = " (2 p $ ) # p $ &1 ( p & 1) , $ 1 2 p$ # x 2 p & 1 / x 2 p 35 $ &1 & 1. (7.1) (7.2) (7.3) Similarly as in (6.4), we can write for the polynomial in eq. (1.2) P (x ) # x 2 p $ &1 & 1/ x & 1 # x 2 p $ &1 &1 ' x2 p $ &1 &2 ' ....... ' 1 . (7.4) Let q be some prime power such that ( 2 p, q ) # 1 , and assume that q has order r modulo 2 p $ . Let furthermore H # {1, q, q 2 ,........, q r &1 } . (7.5) $ Since q" (2 p ) # 1 mod 2 p$ , it follows that r ! " (2 p$ ) . The group U 2 p$ is cyclic (cf. Lemma 2.3 (iii)), so there exists an element g which generates all elements of the group. The even powers of g form the subgroup Q of squares of order " (2 p$ ) / 2 and the odd powers its only coset N containing all nonsquares. So, if the chosen prime power q is a quadratic residue, its order r is a divisor of " (2 p$ ) / 2 . In that case H is either the group Q or a subgroup of Q which can be extended to Q. Just like in Sections 5 and 6, we then have t # 2 , $ # 2s , while the relations (5.6), (5.7) and (5.8) also hold again. The polynomial P ( x ) in (7.4) has weight 2 p$ &1 . Substituting this value in Theorems 4.1 and 4.2 yields a result similar to Theorems (5.1) and (6.1). Theorem 7.1 The weight d of a codeword c (i ) ( x) of a t-residue code (t>1) of length 2 p$ for which c (i ) (1) , 0 , satisfies d t + p . If &1? K , this inequality can be strengthened to (d 2 & d ' 1)t / 2 7 p . Example 7.1 Let n # 10 # 2.5 . Successively we get U10 # {1,3, 7,9}, " (10) # 4 , U10 2 # {1,9} . Furthermore, we take q # 3 , giving r # 4 , $ # 1 , t # 1 and K # U10 . The corresponding code is a ternary code of length 10 and dimension 6. If we take q # 9 it follows that r # 2 and $ # 2 . We define K :# H # {1,9} # U10 2 and hence t # 2. The two resulting codes are quadratic residue codes over GF (9) . To determine the minimal generators of these codes, we have to factorize in GF (9)[ x ] the cyclotomic polynomial 110 ( x) into two irreducible polynomials of degree 2. We can do this by writing 110 ( x ) # 1 5 ( & x) # x 4 & x 3 ' x 2 & x ' 1 = ( x 2 ' 5 x ' 1)( x 2 & (5 ' 1) x ' 1) , where 5 is defined as a zero of the irreducible (over GF (3) ) polynomial x 2 ' x & 1 . 36 The polynomials in the right hand side are the minimal generators g (1) ( x ) and g (2) ( x) (cf. Section 1) of two equivalent quadratic residue codes over GF (9) of length 10 and dimension 8. " Example 7.2 Take n # 18 # 2.32 (cf. also Example 2.1). We get U18 # {1,5, 7,11,13,17} , " (18) # 6 . Next we take q # 7 and K :# H # {1, 7,13} # U18 2 . Hence, r # 3 , $ # 2 and t # 2 . We factorize 1 9 ( x) into two irreducible polynomials of degree 3 in GF (7) [x] according to 118 ( x ) # x 6 & x 3 ' 1 # ( x3 ' 4)( x 3 ' 2) . It follows immediately that there are two quadratic residue codes over GF (7) of dimension 15 with minimum weight (distance) 2. Theorem 7.1 yields in this case d 2 & d ' 1 7 3 . The minimum weight 2 of the two codes is the least value satisfying this inequality. " 8. Extended generalized residue codes and the case n = 21 In this section we shall present an examples of an extended binary GR-codes for t =2. This example also shows that a GR-code with t # 2 is not always a 2-residue code. Definition 8.1 The extended generalized residue code is the code obtained by appending an overall parity-check to the (augmented) generalized residue code C ni ,q ,t of length n over GF (q ) . Example 8.1 Take n # 21 and q # 4 , i.e. F :# GF (4) # {0,1, 5 , 5 2 } , where 5 is a zero of x 2 ' x ' 1 % GF (2)[ x] . It follows that G = U 21 # {1,2,4,5,8,10,11,13,16,17,19,20} , " ( 21) # 12 and r :# ord 21 (4)=3. The group H (= H 1 ) =<4> and its cosets in U 21 are H 1 # {1,4,16} , H 2 # {2,8,11} , H 3 # {5,17,20} , H 4 # {10,13,19} . We define a primitive 21-th root ) of unity in the following way. Such a root ) is an element of GF (4 3 ) , and hence it is a zero of some irreducible polynomial of degree 3 over the field F (and not over GF ( 2) ). Let ) be a zero of x 3 ' 5x ' 1 . It follows that ) 3 # 5) ' 1 , ) 6 # 5 2) 2 ' 1 , ) 7 # 5 2 and ) 21 # 1 . So, the order of ) in the multiplicative group of GF ( 4) is 21, and hence ) is a primitive root of unity. By some simple calculations we find ) ' ) 4 ' ) 16 # 0 , ) 5 ' ) 17 ' ) 20 # 5 , ) 2 ' ) 8 ' ) 11 # 0 and ) 10 ' ) 13 ' ) 19 # 5 2 . These relations enable us to derive that the irreducible polynomials over F which correspond to the cosets H 1 , H 2 , H 3 and H 4 are respectively P1 ( x ) # x 3 ' 5x ' 1 , P2 ( x ) # x 3 ' 5 2 x ' 1 , P3 ( x ) # x 3 ' 5x 2 ' 1 and 37 P4 ( x ) # x 3 ' 5 2 x 2 ' 1 . An alternative approach is to verify that ) 2 , ) 5 and ) 10 are zeros of P2 (x ) , P3 (x ) and P4 (x ) , respectively. We conclude that 1 n ( x ) # P1 ( x ) P2 ( x ) P3 ( x ) P4 ( x ) is the factorization of the cyclotomic polynomial into irreducible polynomials over F . Since G :# U 21 ; C 6 : C 2 , there are three possible choices for a group K satisfying H < K < G (cf. (1.9)). We obtain these groups K ' , K ' ' and K ' ' ' by extending H with the elements of K 2 , K3 or K 4 , The three groups are all cyclic of order 6, and hence of index t # 2 , while they are generated by 2, 5 and 10, respectively. Corresponding to these three cases , we have the following g functions cf. eqs. (1.14) and (1.15)): g1(1) ( x) # P1 ( x ) P2 ( x ) # x 6 ' x 4 ' x 2 ' x ' 1 , g1(2) ( x ) # P3 ( x ) P4 ( x) # x 6 ' x 5 ' x 4 ' x 2 ' 1 , g 2(1) ( x) # P1 ( x ) P3 ( x ) # x 6 ' 5 x 5 ' 5 x 4 ' 5 2 x 3 ' 5 x 2 ' 5 x ' 1 , g 2(2) ( x ) # P2 ( x ) P4 ( x) # x 6 ' 5 2 x 5 ' 5 2 x 4 ' 5 x 3 ' 5 2 x 2 ' 5 2 x ' 1 , g 3(1) ( x) # P1 ( x ) P4 ( x ) # x 6 ' 5 2 x 5 ' 5 x 4 ' x 3 ' 5 2 x 2 ' 5 x ' 1 , g 3(2) ( x ) # P2 ( x ) P3 ( x) # x 6 ' 5 x 5 ' 5 2 x 4 ' x 3 ' 5 x 2 ' 5 2 x ' 1 . The polynomials g i(1) ( x ) and g i( 2 ) ( x ) generate two GR-codes over GF ( 4) , 2 corresponding to the groups K ' , K ' ' and K ' ' ' . One can verify that U 21 # {1,4,16} , K ' , K ' ' , K ' ' ' . So, the GR-codes corresponding to these groups are not 2-residue codes. Since g1(1) ( x) and g1( 2) ( x) are also polynomials over GF ( 2) , the GR-codes generated by these polynomials are even binary codes. Actually, these codes can also be produced by taking q # 2 which has order 6 mod 21, and by choosing K :# H #2 2 +# {1,2,4,8,16,11} which is a subgroup of index 2. So, t # 2 and s # 1. Hence, 1 21 ( x) can be factorized into two irreducible polynomials over GF ( 2) . In fact we have for all i % {1,2,3} (cf. eq. (1.4)) 1 21 ( x ) # g i(1) ( x ) g i( 2 ) ( x ) # x12 ' x11 ' x 9 ' x 8 ' x 6 ' x 4 ' x 3 ' x ' 1 and P( x ) # x 21 & 1 # x9 ' x8 ' x 7 ' x 2 ' x ' 1 . 1 21 ( x ) In order to determine the idempotent polynomials of the above codes, we shall apply the following result mentioned in [12, p.223]. 38 Theorem 8.1 Let C be a cyclic code of length n , with n odd. Let g ( x ) be the generator of C of minimal degree and let h( x ) be its check polynomial. If r ( x ) is the reciprocal polynomial of h( x ) , then its idempotent generator e(x ) is equal to x deg( h ( x )&1 g ( x)r '(1/ x) , where r ' ( x ) is the derivative of r ( x ) . We remark that we can also write e( x ) # g ( x ) s ( x ) , (8.1) where s( x ) is the reciprocal polynomial of r ' ( x ) . (1) 1 To apply (8.1) to the code C 21 , 4 , 2 , generated by g1 ( x ) , we derive successively h1(1) ( x) # x15 ' x13 ' x10 ' x 7 ' x 6 ' x 3 ' x ' 1 , r ( x ) # x15 ' x14 ' x12 ' x 9 ' x 8 ' x 5 ' x 2 ' 1 , s ( x) # x10 ' x 6 ' 1 , and finally e1(1) ( x ) # g1(1) ( x )( x10 ' x 6 ' 1) = ( x16 ' x 4 ' x) ' x 14 ' ( x 11 ' x 8 ' x 2 ) ' x 7 ' 1 . In a similar way we find the idempotents e1(2) ( x ) # g1(2) ( x)( x14 ' x12 ' x8 ' x 2 ' 1) = ( x 20 ' x17 ' x 5 ) ' ( x15 ' x13 ' x10 ) ' x14 ' x 7 ' 1 . e2(1) ( x ) # g 2(1) ( x )(5 x14 ' 5 x12 ' 5 x10 ' (5 ' 1) x8 ' x 6 ' 5 x 4 ' x 2 ' 1) = 5 ( x 20 ' x17 ' x 5 ) ' 5 2 ( x19 ' x13 ' x10 ) ' ( x18 ' x15 ' x 9 ) ' 5 ( x16 ' x 4 ' x) + x14 ' ( x12 ' x 3 ' x 6 ) ' 5 2 ( x11 ' x8 ' x 2 ) ' x 7 ' 1 . e2(2) ( x ) # g 2(2) ( x )((5 ' 1) x14 ' (5 ' 1) x12 ' (5 ' 1) x10 ' 5 x 8 ' x 6 ' (5 ' 1) x 4 ' x 2 ' 1 ) = 5 2 ( x 20 ' x17 ' x 5 ) ' 5 ( x19 ' x13 ' x10 ) ' ( x18 ' x15 ' x 9 ) ' 5 2 ( x16 ' x 4 ' x) ' x 14 ' ( x 12 ' x 3 ' x 6 ) ' 5 ( x 11 ' x 8 ' x 2 ) ' x 7 +1. e3(1) ( x) # g 3(1) ( x)((5 ' 1) x14 ' (5 ' 1) x8 ' 1) = 5 2 ( x 20 ' x17 ' x 5 ) ' 5 ( x19 ' x13 ' x10 ) ' ( x18 ' x15 ' x 9 ) ' 5 ( x16 ' x 4 ' x) ' ( x12 ' x 6 ' x 3 ) ' 5 2 ( x11 ' x 8 ' x 2 ) +1. 39 e3(2) ( x) # g 3(2) ( x )(5 x14 ' 5 x8 ' 1) = 5 ( x 20 ' x17 ' x 5 ) ' 5 2 ( x19 ' x13 ' x10 ) ' ( x18 ' x15 ' x 9 ) ' 5 2 ( x16 ' x 4 ' x) ' ( x12 ' x 6 ' x 3 ) ' 5 ( x11 ' x 8 ' x 2 ) +1. As one can see, in all cases we have that the set of exponents of the nonzero x-powers is a union of cyclotomic cosets mod 21, with respect to 4, where 4 indicates the size of the field GF ( 4) . 1 Let us consider the binary cyclic 2-residue code C21,2,4 of length 21, which is generated by g1(1) ( x ) or by e1(1) ( x ) . According to Corrollary 4.1, if the minimum distance d is odd, 21 then d 2 & d ' 1 7 . Hence, we end up with the trivial inequality d 7 2 . It is easy to 9 check that the code does not contain words of weight 2. Furthermore, since e1(1) ( x )( x14 ' x 7 ' 1) = x14 ' x 7 ' 1 , the polynomial in the rhs is a codeword according to a well-known property of idempotents, and so the code contains a word of weight 3. Therefore, the minimum distance d equals 3. The polynomial e1(1) ( x ) gives rise to the (21 x 21) - generator matrix (1 1 1 0 1 0 0 1 1 0 0 1 0 0 1 0 1 0 0 0 0 ) c , where the subscript c stands for 21 cyclic shifts over one position to the right. We can rearrange this matrix according to cyclotomic classes in the following way. Rows and columns are labeled respectively by 1, 4, 16; 2, 8, 11; 5, 20, 7; 10, 19, 13; 0; 7; 14; 3, 12, 6; 9, 15, 18. The groups of indices separated by semi-colons, correspond to the cyclotomic classes. These can be seen as the orbits of the group U 21 when acting on the set Z 21 . The matrix itself can be considered as a block matrix consisting of 3 x 3 – blocks and 1 x 1 – blocks. These blocks themselves are circulants. The matrix in explicit form is on the next page. 40 1 4 16 2 8 11 5 20 17 10 19 13 0 7 14 3 12 6 9 15 18 1 0 0 1 1 0 1 0 1 0 0 0 0 0 0 1 1 0 1 1 0 0 1 0 0 1 1 1 1 0 0 0 0 0 0 0 0 1 1 0 1 1 0 0 1 1 0 1 0 1 1 0 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 0 0 0 0 0 1 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 1 0 0 0 0 1 1 0 0 0 0 1 1 0 1 1 0 1 1 0 0 0 1 0 0 0 0 1 1 0 0 0 0 1 1 0 1 1 0 0 1 0 0 0 1 0 0 0 1 1 1 1 0 0 1 1 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 1 1 1 0 1 1 0 1 1 0 1 0 1 1 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 1 1 0 0 1 0 1 1 1 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 0 1 1 0 1 0 0 0 1 1 0 1 1 0 1 0 1 1 1 0 1 1 0 0 0 1 0 1 1 1 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 1 1 0 1 0 0 0 1 1 0 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 1 0 1 1 0 0 1 1 0 1 1 1 0 1 0 1 1 0 1 1 0 1 0 0 0 1 0 0 0 0 0 0 0 1 1 1 0 1 1 1 0 1 0 1 1 1 0 0 1 1 0 1 1 1 0 1 1 1 0 1 0 1 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 Notice that the first four cyclotomic classes are the cosets of the group H in G . The extended code can easily be obtained by adding an additional row and column to the above matrix (labeled by A ) consisting of just ones. The word c % GF (2) 22 with ones at positions 41 cA # 0 , c0 # c7 # c14 # 1 , and with all other coordinates equal to 0, belongs to the extended 1 code and has weight 3. The code ( C21,4,2 ) ext has therefore minimum distance 3. Remark The question how to extend nonbinary GR-codes is still in discussion (cf. also [9, Sect. 6.9]). References 1. E.R. Berlekamp, Algebraic Coding Theory, McGraw-Hill, New York, 1968. 2. R.A. Brualdi and V.S. Pless, Polyadic Codes, Discrete Appl. Math. 25 (1989), 3 – 17. 3. P. Camion, Global Quadratic Abelian Codes, in Information Theory, CISM Courses and Lectures 219, G. Longo (ed.), Springer – Verlag, Wien, 1975. 4. P. Delsarte, Majority Logic Decodable Codes Derived from Finite InversivePlanes,Inf. and Control 18 (1971), 319 – 325. 5. W.C. Huffman, The Automorphism Groups of the Generalized Quadratic Residue Codes, IEEE Trans. Inf. Theory 41 (1995), 378 – 386. 6. K. Ireland and M. Rosen, A Classical Introduction to Modern Number Theory, Graduate Texts in Mathematics 84, Springer – Verlag, New York, 1980. 7. J.S. Leon, J.M. Masley and V. Pless, Duadic Codes, IEEE Trans. Inf. Theory 30 (1984), 709 – 714. 8. R.L. Lidl and H. Niederreiter, Introduction to Finite Fields and their Applications (rev. ed.),Cambridge University Press, Cambridge 1997. 9. J.H. van Lint, Coding Theory, Springer – Verlag, New York, 1971. 10. J.H. van Lint and F.J. MacWilliams, Generalized Quadratic Residue Codes, IEEE Trans. Inf. Theory 24 (1978), 730 – 737. 11. J.H. van Lint, Generalized Quadratic Residue Codes, Lecture Notes, Dep. of Math., Eindhoven Univ. of Technology. 12. F.J. MacWilliams and N.J.A. Sloane, The Theory of Error-Correcting Codes, North Holland Publ. Company, Amsterdam, 1977. 13. V. Pless, Introduction to the Theory of Error-Correcting Codes (2nd ed.), Wiley Intersc. Publ., John Wiley and Sons, New York, 1990. 14. V. Pless, “Q – Codes”, J. Comb. Theory, Ser. A 43 (1986), 258 – 276. 15. V. Pless and J.J. Rushanan, Triadic Codes, Linear Algebraic Appl. 98 (1988), 415 – 433. !6. M.H.M. Smid, Duadic Codes, IEEE Trans. Inf. Theory 33 (1987), 432 – 433. 17. A. Sharma, G.K. Bakshi and M. Raka, Polyadic Codes of Prime Power Length, Finite fields and their Applications 13 (2007), 1071 – 1085. 18. H.N. Ward, Qudratic Residue Codes and Symplectic Groups, J. of Algebra 29 (1974), 150 – 171. 42