Advances in of Communications doi:10.3934/amc.2020049 Volume 15, No. 1, 2021, 131–153

THE VALUES OF TWO CLASSES OF GAUSSIAN PERIODS IN INDEX 2 CASE AND WEIGHT DISTRIBUTIONS OF LINEAR CODES

Fengwei Li School of Mathematics and Statistics, Zaozhuang University Zaozhuang, Shandong, 277160, China State Key Laboratory of Cryptology, P. O. Box 5159 Beijing, 100878, China Qin Yue Department of Mathematics, Nanjing University of Aeronautics and Astronautics Nanjing, Jiangsu, 211100, China Xiaoming Sun School of Mathematics and Statistics, Zaozhuang University Zaozhuang, 277160, China

(Communicated by Ferruh Ozbudak)¨

Abstract. Let l be a prime with l ≡ 3 (mod 4) and l 6= 3, N = lm for m a positive integer, f = φ(N)/2 the multiplicative order of a prime p modulo N, and q = pf , where φ(·) is the Euler-function. Let α be a primitive element of (N,q) N a finite field Fq, C0 = hα i a cyclic subgroup of the multiplicative group ∗ (N,q) i N Fq , and Ci = α hα i the cosets, i = 0,...,N − 1. In this paper, we (N,q) P use Gaussian sums to obtain the explicit values of ηi = (N,q) ψ(x), x∈Ci i = 0, 1, ··· ,N −1, where ψ is the canonical additive character of Fq. Moreover, (2N,q) we also compute the explicit values of ηi , i = 0, 1, ··· , 2N − 1, if q is a power of an odd prime p. As an application, we investigate the weight distribution of a p-ary linear code:

CD = {C = (Trq/p(cx1), Trq/p(cx2),..., Trq/p(cxn)) : c ∈ Fq}, where its defining set D is given by q−1 ∗ m D = {x ∈ Fq : Trq/p(x l ) = 0}

and Trq/p denotes the trace function from Fq to Fp.

1. Introduction f Let Fq be the finite field with q elements, where q = p , p is a prime, and f is a n positive integer. An [n, k, d] p-ary linear code C is a k-dimensional subspace of Fp

2020 Mathematics Subject Classification: Primary: 11T23, 94B05; Secondary: 11L05. Key words and phrases: Gaussian period, Gaussian sum, cyclotomic polynomial, weight dis- tribution, Linear code. The paper was supported by National Natural Science Foundation of China under Grants 11601475, 61772015, the foundation of Science and Technology on Information Assurance Labo- ratory under Grant KJ-17-010, china, and the foundation of innovative Science and technology for youth in universities of Shandong Province China under Grant 2019KJI001.

131 132 Fengwei Li, Qin Yue and Xiaoming Sun with minimum Hamming distance d. Let Ai be the number of codewords in C with Hamming weight i. The weight enumerator of C is defined by 2 n 1 + A1z + A2z + ··· + Anz .

The sequence (1,A1,A2,...,An) is called the weight distribution of C. The study of the weight distribution of a linear code is important in both theory and application because the weight distribution of a code can be used to estimate the error correcting capability and the error probability of error detection and correction with respect to some algorithms. (N,q) N Let N be a positive divisor of q − 1, α a primitive element of Fq, C0 = hα i ∗ (N,q) i N a cyclic subgroup of Fq , and Ci = α hα i, i = 0,...,N − 1, the cosets. Let ψ be the canonical additive character of Fq. Gaussian periods of order N are defined by (N,q) X ηi = ψ(x), i = 0, 1,...,N − 1, (N,q) x∈Ci where ψ is the canonical additive character of Fq. Gaussian periods are closely related to Gaussian sums. As applications, there are a lot of papers using Gaussian periods to give the weight distributions of linear codes and find strongly regular graphs, such as [4–8, 13–15, 17–19, 24, 25, 27, 30, 31]. The value of the Gaussian periods in general is very hard to compute, and it has been done only in certain special cases. Lemma 1.1. [20] When N = 2 and q = pf , the Gaussian periods are given by the following:  1  −1+(−1)f−1q 2 (2,q) 2 , if p ≡ 1 (mod 4), η0 = √ 1 −1+(−1)f−1( −1)f q 2  2 , if p ≡ 3 (mod 4), (2,q) (2,q) and η1 = −1 − η0 . The Gaussian periods in the semi-primitive case are well-known as follows. Lemma 1.2. [20] Assume that N > 2 and there exists a least positive integer e such that pe ≡ −1 (mod N). Let q = p2er for some positive integer r. pe+1 1. If r, p, and N are all odd, then √ √ (N − 1) q − 1 q + 1 η(N,q) = , η(N,q) = − for i 6= N/2. N/2 N i N 2. In all other cases, √ √ (−1)r+1(N − 1) q − 1 (−1)r q − 1 η(N,q) = , η(N,q) = for i 6= 0. 0 N i N For an odd prime l with l ≡ 3 (mod 4) and l 6= 3, Myerson in [20] gave the values of Gaussian periods of order l in the index 2 case. For more details to see [1,4,14,20]. m (l ,q) m In this paper, we determine the explicit values of ηi , i = 0, 1, . . . , l − 1, m (2l ,q) m and ηi , i = 0, 1,..., 2l − 1, in the index 2 case, which extend the results of Myerson in [20]. Moreover, we obtain the weight distributions of a class of linear codes over Fq. This paper is organized as follows. In Section 2, we give several results about Gaussian sums in index 2 case. In Section 3, let l be a prime with l ≡ 3 (mod 4) and l 6= 3, N = lm, f = φ(N)/2 the multiplicative order of a prime p f (N,q) modulo N, and q = p . We obtain the explicit values of ηi , i = 0, 1,...,N − 1. Gaussian periods and linear codes 133

In Section 4, let l be a prime with l ≡ 3 (mod 4) and l 6= 3, N = lm, f = φ(N)/2 the multiplicative order of a prime p modulo N, gcd(p, 2N) = 1, and q = pf . We (2N,q) compute the explicit values of ηi , i = 0, 1,..., 2N − 1. In Section 5, we give the weight distributions of a class of linear codes over Fq. In Section 6, we conclude this paper.

2. Some preliminaries In this section, we present results on cyclotomic polynomials, Gaussian sums and Gaussian periods, which will be needed in the sequel. Throughout this paper, let p be a prime and q = pf for a positive integer f.

2.1. Cyclotomy and cyclotomic polynomials. Let q − 1 = nN for two positive integers n > 1 and N > 1, and let α be a fixed (N,q) i N N primitive element of Fq. Define Ci = α hα i for i = 0, 1,...,N −1, where hα i ∗ N denotes the subgroup of the multiplicative group Fq generated by α . The cosets (N,q) Ci are called the cyclotomic classes of order N in Fq. The cyclotomic numbers of order N are defined by

(N,q) (N,q) (i, j)N = |(1 + Ci ) ∩ Cj | for all 0 ≤ i ≤ N − 1 and 0 ≤ j ≤ N − 1. The following lemma is proved in [21]. Lemma 2.1. If q ≡ 1 (mod 4), then q − 5 q − 1 (0, 0) = , (0, 1) = (1, 0) = (1, 1) = . 2 4 2 2 2 4 If q ≡ 3 (mod 4), then q + 1 q − 3 (0, 1) = , (0, 0) = (1, 0) = (1, 1) = . 2 4 2 2 2 4

q−1 Let α be a fixed primitive element of Fq and β = α n . Then there are φ(n) elements of order n: βi, 0 ≤ i ≤ n − 1 and gcd(i, n) = 1. Define the n-th cyclotomic polynomial over Fq: Y i Φn(x) = (x − β ). 0 ≤ i ≤ n − 1 gcd(i, n) = 1 Lemma 2.2. [16, Exercise 2.57] If p is a prime and an integer m is divisible by p p, then Φmp(x) = Φm(x ), where Φn (x) is the n-th cyclotomic polynomial. In particular, if n = lt+1, where l is a prime and t ≥ 1 is an integer, then

lt lt l−1 lt l−2 (1) Φlt+1 (x) = Φl (x ) = (x ) + (x ) + ... + 1.

2.2. Gaussian sums and Gaussian periods. Let Trq/p be the trace function from Fq to Fp. An additive character of Fq is a nonzero function ψ from Fq to the set of complex numbers such that ψ(x + y) = 2 ψ(x)ψ(y) for any pair (x, y) ∈ Fq. For each b ∈ Fq, the function

Trq/p(bc) ψb(c) = ζp for all b ∈ Fq 134 Fengwei Li, Qin Yue and Xiaoming Sun

√ 2π −1 defines an additive character of Fq, where ζp = e p denotes the p-th primitive . When b = 1, the character ψ1 is called canonical additive character of Fq. It is well know that X ψb(c) = 0 for b 6= 0. c∈Fq A multiplicative character of Fq is a nonzero function χ from Fq to the set of complex ∗ ∗ numbers such that χ(xy) = χ(x)χ(y) for all pairs (x, y) ∈ Fq × Fq . Let α be a fixed primitive element of Fq. For each j = 1, 2, . . . , q − 1, the function χj with k jk (2) χj(α ) = ζq−1 for k = 0, 1, . . . , q − 2 q−1 defines a multiplicative character with order gcd(q−1,j) of Fq, where ζq−1 denotes the (q − 1)-th primitive root of unity. Letχ ¯ be the conjugate character of χ defined byχ ¯(x) = χ(x), where χ(x) denotes the complex conjugate of χ(x). Let q be odd and j = (q − 1)/2 in (2), we then get a multiplicative character denoted by η such that η(c) = 1 if c is the square of an element and η(c) = −1 otherwise. This η is called the quadratic character of Fq. Let χ be a multiplicative character of Fq and ψ an additive character of Fq. Then the Gaussian sum G(χ, ψ) is defined as X G(χ, ψ) = χ(x)ψ(x). ∗ x∈Fq

By G(χ, ψb) =χ ¯(b)G(χ, ψ1), we need consider G(χ, ψ1), briefly denoted by G(χ), in the sequel. In general, the explicit determination of Gaussian sums is also a difficult problem. In some cases, Gaussian sums are explicitly determined in [4,27]. For future use, we state the quadratic Gaussian sums here. Lemma 2.3. [16] Suppose that q = pf and η is the quadratic multiplicative char- acter of Fq, where p is an odd prime. Then √  (−1)f−1 q, if p ≡ 1 (mod 4), G(η) = √ √ (−1)f−1( −1)f q, if p ≡ 3 (mod 4). The following result is useful in the sequel.

Lemma 2.4. [16] Let ψ be a nontrivial additive character of Fq and χ a multi- plicative character of Fq of order s = gcd(n, q − 1). Then s−1 X X ψ(axn + b) = ψ(b) χ¯j(a)G(χj, ψ)

x∈Fq j=1 for any a, b ∈ Fq with a 6= 0. Let Z/NZ = {0, 1,...,N − 1} be the ring of integers modulo N and (Z/NZ)∗ a multiplicative group consisting of all invertible elements in Z/NZ. If hpi is a cyclic subgroup with a generator p of the group (Z/NZ)∗ such that [(Z/NZ)∗ : hpi] = 2 and −1 ∈/ hpi ⊂ (Z/NZ)∗, which is called a “quadratic residues” or “index 2”case. These Gaussian sums are explicitly determined, see [26] and its references for details. We list some results in the index 2 case below. Lemma 2.5. [12, 26] Let l ≡ 3 (mod 4) be a prime, l 6= 3, m a positive integer, N = lm, f = φ(N)/2 the multiplicative order of a prime p modulo N, and q = pf Suppose that χ is a multiplicative character of order N over Fq. Gaussian periods and linear codes 135

(i) For 1 ≤ i ≤ N − 1, let i = ult, 0 ≤ t ≤ m − 1 and gcd(u, l) = 1. Then

( t G(χl ) if u ∈ hpi ⊂ ∗ , G(χi) = ZN lt ∗ G(χ ) if u∈ / hpi ⊂ ZN . (ii) For 0 ≤ t ≤ m − 1,

√ lt t   lt f−hl a + b −l G(χ ) = p 2 , 2 √ where h is the ideal class number of Q( −l), a, b are integers given by  a2 + lb2 = 4ph, (3) l−1+2h a ≡ −2p 4 (mod l). √ √ Let O = [ −l] be the set of all algebraic integers in ( −l). Then pO = P P , Z √ √ Q 1 2 a+b −l a−b −l where P1 = h 2 , pi and P2 = h 2 , pi. In fact, the multiplicative character χ is correspondent to P2 (see [12]). In Lemma 2.6, suppose that p is an odd prime. Let χ be a multiplicative character of order 2N over Fq. For 1 ≤ i ≤ 2N − 1, by the Darvenport-Hasse product formula [2, Chapter 11.3],

m i i+lm i 2 i+l G(χ )G(χ ) G(χ )G(χ 2 ) G(χ2i) = χ2i(2) = √ . G(χlm ) ( p∗)f

m If i 6= N, then χi+l is a non-trivial character. Hence we have the following result. Lemma 2.6. [26] Let l ≡ 3 (mod 4) be a prime, l 6= 3, m a positive integer, N = lm, f = φ(N)/2 the multiplicative order of a prime p modulo N, gcd(p, 2N) = 1, f and q = p . Suppose that χ is a multiplicative character of order 2N over Fq. If i is odd, 1 ≤ i ≤ 2N − 1 and i 6= N. Then ( √ f p−1 f ∗ 4 2 i p = (−1) p , if l ≡ 7 (mod 8) or i = N, G(χ ) = (−1)(p−1)/4(G(χ2i))2 pf/2 , if l ≡ 3 (mod 8) and i 6= N. In Lemma 2.6, if i is even, then G(χi) is given by Lemma 2.5. Gaussian periods are closely related to Gaussian sums. By Lemma 2.4, it is known that n−1 (N,q) X 1 X η = ψ(αiαjN ) = (ψ(αixN ) − 1) i N j=0 x∈Fq N−1 N−1 1 X 1 X (4) = (−1 + χj(αi)G(χj)) = ζ−ijG(χj), N N N j=1 j=0

√ 2π −1 where ζN = e N is the N-th root of unity in the complex field, χ is a multiplica- ∗ 0 tive character of order N over Fq , χ(α) = ζN , and G(χ ) = −1. The values of the Gaussian periods in general are also very hard to compute. However, they can be computed in a few cases. In this paper, we shall compute all the Gaussian periods of orders lm and 2lm in the index 2 case, where l is a prime with l ≡ 3 (mod 4) and l 6= 3. Furthermore, using these results we obtain the weight distributions of a class of p-ary linear codes. 136 Fengwei Li, Qin Yue and Xiaoming Sun

3. Explicit values of Gaussian periods of order N Let N = lm, where m is a positive integer and l is a prime with l ≡ 3 (mod 4) and l 6= 3. Let f = φ(N)/2 be the multiplicative order of a prime p modulo N, i.e., f is the smallest positive integer such that pf ≡ 1 (mod N). Let q = pf . In this (N,q) section, we shall give the values of the Gaussian periods ηi , i = 0, 1,...,N − 1. Let S = {0, 1....,N − 1} be a set. Define subsets k Uk = {u : 0 ≤ u ≤ l − 1, gcd(u, l) = 1}, k = 1, . . . , m.

In fact, U1 ⊂ U2 ⊂ ... ⊂ Um ⊂ S. It is well known that we have a disjoint union m [ m−k [ S = l Uk {0}. k=1 Denote

(5) S = S0 ∪ S1 ∪ · · · ∪ Sm, m−k k where S0 = {0} and Sk = l Uk. In fact |Sk| = φ(l ) = |Uk|, k = 1, . . . , m. Let γ be a primitive root of (Z/lmZ)∗, then γ is also a primitive root of each k ∗ (0) 2 k ∗ (Z/l Z) for 1 ≤ k ≤ m. Let Hk = hγ i be the subgroup of (Z/l Z) , then k ∗ (0) (1) (1) (0) (Z/l Z) = Hk ∪ Hk , where Hk = γHk . In fact, by [11], (0) k−1 (0) Hk = {x = a0 + a1l + ... + ak−1l |a0 ∈ H1 , a1, . . . , ak−1 ∈ Z/lZ}, (1) k−1 (1) (6) Hk = {x = a0 + a1l + ... + ak−1l |a0 ∈ H1 , a1, . . . , ak−1 ∈ Z/lZ}. (0) (1) φ(lk) Then |Hk | = |Hk | = 2 . It is clear that k ∗ k (Z/l Z) = {u (mod l ): u ∈ Uk}, k = 1, . . . , m. k ∗ For convenience, denote Uk = (Z/l Z) , k = 1, . . . , m. (N,q) In the following, we shall use (4) and Lemma 2.5 to compute the values of ηi , i = 0, 1,...,N − 1. (N,q) Now we compute the value of η0 in case i = 0. (N,q) Theorem 3.1. The notation is as above. The value of η0 is equal to m √ √ ! g m−g (N,q) 1 X φ(l ) f−hl a + b −l lm−g a − b −l lm−g η = −1 + p 2 (( ) + ( ) ) , 0 N 2 2 2 g=1 √ where h is the ideal class number of Q( −l), a, b are integers given by (3), and φ(·) denotes the Euler function. Proof. By (4), we have N−1 (N,q) 1 X η = G(χj). 0 N j=0 By j = lm−gv ∈ S and (5), we have

 m  (N,q) 1 X X m−g η = −1 + G(χl v) . 0 N   g=1 v∈Ug Gaussian periods and linear codes 137

(0) (1) (0) Note that for g = 1, . . . , m, we know that v ∈ Ug = Hg ∪ Hg and |Hg | = (1) φ(lg ) |Hg | = 2 . By Lemma 2.5,

m m g m g X X m−g X φ(l ) m−g X φ(l ) m−g G(χl v) = G(χl ) + G(χl ) 2 2 g=1 v∈Ug g=1 g=1 m √ √ g m−g   X φ(l ) f−hl a + b −l lm−g a − b −l lm−g = p 2 ( ) + ( ) . 2 2 2 g=1 Then m √ √ ! g m−g (N,q) 1 X φ(l ) f−hl a + b −l lm−g a − b −l lm−g η = −1 + p 2 (( ) + ( ) ) . 0 N 2 2 2 g=1 This completes the proof.

(N,q) In the following, we compute the Gaussian periods ηi , i = 1, 2,...,N − 1. m−k (0) First, suppose that i = l u ∈ Sk and u ∈ Hk . Let j ∈ S, i.e., j = 0 or j = lm−gv, 0 ≤ v ≤ lg − 1, gcd(v, l) = 1. Then

N−1 (N,q) 1 X η = ζ−ijG(χj) i N N j=0

 m  1 X X 2m−(k+g) m−g = −1 + (ζ−l )uvG(χl v) . N  N  g=1 v∈Ug It is easy to see that  1, if k + g − m ≤ 0, −l2m−(k+g) uv  −uv (7) (ζN ) = ζl if k + g − m = 1,  −uv ζlt if k + g − m = t ≥ 2. Set 1 (8) η(N,q) = (−1 + A + B + C) , i N where m−k X X m−g A = G(χl v),

g=1 v∈Ug

X −uv lk−1v B = ζl G(χ ), v∈Um−k+1 and m X X −uv lm−g v C = ζlt G(χ ), g=m−k+2 v∈Ug where t = k + g − m. Note that C = 0 if m − k + 2 > m. Now we compute the values of A, B and C. 138 Fengwei Li, Qin Yue and Xiaoming Sun

Lemma 3.2. The notation is as above. Then m−k √ √ g m−g   X φ(l ) f−hl a + b −l lm−g a − b −l lm−g A = p 2 ( ) + ( ) , 2 2 2 g=1 √ where h is the ideal class number of Q( −l), a, b are integers given by (3), and φ(·) denotes the Euler function. Proof. m−k X X m−g A = G(χl v),

g=1 v∈Ug (0) (1) where v ∈ Hg ∪ Hg . By Lemma 2.5, we obtain that

m−k g X φ(l )  m−g m−g  A = G(χl ) + G(χl ) 2 g=1 m−k √ √ g m−g   X φ(l ) f−hl a + b −l lm−g a − b −l lm−g = p 2 ( ) + ( ) . 2 2 2 g=1

Lemma 3.3. The notation is as above. Then √ √ √ √ k−1   m−k f−hl −1 − −l a + b −l lk−1 −1 + −l a − b −l lk−1 B = l p 2 ( ) + ( ) , 2 2 2 2 √ where h is the ideal class number of Q( −l) and a, b are integers given by (3). Proof. By Lemma 2.5 and g = m − k + 1,

X −uv lk−1v B = ζl G(χ ) v∈Ug X −uv lk−1v X −uv lk−1v = ζl G(χ ) + ζl G(χ ) (0) (1) v∈Hg v∈Hg √ √ k−1 f−hl a + b −l lk−1 X −uv a − b −l lk−1 X −uv (9) = p 2 ( ) ζ + ( ) ζ . 2 l 2 l (0) (1) v∈Hg v∈Hg

(0) k−1 (0) Fix u ∈ Hk and u = u0 +u1l +...+uk−1l , where u0 ∈ H1 and u1, . . . , uk−1 ∈ Z/lZ. (0) g−1 (0) Suppose that v ∈ Hg . By (6), let v = v0 + v1l + ... + vg−1l , where v0 ∈ H1 −uv −u0v0 (1) and v1, . . . , vg−1 ∈ Z/lZ. Then ζl = ζl and −u0v0 ∈ H1 by l ≡ 3 (mod 4). P −uv Note that v1, v2, . . . , vg−1 ∈ /l = {0, 1, . . . , l−1}. Then the value of (0) ζ Z Z v∈Hg l g−1 m−k P −u0v0 is exactly l = l times the value of (0) ζl . Hence by Lemma 1.1, v0∈H1 √ X X (2,l) −1 − −l (10) ζ−uv = lm−k ζ−u0v0 = lm−kη = lg−1 . l l 1 2 (0) (0) v∈Hg v0∈H1

(1) g−1 (1) Suppose that v ∈ Hg . By (6), let v = v0 + v1l + ... + vg−1l , where v0 ∈ H1 −uv −u0v0 (0) and v1, . . . , vg−1 ∈ Z/lZ. Then ζl = ζl and −u0v0 ∈ H1 by l ≡ 3 (mod 4). Gaussian periods and linear codes 139

P −uv Note that v1, v2, . . . , vg−1 ∈ /l = {0, 1, . . . l−1}. Then the value of (1) ζ Z Z v∈Hg l m−k P −u0v0 is exactly l times the value of (1) ζl . Hence by Lemma 1.1, v0∈H1 √ X X (2,l) −1 + −l (11) ζ−uv = lm−k ζ−u0v0 = lm−kη = lm−k . l l 0 2 (0) (1) v∈Hg v0∈H1 By g = m − k + 1, the conclusion follows.

We are left to compute the value of C. Lemma 3.4. Suppose that t = g + k − m with t ≥ 2. Then C = 0.

(0) Proof. Suppose that u ∈ Hk . m X X −uv lm−g v C = ζlt G(χ ) g=m−k+2 v∈Ug m m X X −uv lm−g v X X −uv lm−g v = ζlt G(χ ) + ζlt G(χ ) g=m−k+2 (0) g=m−k+2 (1) v∈Hg v∈Hg m m m−g l X X −uv lm−g X X −uv = G(χ ) ζlt + G(χ ) ζlt . g=m−k+2 (0) g=m−k+2 (1) v∈Hg v∈Hg

m−k m−k m−g By the notation in (5), since i = l u ∈ l Uk = Sk and j = l v ∈ m−g m−t m−k l Ug = Sg, iSg = l Ut = St and |iSg| = l |St|. (0) (1) m−k m−g (0) m−t (1) Note that u ∈ Hk . Then −1 ∈ Hk , −l u(l Hg ) = l Ht , and m−k m−g (1) m−t (0) m−k m−g (0) m−k m−t (1) −l u(l Hg ) = l Ht . Moreover | − l u(l Hg )| = l |l Ht | m−k m−g (1) m−k m−t (0) and | − l u(l Hg )| = l |l Ht |. Fix g = m − k + t, t ≥ 2. Then

X −uv m−k X w X −uv m−k X w ζlt = l ζlt , ζlt = l ζlt . (0) (1) (1) (0) v∈Hg w∈Ht v∈Hg w∈Ht (0) (1) Note that Ut = Ht ∪ Ht for 2 ≤ t ≤ m. Then

(0) (1) Φlt (x) = Φlt (x) · Φlt (x), (0) Q i (1) Q i where Φ t (x) = (0) (x−ζlt ) and Φ t (x) = (1) (x−ζlt ). On the other hand, l i∈Ht l i∈Ht (0) (0) l (1) (1) l P w by Lemma 2.2 Φ t (x) = Φ t−1 (x ) and Φ t (x) = Φ t−1 (x ). Then (i) ζlt = l l l l w∈Ht 0, i = 0, 1. Hence

X −uv X −uv (12) ζlt = 0, ζlt = 0,C = 0. (0) (1) v∈Hg v∈Hg

(1) Similarly, we can also get that C = 0 if u ∈ Hk .

m−k (0) Theorem 3.5. If i = l u, u ∈ Hk , k = 1, 2, . . . , m, then 1 η(N,q) = (A + B − 1), i N 140 Fengwei Li, Qin Yue and Xiaoming Sun where m−k √ √ g m−g   X φ(l ) f−hl a + b −l lm−g a − b −l lm−g A = p 2 ( ) + ( ) , 2 2 2 g=1 and √ √ √ √ k−1   m−k f−hl −1 − −l a + b −l lk−1 −1 + −l a − b −l lk−1 B = l p 2 ( ) + ( ) . 2 2 2 2 √ In A and B, h is the ideal class number of Q( −l), a, b are integers given by (3), and φ(·) denotes the Euler function.

m−k (1) Second, suppose that i = l u, u ∈ Hk . We shall focus on computing the (N,q) value of ηi . m−k (1) (N,q) Theorem 3.6. If i = l u, u ∈ Hk , then the value of ηi is 1 η(N,q) = (A + B0 − 1), i N where A is defined as Theorem 3.5 and √ √ √ √ k−1   0 m−k f−hl −1 + −l a + b −l lk−1 −1 − −l a − b −l lk−1 B = l p 2 ( ) + ( ) . 2 2 2 2 √ In A and B0, h is the ideal class number of Q( −l), a, b are integers given by (3), and φ(·) denotes the Euler function. (1) Proof. If u ∈ Hk , then as above, 1 (13) η(N,q) = (−1 + A + B0 + C) , i N where m−k X m−g A = G(χl v), g=1

0 X −uv lk−1v B = ζl G(χ ), v∈Um−k+1 and k + g − m = t ≥ 2, m X X −uv lm−g v C = ζlt G(χ ). g=m−k+2 v∈Ug (1) Note that u ∈ Hk . In (10) and (11), √ X X (2,l) −1 + −l ζ−uv = lm−k ζ−u0v0 = lg−1η = lm−k , l l 0 2 (0) (0) v∈Hg v0∈H1 and √ X X (2,l) −1 − −l ζ−uv = lm−k ζ−u0v0 = lg−1η = lm−k . l l 1 2 (1) (1) v∈Hg v0∈H1 Thus √ √ √ √ k−1   0 m−k f−hl −1 + −l a + b −l lk−1 −1 − −l a − b −l lk−1 B = l p 2 ( ) + ( ) . 2 2 2 2 Gaussian periods and linear codes 141

By Lemmas 3.2, 3.3, and 3.4, Theorem 3.6 is proved. Theorems 3.1, 3.5 and 3.6 gave all the values of Gaussian periods of order N over m Fq, where l ≡ 3 (mod 4), l 6= 3, is a prime and N = l . Corollary 1. The assumptions are as above. If m = 1, then

1 f−h l − 1 η = (−1 + p 2 a), 0 l 2 1 f−h −a + bl η = (−1 + p 2 ), i l 2 and 1 f−h −a − bl η 0 = (−1 + p 2 ), i l 2 (0) 0 (1) where i ∈ H1 , i ∈ H1 , and a, b are integers given by (3).

4. Explicit evalues of Gaussian periods of order 2N Let N = lm, where l be a prime with l ≡ 3 (mod 4) and l 6= 3. Let f = φ(N)/2 be the multiplicative order of a prime p modulo N, i.e., f the smallest positive integer such that pf ≡ 1 (mod N). Let q = pf and gcd(p, 2N) = 1. In the following, we (2N,q) shall use (4) and Lemma 2.6 to compute the values of ηi , i = 0, 1,..., 2N − 1. 4.1. l ≡ 7 (mod 8). In this subsection, we always assume that l ≡ 7 (mod 8). Theorem 4.1. The notation is as above. Suppose that l ≡ 7 (mod 8). The values (2N,q) (2N,q) of η0 and ηN are equal to as follows: 1 1 √ 1 1 √ η(2N,q) = η(N,q) + ( p∗)f , η(2N,q) = η(N,q) − ( p∗)f , 0 2 0 2 N 2 0 2 (N,q) where η0 is defined as Theorem 3.1. Proof. By (4), we have 2N−1 (2N,q) 1 X 1 X X η = G(χj) = ( G(χj) + G(χj)), 0 2N 2N j=0 j even j odd where χ is the multiplicative character of order 2N over Fq. Note that X j (N,q) G(χ ) = Nη0 . j even By Lemma 2.6, X √ G(χj) = N( p∗)f . j odd By (4), we have 2N−1 (2N,q) 1 X 1 X X η = ζ−NjG(χj) = ( G(χj) − G(χj)), N 2N 2N 2N j=0 j even j odd This completes the proof. Theorem 4.2. If i = lm−ku, where 1 ≤ u ≤ 2lk − 1, gcd(l, u) = 1, and k = 1, 2, . . . , m. Then 1 η(2N,q) = η(N,q). i 2 i 142 Fengwei Li, Qin Yue and Xiaoming Sun

Proof. By (4), 2N−1 (2N,q) 1 X 1 X X η = ζ−ijG(χj) = ( ζ−ijG(χj) + ζ−ijG(χj)) i 2N 2N 2N 2N 2N j=0 j even j odd

1 (N,q) 1 √ X = η + ( p∗)f ζ−ij. 2 i 2N 2N j odd There is a canonical epimorphism: Z/(2lmZ) =∼ Z/(2Z)×Z/(lmZ) → Z/(2lkZ) =∼ k lm−k 2lk lk lk Z/(2Z) × Z/(l Z), ζ2N = ζ2lk , and x − 1 = (x − 1)(x + 1). Suppose that u −ij lk is odd. Then for 0 ≤ j ≤ 2N − 1 and j odd, ζ2N runs over all roots of x + 1 with k multiplicity lm−k. Suppose that u is even. Then it runs over all roots of xl − 1 with multiplicity lm−k. Hence

X (2N,q) 1 (N,q) ζ−ij = 0, η = η . 2N i 2 i j odd

4.2. l ≡ 3 (mod 8). In this subsection, we always assume that l ≡ 3 (mod 8). Theorem 4.3. The notation is as above. Suppose that l ≡ 3 (mod 8). The values (2N,q) (2N,q) of η0 and ηN are given as follows: √ p−1 m g (2N,q) 1 (N,q) (−1) 4 X φ(l ) m−g a + b −l m−g η = η + (pf + pf−hl (( )2l 0 2 0 2Npf/2 2 2 g=1 √ a − b −l m−g +( )2l )), 2 √ (p−1)/4 m g (2N,q) 1 (N,q) (−1) X φ(l ) m−g a + b −l m−g η = η − (pf + pf−hl (( )2l N 2 0 2Npf/2 2 2 g=1 √ a − b −l m−g +( )2l )), 2 (N,q) where η0 is defined as Theorem 3.1. Proof. By (4), we have 2N−1 (2N,q) 1 X 1 X X η = G(χj) = ( G(χj) + G(χj)), 0 2N 2N j=0 j even j odd where χ is the multiplicative character of order 2N over Fq. Note that X j (N,q) G(χ ) = Nη0 . j even

(p−1)/4 2j 2 j (−1) (G(χ )) By Lemma 2.6 and G(χ ) = pf/2 for j odd and j 6= N,

(p−1)/4 N−1 X j (−1) X 2j 2 p−1 f G(χ ) = (G(χ )) + (−1) 4 p 2 . pf/2 j odd j=1 By the proof of Theorem 3.1, √ √ N−1 m g X X φ(l ) m−g a + b −l m−g a − b −l m−g (G(χ2j))2 = pf−hl (( )2l + ( )2l ). 2 2 2 j=1 g=1 Gaussian periods and linear codes 143

Hence 1 η(2N,q) = η(N,q) 0 2 0 √ √ p−1 m g (−1) 4 X φ(l ) m−g a + b −l m−g a − b −l m−g + (pf + pf−hl (( )2l + ( )2l )). 2Npf/2 2 2 2 g=1 By (4), we have 2N−1 (2N,q) 1 X 1 X X η = ζ−NjG(χj) = ( G(χj) − G(χj)). N 2N 2N 2N j=0 j even j odd This completes the proof. Theorem 4.4. If i = 2ulm−k is even, where 1 ≤ u ≤ lk − 1, gcd(l, u) = 1, and k = 1, 2, . . . , m. Then 1 (−1)(p−1)/4 η(2N,q) = η(N,q) + (pf + A + B ), i 2 i 2Npf/2 2 2 where √ √ m−k g X φ(l ) m−g a + b −l m−g a − b −l m−g A = pf−hl (( )2l + ( )2l ), 2 2 2 2 g=1 and √ √ √ √ k−1 −1 − −l a + b −l k−1 −1 + −l a − b −l k−1 B = lm−kpf−hl ( ( )2l + ( )2l ). 2 2 2 2 2 Proof. By (4), 2N−1 (2N,q) 1 X 1 X X η = ζ−ijG(χj) = ( ζ−ijG(χj) + ζ−ijG(χj)) i 2N 2N 2N 2N 2N j=0 j even j odd (p−1)/4 1 (N,q) (−1) X = η + (pf + ζ−ij(G(χ2j))2) 2 i 2Npf/2 2N j odd,j6=N

(p−1)/4 N−1 1 (N,q) (−1) X 0 = η + (pf + ζ−i j(G(χ2j))2), 2 i 2Npf/2 N j=1 where i0 = i/2 = ulm−k. By the proofs of Lemmas 3.2, 3.3, and 3.4, N−1 X −i0j 2j 2 ζN (G(χ )) = A2 + B2, j=1 where m−k X X 2lm−g v 2 A2 = G(χ ) g ∗ g=1 v∈(Z/l Z) √ √ m−k g X φ(l ) m−g a + b −l m−g a − b −l m−g = pf−hl (( )2l + ( )2l ), 2 2 2 g=1 and X −uv lk−1v 2 B2 = ζl G(χ ) m−k+1 ∗ v∈(Z/l Z) 144 Fengwei Li, Qin Yue and Xiaoming Sun √ √ √ √ k−1 −1 − −l a + b −l k−1 −1 + −l a − b −l k−1 = lm−kpf−hl ( ( )2l + ( )2l ). 2 2 2 2 This completes the proof.

Theorem 4.5. If i = ulm−k is odd, where 1 ≤ u ≤ 2lk − 1, gcd(l, u) = 1, and k = 1, 2, . . . , m. Then 1 (−1)(p−1)/4 η(2N,q) = η(N,q) + (pf − A − B ), i 2 i 2Npf/2 2 2 where A2 and B2 are defined as Theorem 4.4. Proof. By (4),

2N−1 (2N,q) 1 X 1 X X η = ζ−ijG(χj) = ( ζ−ijG(χj) + ζ−ijG(χj)) i 2N 2N 2N 2N 2N j=0 j even j odd (p−1)/4 1 (N,q) (−1) X = η + (pf + ζ−ij(G(χ2j))2). 2 i 2Npf/2 2N j odd,p6=N Let T = {i : 0 ≤ i ≤ 2lm − 1} = S ∪ (N + S), where N + S = {N + s : s ∈ S}. For convenience, denote

(14) T = T0 ∪ T1 ∪ · · · ∪ Tm, m−k where T0 = {0,N} and Tk = {a ∈ T : l ka} = Sk ∪ (N + Sk), k = 1, . . . , m. Suppose that j = lm−gv ∈ T and j is odd. Then m [ m−g 0 j ∈ {N} l Ug, g=1

0 g g ∗ where each Ug = {1 ≤ i ≤ 2l − 1, gcd(i, 2l) = 1}. In fact, (Z/2l Z) = {u g 0 0 g ∗ (mod 2l ): u ∈ Ug}. For convenience, denote Ug = (Z/2l Z) , g = 1, . . . , m. By the proofs of Lemmas 3.2, 3.3, and 3.4, m X −ij 2j 2 X X −l2m−k−g uv lm−g v 2 ζ2N (G(χ )) = (ζ2N ) G(χ ) . 0 j odd,j6=N g=1 v∈Ug It is easy to know that  −1, if k + g − m ≤ 0, −l2m−(k+g) uv  −uv (15) (ζ2N ) = ζ2l if k + g − m = 1,  −uv ζ2lt if k + g − m = t ≥ 2. Then

X −ij 2j 2 0 (16) ζ2N (G(χ )) = −A2 + B2 + C2. j odd,j6=N

In (16), A2 is defined as Theorem 4.4,

0 X −uv lk−1v 2 X −uv lk−1v 2 B2 = ζ2l G(χ ) = − ζl G(χ ) = −B2, 0 0 v∈Ug v∈Ug and C2 = 0 by the proof of Lemma 3.4. This completes the proof. Gaussian periods and linear codes 145

5. Applications In this section, we always assume that l and p are primes with l ≡ 3 (mod 4) and l 6= 3. Let N = lm and f = φ(N)/2 the multiplicative order of a prime p modulo q−1 ∗ m N. We define D = {x ∈ Fq : Trq/p(x l ) = 0} = {x1, . . . , xn} as a defining set and a p-ary linear code as follows:

(17) CD = {C = (Trq/p(cx1), Trq/p(cx2),..., Trq/p(cxn)) : c ∈ Fq}.

If the set D is well chosen, the code CD may have good parameters. This construc- tion is generic in the sense that many known codes could be produced by selecting the defining set ( see [9, 10, 22, 23, 28, 29] for example). In general, we choose that m m l < q − 1. If q − 1 = l , let V = {v ∈ Fq : Trq/p(vx) = 0 for all x ∈ D } be a subspace of Fq over Fp. Define the linear code as follows:

CD = {C = (Trq/p(cx1), Trq/p(cx2),..., Trq/p(cxn)) : c ∈ Fq/V }. In coding theory, it is often desirable to know the weight distributions of the codes because they can be used to estimate the error correcting capability and the error probability of error detection and correction with respect to some algorithms. The codes with few nonzero weights are of special interest in association schemes, secret sharing schemes, and frequency hopping sequences. In the following, we will use Gaussian periods of index 2 case to investigate the weight distribution of the linear code CD defined as (17). We always denote by α a q−1 ∗ m m primitive element in Fq and β = α l an l -th primitive root of unity in Fq, where m f φ(l ) q = p and f = 2 . Without loss of generality, we assume that p 6 |f. Now we shall compute the length and the weight distribution of the linear code CD.

Theorem 5.1. Let CD be the code defined in (17). q−1 Suppose −l 6≡ 1 (mod p). Then the length n of CD is q − 1 − lm−1 . (l+1)(q−1) Suppose that −l ≡ 1 (mod p). Then the length n is q − 1 − 2lm .

q−1 m ∗ Proof. Let K = hα l i be a cyclic subgroup of Fq , i.e. K ⊂ Fq. Define a group homomorphism: q−1 ∗ lm σ : Fq −→ K, x 7−→ x . Then ∗ Fq q − 1 =∼ K, | ker(σ)| = . ker(σ) lm Hence q − 1 n = Ω, lm where Ω = |{i : 0 ≤ i ≤ lm − 1, Tr(βi) = 0}|. m−k Suppose that i = l u ∈ Sk, gcd(u, l) = 1, where k = 0, 1, . . . , m. i 0 If k = 0, i.e. i = 0, then Trq/p(β ) = Trq/p(β ) = f 6= 0 by p 6 |f. m−1 i m i If k = 1, i = l u ∈ S1. Then ord(β ) = l by ord(β) = l , so β ∈ l−1 and Fp 2 i (0) (1) Φl(β ) = 0. Let H1 and H1 be the sets consisting of all square elements and ∗ ∗ ∗ (0) (1) non-square elements in (Z/lZ) = Fl , respectively, i.e. Fl = H1 ∪ H1 . Then there is an irreducible factorization over Fp: (0) (1) (0) Y i (1) Y i Φl(x) = Φl (x)Φl (x), Φl (x) = (x − ξl ), Φl (x) = (x − ξl ), (0) (1) i∈H1 i∈H1 146 Fengwei Li, Qin Yue and Xiaoming Sun

(q−1)/l where ξl = α √ is an l-th primitive root of unity in√Fq. Let O = Z[ −l] be the algebraic integer ring of Q( −l). Then there is a prime ideal factorization of the prime p in O:

pO = P1P2, √ a+b −l √ where P1 is a prime ideal P1 = h , pi of ( −l) over p and P2 is a prime √ 2 Q a−b −l √ ideal P2 = h 2 , pi of Q( −l) over p. By [12], take P1. Let

ζl ≡ ξl (mod P1) and O/P1 = l−1 = p(ξl), Fp 2 F l−1 where 2 is the order of p modulo l. Suppose that −l6≡1 (mod p). Then √ X X −1 + −l ζi ≡ ξi ≡ 6≡0 (mod P ), l l 2 1 (0) (0) i∈H1 i∈H1 and √ X X −1 − −l ζi ≡ ξi ≡ 6≡0 (mod P ). l l 2 1 (1) (1) i∈H1 i∈H1 i Hence Tr (l−1)/2 (β ) 6= 0, i ∈ S . p /p 1 √ Suppose that −l ≡ 1 (mod p). Without loss of generality, let −l ≡ 1 (mod P1) and X i X i X i X ζl ≡ ξl ≡ 0 (mod P1), ζl ≡ ξl6≡0 (mod P1). (0) (0) (1) (1) i∈H1 i∈H1 i∈H1 i∈H1 Hence ( m−1 (0) i = 0, if i = l u ∈ S1, u ∈ H1 , Tr (l−1)/2 (β ) p /p m−1 (1) 6= 0, if i = l u ∈ S1, u ∈ H1 . m−k i k i If 2 ≤ k ≤ m, i = l u ∈ Sk. Then ord(β ) = l , so β is a root of irreducible (0) (0) l (1) (1) l i polynomial Φlk (x) = Φlk−1 (x ) or Φlk (x) = Φlk−1 (x ). Hence Trq/p(β ) = 0 by (12). Suppose that −l6≡1 (mod p). Then  i 6= 0, if i ∈ S0 ∪ S1, (18) Trq/p(β ) m = 0, if i ∈ ∪k=2Sk. q−1 Pm k q−1 Hence n = lm · k=2 φ(l ) = q − 1 − lm−1 . Suppose that −l ≡ 1 (mod p). Then ( 6= 0, if i ∈ S and i/lm−1 ∈ H(1), (19) Tr (βi) 0 1 q/p m m−1 (0) = 0, if i ∈ ∪k=2Sk and i/l ∈ H1 . q−1 Pm k l−1 (l+1)(q−1) Hence n = lm · ( k=2 φ(l ) + 2 ) = q − 1 − 2lm .

Suppose that −l6≡ 1 (mod p). We will compute WH (C), which is the Hamming ∗ weights of the codeword C of CD with respect to c ∈ Fq . If c = 0, then the Hamming weight of C is 0. If c 6= 0, then WH (C) = n − Z(c) and

q−1 ∗ lm Z(c) = |{x ∈ Fq : Trq/p(cx) = 0, Trq/p(x ) = 0}| Gaussian periods and linear codes 147

1 X X X q−1 lm = 2 ψ(ycx) ψ(zx ) p ∗ x∈Fq y∈Fp z∈Fp q−2 1 X X i X q−1 i = ψ(ycα ) ψ(zα lm ), p2 i=0 y∈Fp z∈Fp where ψ is the canonical additive character of Fq. m q−1 m Let i = sl + j, where 0 ≤ s ≤ lm − 1 and 0 ≤ j ≤ l − 1. Then

q−1 m lm −1 l −1 1 X X X m X Z(c) = ψ(ycαsl +j) ψ(zβj), p2 y∈Fp s=0 j=0 z∈Fp

j P j P z Trq/p(β ) m−k where ψ(zβ ) = ζp . Let j = l u ∈ Sk, gcd(u, l) = 1, z∈Fp z∈Fp j k = 0, 1, . . . , m. Using argument to the above, Trq/p(β ) 6= 0 if k = 0, 1 and j Trq/p(β ) = 0 if 2 ≤ k ≤ m. Hence

j  X j X z Trq/p(β ) 0, if j ∈ S0 ∪ S1, ψ(zβ ) = ζp = m p, if j ∈ ∪k=2Sk. z∈Fp z∈Fp

Note that S0 = {0}. Therefore

q−1 lm −1 m 1 X X X X m m−k Z(c) = ψ(ycαsl +l u) · p p2 y∈Fp s=0 k=2 u∈Uk

q−1 m q−1 lm −1 l −1 lm −1 1 X X X m 1 X X m = ψ(ycαsl +j) − ψ(ycαsl ) p p y∈Fp s=0 j=0 y∈Fp s=0 q−1 lm −1 1 X X X m m−1 − ψ(ycαsl +l u). p y∈Fp s=0 u∈U1 m m−1 m Let S = {i : 0 ≤ i ≤ l − 1}, W = {i ∈ S : l |i}, W1 = {i ∈ S : l |i}, and m−1 W2 = {i ∈ S : l ki}. Then we have the partition: W = W1 ∪ W2. Hence

q−1 −1 lm−1 X X m−1 ψ(ycαsl )

y∈Fp s=0 q−1 q−1 lm −1 lm −1 X X m X X X m m−1 = ψ(ycαsl ) + ψ(ycαsl +l u).

y∈Fp s=0 y∈Fp s=0 u∈U1 Therefore

q−1 −1 q−2 lm−1 1 X X 1 X X m−1 Z(c) = ψ(ycαi) − ψ(ycαl s) p p y∈Fp i=0 y∈Fp s=0 q−1 −1 q−2 lm−1 q − 1 p − 1 X 1 q − 1 p − 1 X m−1 = + ψ(cαi) − · − ψ(cαl s) p p p lm−1 p i=0 s=0 148 Fengwei Li, Qin Yue and Xiaoming Sun

q−1 −1 lm−1 q − 1 p − 1 q − 1 p − 1 X m−1 = − − − ψ(cαl s). p p plm−1 p s=0

j m−1 q−1 Let c = α , j = 0, 1, . . . , q − 2, then j = l b + i, where 0 ≤ b ≤ lm−1 − 1 and 0 ≤ i ≤ lm−1 − 1. Hence

q−1 −1 lm−1 X lm−1b+i lm−1s (lm−1,q) ψ(α α ) = ηi . s=0

Therefore

m−1 (q − p)l − (q − 1) p − 1 m−1 Z(c) = − η(l ,q), 0 ≤ i ≤ lm−1 − 1, plm−1 p i

m−1 (l ,q) m−1 where ηi is the Gauss period of index 2 of order l over Fq. m−1 m−1−k Let S = {s, 0 ≤ s ≤ l − 1} and Sk = {t = l u ∈ S, gcd(u, l) = 1}, (0) (1) where k = 0, 1, . . . , m − 1 and Uk = Hk ∪ Hk , k = 0, 1, . . . , m − 1. Recall that WH (C) = n − Z(c), we obtain the following result.

Theorem 5.2. Let p and l be primes with l ≡ 3 (mod 4), l 6= 3, and −l 6≡ 1 (mod p). Let N = lm(m ≥ 2), f = φ(N)/2 the multiplicative order of p modulo m−1 f q−1 l (l−1) N, and q = p . Then CD defined as (17) is a [q − 1 − lm−1 , 2 ] and 2m − 1 weight linear code over Fq. Its weight distribution is given by Table 1.

Table 1. Weight distribution of the code in Theorem 5.2. Weight Frequency 0 1 p−1 q−1 (lm−1,q) q−1 p (q − lm−1 + η0 ) lm−1 p−1 q−1 (lm−1,q) m−1−k (0) q−1 φ(lk) p (q − lm−1 + ηi ), i = l u, u ∈ Hk lm−1 · 2 p−1 q−1 (lm−1,q) 0 m−1−k (1) q−1 φ(lk) p (q − lm−1 + ηi0 ), i = l u, u ∈ Hk lm−1 · 2 k = 1, 2, . . . , m − 1

(lm−1,q) Where η0 is given by Theorem 3.1 and m is replaced by m − 1. m−1 m−1−k (0) (l ,q) When i = l u, u ∈ Hk for k = 1, 2, . . . , m−1, ηi is given by Theorem 3.5 and m is replaced by m − 1. m−1 0 m−1−k (1) (l ,q) When i = l u, u ∈ Hk for k = 1, 2, . . . , m − 1, ηi0 is given by Theorem 3.6 and m is replaced by m − 1.

Suppose that −l ≡ 1 (mod p). Then we have the following result.

Theorem 5.3. Let p and l be primes with l ≡ 3 (mod 4), l 6= 3, and −l ≡ 1 (mod p). Let N = lm(m ≥ 1), f = φ(N)/2 the multiplicative order of p modulo N, m−1 f (l+1)(q−1) l (l−1) and q = p . Then CD defined as (17) is a [q − 1 − 2lm , 2 ] and 2m + 1 Gaussian periods and linear codes 149 weight linear code over Fq. Its weight distribution is given by Table 2.

Table 2. Weight distribution of the code in Theorem 5.3 √ −1+ −l ( 2 ≡ 0 (mod P1)) Weight Frequency 0 1 m m m (p−1)(2l q−(l+1)(q−1)) + p−1 η(l ,q) + (l−1)(p−1) η(l ,q) q−1 2plm p 0 2p i0 lm 0 m−1 (1) i /l ∈ H1 m m m m (p−1)(2l q−(l+1)(q−1)) + p−1 η(l ,q) + (l+1)(p−1) η(l ,q) + (l−3)(p−1) η(l ,q) q−1 · l−1 2plm p 0 4p i 4p i0 lm 2 m−1 (0) 0 m−1 (1) i/l ∈ H1 , i /l ∈ H1 m m m (p−1)(2l q−(l+1)(q−1)) + (l+1)(p−1) η(l ,q) + (l+1)(p−1) η(l ,q) q−1 · l−1 2plm 4p i 4p i0 lm 2 m−1 (0) 0 m−1 (1) i/l ∈ H1 , i /l ∈ H1 m m (p−1)(2l q−(l+1)(q−1)) (p−1)(l+1) (l ,q) m q−1 k 2plm + 2p ηi , i ∈ ∪k=2Sk lm φ(l ), k = 2, 3, . . . , m,

(lm,q) (lm,q) (lm,q) where η0 is given by Theorem 3.1 and ηi , ηi0 are given by Theorems 3.5 and 3.6.

Proof. If c = 0, then the Hamming weight of C is 0. If c 6= 0, then WH (C) = n−Z(c) and

q−1 ∗ lm Z(c) = |{x ∈ Fq : Trq/p(cx) = 0, Trq/p(x ) = 0}| 1 X X X q−1 lm = 2 ψ(ycx) ψ(zx ) p ∗ x∈Fq y∈Fp z∈Fp q−2 1 X X i X q−1 i = ψ(ycα ) ψ(zα lm ), p2 i=0 y∈Fp z∈Fp where ψ is the canonical additive character of Fq. m q−1 m Let i = sl + j, where 0 ≤ s ≤ lm − 1 and 0 ≤ j ≤ l − 1. Then

q−1 m lm −1 l −1 1 X X X m X Z(c) = ψ(ycαsl +j) ψ(zβj), p2 y∈Fp s=0 j=0 z∈Fp

j P j P z Trq/p(β ) where ψ(zβ ) = ζp . z∈Fp z∈Fp Suppose that −l ≡ 1 (mod p). Then by (19) ( X 0, if j ∈ S and j/lm−1 ∈ H(1), (20) ψ(zβj) = 0 1 m m−1 (0) p, if j ∈ ∪k=2Sk and j/l ∈ H1 . z∈Fp Hence for c 6= 0,

q−1 lm −1 m 1 X X X X m m−k Z(c) = ψ(ycαsl +l u) · p p2 y∈Fp s=0 k=2 u∈Uk q−1 lm −1 1 X X X m m−1 + ψ(ycαsl +l u) · p p2 y∈ p s=0 (0) F u∈H1 q−1 q−2 lm −1 1 X X 1 X X m = ψ(ycαi) − ψ(ycαl s) p p y∈Fp i=0 y∈Fp s=0 150 Fengwei Li, Qin Yue and Xiaoming Sun

q−1 lm −1 1 X X X m m−1 − ψ(ycαsl +l u) p y∈ p s=0 (1) F u∈H1 q−1 q−2 lm −1 q − 1 p − 1 X 1 q − 1 p − 1 X m = + ψ(cαi) − · − ψ(cαl s) p p p lm p i=0 s=0 q−1 lm −1 (l − 1)(q − 1) p − 1 X X m m−1 − − ψ(cαl s+l u) 2plm p s=0 (1) u∈H1 q−1 lm −1 q − p (l + 1)(q − 1) p − 1 X m = − − ψ(cαl s) p 2plm p s=0 q−1 lm −1 p − 1 X X m m−1 − ψ(cαl s+l u). p s=0 (1) u∈H1 ∗ j lm m Suppose that c ∈ Fq . Then c ∈ α hα i, j = 0, . . . , l − 1. If j ∈ S0 = {0}, then

q − p (l + 1)(q − 1) p − 1 (lm,q) (l − 1)(p − 1) (lm,q) Z(c) = − − η − η 0 , p 2plm p 0 2p i

0 m−1 (1) where i /l ∈ H1 . m If j ∈ ∪k=2Sk, then by (6)

q−1 lm −1 X X m m−1 l − 1 (lm,q) ψ(cαl s+l u) = η . 2 j s=0 (1) u∈H1 Hence q − p (l + 1)(q − 1) (p − 1)(l + 1) m Z(c) = − − η(l ,q), p 2plm 2p j (lm,q) where ηj is defined as Theorems 3.5 and 3.6. m−1 (0) l−3 If j ∈ S1 and j = l v, v ∈ H1 . Then there are (1, 0)2 = 4 elements (1) (0) l−3 (1) u ∈ H1 such that v + u ∈ H1 ; there are (1, 1)2 = 4 elements u ∈ H1 such (1) (1) that v + u ∈ H1 , and there is a unique u ∈ H1 such that v + u = 0. Hence

q − p (l + 1)(q − 1) p − 1 m Z(c) = − − η(l ,q) p 2plm p 0

(l + 1)(p − 1) (lm,q) (l − 3)(p − 1) (lm,q) − η − η 0 , 4p i 4p i m−1 (0) 0 m−1 (1) where i/l ∈ H1 and i /l ∈ H1 . m−1 (1) l+1 If j ∈ S1 and j = l v, v ∈ H1 . Then there are (0, 1)2 = 4 elements (1) (0) l−3 (0) u ∈ H1 such that v + u ∈ H1 ; there are (1, 0)2 = 4 elements u ∈ H1 such (1) that v + u ∈ H1 . Hence

q − p (l + 1)(q − 1) (l + 1)(p − 1) (lm,q) (l + 1)(p − 1) (lm,q) Z(c) = − − η − η 0 , p 2plm 4p i 4p i Gaussian periods and linear codes 151

m−1 (0) 0 m−1 (1) where i/l ∈ H1 and i /l ∈ H1 . Note that WH (C) = n − Z(c), we obtain the Table 2.

In the following, we list some examples. √ Example 1. Let p = 2 and l = 7. The class number h of Q( −7) is equal to 1 [3, P.514]. In Theorem 5.3, take m = 1, Magma figures out that CD defined as 2 in (17) is a [3, 3] one-weight linear code over F23 with weight distribution 1 + 3z . This experimental result coincides with the weight distribution in Table 2. √ Example 2. Let p = 3 and l = 11. The class number h of Q( −11) is equal to 1 [3, P.514]. In Theorem 5.3, take m = 1, Magma figures out that CD defined as in (17) is a [110, 5] two-weight linear code over F35 with weight distribution 1 + 22z90 + 220z72. This experimental result coincides with the weight distribution in Table 2. √ Example 3. Let p = 2 and l = 23. The class number h of Q( −23) is equal to 3 [3, P.514]. In Theorem 5.3, take m = 1, Magma figures out that CD defined as in (17) is a [979, 11] three-weight linear code over F211 with weight distribution 1 + 979z480 + 979z496 + 89z528. This experimental result coincides with the weight distribution in Table 2. Remark. In fact, there are a lot of prime pairs (p, l) suitable for Theorems 5.2 and 5.3. Suppose that p = 2, 3, 5, or 7 and l is prime with l ≡ 3 (mod 4) and 3 < l ≤ 50. If (p, l) ∈ {(5, 11), (7, 31), (7, 47)}, then it is suitable for Theorem 5.2. If (p, l) ∈ {(2, 7), (2, 23), (2, 47), (3, 23), (3, 47), (5, 19)}, then it is suitable for The- orem 5.3. If m = 1, then (p, l) = (3, 11) is suitable for Theorem 5.3.

6. Concluding remarks In this paper, we always assumed that l is a prime with l ≡ 3 (mod 4) and l 6= 3, N = lm for m a positive integer, f = φ(N)/2 is the multiplicative order of a prime p modulo N, and q = pf , where φ(·) is the Euler-function. Let α be a (N,q) i N primitive element of the finite field Fq and Ci = α hα i cosets, i = 0,...,N −1. (N,q) P We used Gaussian sums to obtain the explicit values of ηi = (N,q) ψ(x), x∈Ci m i = 0, 1, ··· ,N − 1, where N = l and ψ is the canonical additive character of Fq. (2N,q) Moreover, we also computed the explicit values of ηi , i = 0, 1, ··· , 2N − 1, if p is an odd prime. Furthermore, assumed that the defining set D of a linear code is q−1 ∗ m D = {x ∈ Fq : Trq/p(x l ) = 0}, we obtained the weight distributions of the p-ary linear codes:

CD = {C = (Trq/p(cx1), Trq/p(cx2),..., Trq/p(cxn)) : c ∈ Fq}, where Trq/p denotes the trace function from Fq to Fp.

Acknowledgments The authors are very grateful to the reviewers and the Editor for their valuable suggestions that improved the quality of this paper. 152 Fengwei Li, Qin Yue and Xiaoming Sun

References

[1] L. Baumert and J. Mykkeltveit, Weight distributions of some irreducible cyclic codes, DSN Progr. Rep., 16 (1973), 128–131. [2] B. Berndt, R. Evans and K. Williams, Gauss and Jacobi Sums, New York, John Wiley & Sons Company, 1997. [3] H. Cohen, A Course in Computational Algebraic , Graduate Texts in Math- ematics, 138. Springer-Verlag, Berlin, 1993. [4] C. S. Ding and J. Yang, Hamming weights in irreducible cyclic codes, Discrete Math., 313 (2013), 434–446. [5] C. S. Ding, Y. Liu, C. L. Ma and L. W. Zeng, The weight distributions of the duals of cyclic codes with two zeros, IEEE Trans. Inform. Theory, 57 (2011), 8000–8006. [6] C. S. Ding, C. L. Li, N. Li and Z. C. Zhou, Three-weight cyclic codes and their weight distributions, Discrete Math., 339 (2016), 415–427. [7] T. Feng and Q. Xiang, Strongly regular graphs from unions of cyclotomic classes, Journal of Combinatorial Theory Series B, 102 (2012), 982–995. [8] Z. L. Heng and Q. Yue, A class of binary linear codes with at most three weights, IEEE Commun. Lett., 19 (2015), 1488–1491. [9] Z. L. Heng and Q. Yue, Two classes of two-weight linear codes, Finite Fields Appl., 38 (2016), 72–92. [10] Z. L. Heng and Q. Yue, Evaluation of the Hamming weights of a class of linear codes based on Gauss sums, Des. Codes Cryptogr., 83 (2017), 307–326. [11] L. Q. Hu, Q. Yue and M. H. Wang, The linear complexity of Whiteman’s generalize cyclotomic sequences of period pm+1qn+1, IEEE Trans. Inform. Theory, 58 (2012), 5534–5543. [12] P. Langevin, Caluls de certaines sommes de Gauss, J. Number theory, 63 (1997), 59–64. [13] C. J. Li and Q. Yue, The Walsh transform of a class of monomial functions and cyclic codes, Cryptogr. Commun., 7 (2015), 217–228. [14] C. J. Li, Q. Yue and F. W. Li, Weight distributions of cyclic codes with respect to pairwise coprime order elements, Finite Fields Appl., 28 (2014), 94–114. [15] F. W. Li, Q. Yue and F. M. Liu, The weight distribution of a class of cyclic codes containing a subclass with optimal parameters, Finite Fields Appl., 45 (2017), 183–202. [16] R. Lidl and H. Niederreiter, Finite Fields, Encyclopedia of Mathematics and its Applications, 20. Cambridge University Press, Cambridge, 1997. [17] Y. W. Liu and Z. H. Liu, On some classes of codes with a few weights, Adv. Math. Commun., 12 (2018), 415–428. [18] J. Q. Luo and K. Q. Feng, On the weight distribution of two classes of cyclic codes, IEEE Trans. Inf. Theory, 54 (2008), 5332–5344. [19] G. McGuire, On three weights in cyclic codes with two zeros, Finite Fields Appl., 10 (2004), 97–104. [20] G. Myerson, Period polynomials and Gauss sums for finite fields, Acta Arith., 39 (1981), 251–264. [21] T. Storer, Cyclotomy and Difference Sets, Lectures in Advanced Mathematics, No. 2 Markham Publishing Co., Chicago, Ill. 1967. [22] Q. Y. Wang, K. L. Ding, D. D. Lin and R. Xue, A kind of three-weight linear codes, Cryptogr. Commun., 9 (2017), 315–322. [23] Q. Y. Wang, K. L. Ding and R. Xue, Binary linear codes with two weights, IEEE Commun. Lett., 19 (2015), 1097–1100. [24] X. Q. Wang, D. B. Zheng, L. Hu and X. Y. Zeng, The weight distributions of two classes of binary cyclic codes, Finite Fields Appl., 34 (2015), 192–207. [25] M. S. Xiong, The weight distributions of a class of cyclic codes, Finite Fields Appl., 18 (2012), 933–945. [26] J. Yang and L. L. Xia, Complete solving of explicit evaluation of Gauss sums in the index 2 case, Sci. China Math., 53 (2010), 2525–2542. [27] J. Yang, M. S. Xiong, C. S. Ding and J. Q. Luo, Weight distribution of a class of cyclic codes with arbitrary number of zeros, IEEE Trans. Inform. Theory, 59 (2013), 5985–5993. [28] S. D. Yang, X. L. Kong and C. M. Tang, A construction of linear codes and their complete weight enumerators, Finite Fields Appl., 48 (2017), 196–226. [29] S. D. Yang and Z.-A. Yao, Complete weight enumerators of a class of linear codes, Discrete Math., 340 (2017), 729–739. Gaussian periods and linear codes 153

[30] Z. C. Zhou and C. S. Ding, A class of three-weight cyclic codes, Finite Fields Appli., 25 (2014), 79–93. [31] Z. C. Zhou, A. X. Zhang and C. S. Ding, The weight enumerator of three families of cyclic codes, IEEE Trans. Inf. Theory, 59 (2013), 6002–6009. Received September 2018; 1st revision March 2019; final revision November 2019.

E-mail address: [email protected] E-mail address: [email protected] E-mail address: [email protected]