arXiv:1902.10987v3 [math.NT] 16 Jan 2020 sn 11,i smr utet ra h remaining the treat to subtle more is it (1.1), using where Keywords (2010) Classification Subject Mathematics where ´ laVngao nqaiy(e o xml 4 hp 3) hc a which 23]), χ Chap. [4, example for P´olya-Vinogradov (see inequality (1.1) smttcfrua fa xr vrg vrtecaatr sint is characters the over average expression extra following an if formulas asymptotic rmteotooaiyrlto ftecaatr htteabove modulo the 1 that to characters congruent the are of which integers relation orthogonality the from 1] ai smttcfruaof formula asymptotic valid a [17], h e fqartccaatr.I 3,J .Cne,D .Farme W. D. Conrey, B. J. [3], In characters. quadratic of set the rniini h eairof behavior the in transition nlge to analogues iia eairi hw oeitb .Pto na ale td 1]on [16] study earlier an in eigenforms. Petrow Hecke I. of by coefficients exist Fourier to of shown is behavior similar p ofr uhsm,w oeta rmtv ui iihe characters Dirichlet cubic primitive that note we sums, such form To h aecnlsosapyt rmtv uri iihe hrcesa characters Dirichlet quartic primitive to apply conclusions same The ae nteeosrain,w nrdc h olwn eso Dir of sets following the introduce we observations, these on Based ≡ modulo siain o hrce ushv ieapiain nnme the number in applications wide have sums character for Estimations n a eadtePoy-iordvieult sama au est value mean a as P´olya-Vinogradov inequality the regard may One hl ti eaieyes ooti naypoi oml of formula asymptotic an obtain to easy relatively is it While Date nte neetn hiefor choice interesting Another eety h uhr 7 tde h envle fsm quadrat some of values mean the studied [7] authors the Recently, nti ae,w eunt h lsia etn ysuyn h me the studying by setting classical the to return we paper, this In md3 n hr r rcsl w uhcaatr hc r co are which characters such two precisely are there and 3) (mod 1 S aur 7 2020. 17, January : m n oprbet h egho h niiulsm.Ti genera This sums. sums. individual character the Dirichlet of quadratic length the to comparable Abstract. sacransto hrces o xml,when example, For characters. of set certain a is  q ui iihe hrce,qatcDrcltcharacter Dirichlet quartic character, Dirichlet cubic : , steJcb symbol. Jacobi the is M S ENVLE FCBCADQATCDRCLTCHARACTERS DIRICHLET QUARTIC AND CUBIC OF VALUES MEAN 2 ( ∈ ,Y X, Z eeaut h vrg fcbcadqatcDrcltchara Dirichlet quartic and cubic of average the evaluate We and nnme ed.Aan h otitrsigcs swhen is case interesting most the Again, fields. number in ) N ∈ S N 2 , ( ,Y X, S S st take to is 2 when ) ( ,Y X, q S . EGGOADLAGIZHAO LIANGYI AND GAO PENG o all for ) 2 X M 1, we define the set S3,n to be non-empty if and only if n is a product of powers of primes which are congruent to 1 modulo 3, in which case by writing n = k pαi with p 1 (mod 3) and α 1, we define i=1 i i ≡ i ≥ Q k αi (1.2) S3,n = χi : χi primitive cubic Dirichlet character modulo pi . (i=1 ) Y Similarly, let S4,1 be the set that contains the principal Dirichlet character modulo 1. For any integer n > 1, we define the set S4,n to be non-empty if and only if n is a product of powers of primes which are congruent to 1 modulo 4, in which case by writing n = k pαi with p 1 (mod 4) and α 1, we define i=1 i i ≡ i ≥ Qk αi (1.3) S4,n = χi : χi primitive quartic Dirichlet character modulo pi . (i=1 ) Y We are now ready to define the following character sums of our interest. For i = 3, 4, X, Y > 1, let

Si(X, Y )= χ(m).

n Y χ Si,n m X X≤ ∈X X≤ Our goal in this paper is to evaluate Si(X, Y ) asymptotically for i =3, 4. Our method here only allows us to treat the situation in which Y X, a condition we shall assume henceforth. In this case, one expects that the main contribution ≤ for Si(X, Y ) comes from the terms when n is a cube if i = 3 or a fourth-power if i = 4. Treating the remaining terms using the P´olya-Vinogradov inequality (1.1), we deduce that

1/i XY 3/2+ǫ (1.4) Si(X, Y )= Ci + O Y , i =3, 4, √log Y   for some constants Ci. The above allows us to obtain asymptotic formulas for Si(X, Y ),i = 3, 4 when Y is small compared to X. Thus, it is again a subtlety to obtain asymptotic formulas for Si(X, Y ),i =3, 4 when Y is close to X. This is precisely what we want to study in this paper. In view of (1.4), we may assume that Y X6/7 when studying ≥ S (X, Y ) and that Y X4/5 when studying S (X, Y ). Our main result is 3 ≥ 4 Theorem 1.1. For large X Y and any ε> 0, we have for Y X6/7, ≥ ≥ 1/3 1/3 5/17 XY XY 4/3 24/17+ǫ Y (1.5) S3(X, Y )= C1 + O + Y + Y . √log Y (log Y )3/2 X   ! We also have for Y X4/5, ≥ 1/4 1/4 9/31 38/31 XY XY 91/62+ǫ Y 13/31+ǫ Y (1.6) S4(X, Y )= C2 + O + Y + XY . √log Y (log Y )3/2 X X     !

Here C1, C2 are constants given in (3.13) and (3.23), respectively. A simple computation will show that (1.5) is a valid asymptotic formula (the main term dominates all the O-terms) 33/35 δ 160/187 δ if Y = O(X − ) and (1.6) if Y = O(X − ) for any δ > 0.

We point out here that C1 and C2 are positive (see the discussions below (3.13) and (3.23)). Our proof of Theorem 1.1 follows the line of treatment in [3] by first applying the Poisson summation formula to covert the sum over m in Si(X, Y ) to its dual sum. The zero frequency gives us the main term as usual. To treat the contribution of remaining terms, we transform the sum over n in Si(X, Y ), using Lemma 2.2, into another sum over algebraic integers in an imaginary quadratic number field. The resulting sums involve with certain Gauss sums for which we shall use a result of S. J. Patterson [15] (see Lemma 2.5). This treatment is also inspired by the method used in [1].

1.2. Notations. The following notations and conventions are used throughout the paper. e(z) = exp(2πiz)= e2πiz, ω = e(1/3). f = O(g) or f g means f cg for some unspecified positive constant c. ε denotes an arbitrary≪ small| |≤ positive number, which may be different from line to line. N(n) denotes the norm of n Z[ω] or n Z[i]. ̟ denotes a prime element in∈Z[ω] or Z[i∈] and p denotes a prime in Z. MEAN VALUES OF CUBIC AND QUARTIC DIRICHLET CHARACTERS 3

2. Preliminaries

2.1. Cubic and quartic symbols. For any number field K, let K denote the ring of integers in K and UK the of units in . Throughout this paper, set K = Q(ω),K = Q(Oi), where ω = exp(2πi/3). It is well-known that both OK ω i Q(i) and Q(ω) have class number one and that Kω = Z[ω], Ki = Z[i]. Recall that every ideal in Z[ω] co-prime to 3 has a unique generator congruent to 1 modulo 3O (see [2, PropositionO 8.1.4]) and every ideal in Z[i] coprime to 2 has a unique generator congruent to 1 modulo (1 + i)3 (see the paragraph above Lemma 8.2.1 in [2])). These generators are called primary.

Let n· 3 be the cubic residue symbol in Kω . For a prime ̟ Kω with N(̟) = 3, the cubic symbol is defined for a (N(̟) 1)/O3 a ∈ O 2 6 a a , (a,̟)=1 by a − (mod ̟), with 1,ω,ω . When ̟ a, we define = 0. Then ∈ OKω  ̟ 3 ≡ ̟ 3 ∈{ } | ̟ 3 the cubic symbol can be extended to any composite n with (N(n), 3) = 1 multiplicatively. We extend the definition    of · to n U by setting · = 1. Recall that [13, Theorem 7.8] the cubic reciprocity law states that for two n 3 ∈ Kω n 3 primary m,n Kω ,  ∈ O  m n = . n 3 m 3     The quartic case is similar. Let n· 4 be the quartic residue symbol in Ki . Suppose that ̟ Ki is a prime with a a (N(̟O) 1)/4 ∈a O N(̟) =2. If a , (a,̟) = 1, then we define by a − (mod ̟), with 1, i . Set 6 ∈ OKi  ̟ 4 ̟ 4 ≡ ̟ 4 ∈ {± ± } a = 0 if ̟ a. Now the quartic character can be extended to any composite n with (N(n), 2) = 1 multiplicatively. ̟ 4 |    As before, we extend the definition of · to n U by setting · = 1. The quartic reciprocity law, [13, Theorem  n 4 ∈ Ki n 4 6.9], states that for two primary m,n , ∈ OKi  m n ((N(n) 1)/4)((N(m) 1)/4) (2.1) = ( 1) − − . n 4 m 4 −     Similar to [1, Lemma 2.1] and [6, Section 2.2], we have the following description of Si,n, i = 3, 4 defined in (1.2) and (1.3) using the cubic and quartic residue symbols.

Lemma 2.2. For any non-empty S3,n, there is a bijection between S3,n and the set of cubic residue symbols of the form χ : m ( m ) for some q with q primary, not divisible by any Q-rational primes and N(q) = n. Similarly, 3,q → q 3 ∈ OKω a bijection exists between any non-empty S and the set of quartic residue symbols of the form χ : m ( m ) for 4,n 4,q → q 4 some q with q primary, not divisible by any Q-rational primes and N(q)= n. ∈ OKi 2.3. Gauss sums. Let χ be a Dirichlet character of modulus n. For any r Z, we define the τ(r, χ) as follows: ∈ rx (2.2) τ(r, χ)= χ(x)e . n x modX n   Similarly, for any n, r , we define ∈ OKω x rx z z¯ g3(r, n)= eω , where eω(z) = exp 2πi . n 3 n √ 3 − √ 3 x modX n       − −  Furthermore, for any n, r , set e e ∈ OKi x rx z z¯ g4(r, n)= ei , with ei(z) = exp 2πi . n 4 n 2i − 2i x modX n        The following (or similar) properties of gi(r,e n) for i = 3, 4 thate we enumerate below can be found in [9, Section 3] for i = 3 and [5, Section 2] for i = 4. Our g3(r, n) differs slightly from the cubic Gauss sums defined in [9]. But the properties of g3(r, n) can be proved in the same way as those of its analogue in [9]. Indeed, both (2.3) for i = 3 and (2.4) can be proved using the cubic reciprocity law and the Chinese remainder theorem.

s (2.3) gi(rs,n)= gi(r, n), (s,n)=1, n primary. n i   Note that we have [1, (13)] for (n1,n2) = 1 and n1,n2 primary, n (2.4) g (k,n n )= 1 g (k,n )g (k,n ). 3 1 2 n 3 1 3 2  2 3 4 PENG GAO AND LIANGYI ZHAO

Similarly, [8, Lemma 2.3] gives that for (n1,n2) = 1 and n1,n2 primary, 2 n2 n1 ((N(n ) 1)/4)((N(n ) 1)/4) n1 (2.5) g (r, n n )= g (r, n )g (r, n ) = ( 1) 1 − 2 − g (r, n )g (r, n ), 4 1 2 n n 4 1 4 2 − n 4 1 4 2  1 4  2 4  2 4 where the last equality above follows from the quartic reciprocity law, (2.1).

It is well-known (see [1, (11)] and [13, Prop. 6.5]) that for a primary prime ̟ (belonging to the corresponding ring of integers), g (1,̟) = N(̟)1/2, i =3, 4. | i | Using (2.4) or (2.5) to reduce the general case to the prime case and applying the above bound, we deduce that when r, n are in the corresponding ring of integers with n being square-free, gi(r, n) = 0, i = 3, 4 only when (r, n) = 1, in which case we get 6 (2.6) g (r, n) N(n)1/2, i =3, 4. | i |≤ In the proof of Theorem 1.1, we need a relation between τ and gi, i = 3, 4. Analogous to the discussions in [1, Section 2.2] (but be aware that the notion of g (r, n) there is slightly different from ours), one shows that for r Z and any 3 ∈ χ S3,n which corresponds to χ3,q, ∈ x rx τ(r, χ)= e . q 3 N(q) x modXN(q)     Now we can write x = yq¯+¯yq (mod qq¯) with y running through a set of representative (mod q) in Z[ω]. Hereq ¯ is the complex conjugate of q. Every x (mod N(q)) is uniquely representable this way. So we easily get yq¯ y y¯ y y y¯ τ(r, χ)= e r + = e r + , q 3 q q q 3 q q y modX q      y modX q      q¯ upon noting that q = 1 by cubic reciprocity. Now the change of variables y y√ 3 gives 3 → −   √ 3 (2.7) τ(r, χ)= − g (r, q). q 3  3 A similar relation exists for quartic Gauss sums. For r Z and any χ S4,n which corresponds to χ4,q by Lemma 2.2, we have ([6, p. 894]) ∈ ∈ 2i q (2.8) τ(r, χ)= g (r, q). q q 4  4  4 q In order to apply (2.8), we need to express q in terms of ray class characters (mod 16) in Q(i). To that end, 4 note that we have q 1 (mod (1 + i)3) with q having no rational prime divisors. If we write q = a + bi with a,b Z, then we deduce that≡ (a,b) = 1 so that ∈ (N(n) 1)/4 (N(n) 1)/4 q a bi 2a 2( 1) − ( 1) − a = − = = − − . q a + bi a + bi a + bi a + bi  4  4  4  4  4 We further observe that q = a + bi, a, b Z in Z[i] is congruent to 1 mod (1+ i)3 if and only if a 1 (mod 4), b 0 (mod 4) or a 3 (mod 4), b 2 (mod 4)∈ by [10, Lemma 6, p. 121]. It follows from this that we have≡ ≡ ≡ ≡ (N(q) 1)/4 (N(q) 1)/4 (2.9) a ( 1) − (mod 4), b 1 ( 1) − (mod 4). ≡ − ≡ − − (N(q) 1)/4 As ( 1) − a is primary according to (2.9), we have by the quartic reciprocity law, − (N(q) 1)/4 ( 1) − a ((N(a) 1)/4)((N(q) 1)/4) a + bi a + bi bi b i i − = ( 1) − − = = = = , a + bi − a a a a a a  4  4  4  4  4  4  4 where the last equality follows from [10, Proposition 9.8.5], which states that for a,b Z, (a, 2b) = 1 , ∈ b =1. a  4 One of the supplement laws to the quartic reciprocity law states that if n = a + bi being primary, then

i (1 a)/2 (2.10) = i − . n  4 MEAN VALUES OF CUBIC AND QUARTIC DIRICHLET CHARACTERS 5

It follows from (2.10) that

N(q)−1 i (1 ( 1) 4 a)/2 (a2 1)/8 = i − − = ( 1) − =: λ (q). a − 0  4 It is easy to check that λ0 is a ray class character (mod 16) in Q(i).

On the other hand, note that by the definition that

(N(q) 1)/4 − − ( 1) − N(q) 1 N(q) 1 (N(q) 1)/4 1 − = ( 1) 4 · 4 = ( 1) − = − . a + bi − − q  4  4 We then deduce that q 2 = − λ (q). q q 0  4  4 We conclude from this and (2.8) that for r Z and any χ S which corresponds to χ by Lemma 2.2, we have ∈ ∈ 4,n 4,q i τ(r, χ)= − λ (q)g (r, q). q 0 4  4 2.4. Analytic behavior of associated with Gauss sums. In the proof of Theorem 1.1, we need to know the analytic behavior of certain Dirichlet series associated with cubic or quartic Gauss sums. For any ray class character ψ3 (mod 9) in Q(ω) and any ray class character ψ4 (mod 16) in Q(i), we define ψ (n)g (dk,n) ψ (n)g (dk,n) G (s, dk; ψ )= 3 3 , G (s, dk; ψ )= 4 4 . 3 3 N(n)s 4 4 N(n)s n 1 mod 3 n 1 mod (1+i)3 ≡ (n,dX)=1 ≡ (n,dX)=1

We deduce from a general result of S. J. Patterson [15, Lemma, p. 200] the following analytic behavior of Gi, with i =3, 4 (see also [1, Lemma 3.5]). Lemma 2.5. The functions G (s, dk; ψ ),i =3, 4 has meromorphic continuation to the half plane with (s) > 1. It is i i ℜ holomorphic in the region σ = (s) > 1 except possibly for a pole at s =1+1/i. For any ε> 0, letting σ1 =3/2+ ε, then for σ σ σ 1/2, s ℜ (1+1/i) > 1/(2i), we have 1 ≥ ≥ 1 − | − | − 1 (σ σ+ε) 2 i 1 (σ σ+ε) G (s, dk; ψ ) N(dk) 2 1− (1 + t ) 2 1− , i i ≪ where t = (s) and the norm is taken in the corresponding number field. Moreover, the residue satisfies ℑ 1/6+ε 1/8+ε Res G (s, dk; ψ ) N((dk) )− , Res G (s, dk; ψ ) N(dk) , s=1+1/3 3 3 ≪ 1 s=1+1/4 4 4 ≪ 2 3 2 where we write dk = (dk)1(dk)2(dk)3 with (dk)1(dk)2 cubic-free in Z[ω].

3. Proof of Theorem 1.1 3.1. Initial Reductions. Let Φ(t), W (t) be two real-valued and non-negative smooth functions compactly supported (j) (j) j in (0, 1), satisfying Φ(t)= W (t)=1 for t (1/U, 1 1/U) and such that Φ (t), W (t) j U for all integers j 0. We consider the following smoothed sum ∈ − ≪ ≥ n m S (X, Y ; U)= χ(m)Φ W , i =3, 4. i Y X n χ Si,n m X ∈X X     where U is a parameter to be chosen later. Applying the P´olya-Vinogradov inequality in a way similar to the argument described in the Introduction, we see that when Y X, for any ε> 0, ≤ XY 1/i+ε + Y 3/2+ε (3.1) S (X, Y ) S (X, Y ; U) . i − i ≪ U

As the treatments for S (X, Y ) and S (X, Y ) are similar, we shall concentrate on the proof of the case S (X, Y ) 3 4 3 in what follows and discuss briefly the proof of S4(X, Y ) at the end of the paper. Let χ be a Dirichlet character of modulus q. Then we have the following well-known Poisson summation formula: m M kM (3.2) χ(m)w = τ(k,χ)w , M q q m Z k Z   X∈   X∈ e 6 PENG GAO AND LIANGYI ZHAO where τ(k,χ) is the Gauss sum defined in (2.2) and w is the Fourier transform of w, that is,

∞ w(x)=e w(y)e( xy)dy. − Z −∞ Applying (3.2) and (2.7), we see that e τ(k,χ) n kX S3(X, Y ; U)= X Φ W Z n Y n k n χ S3,n   X∈ X ∈X   √ 3 f n− g3(k,n) N(n) kX = X ′ 3 Φ W =: M + R,  N(n) Y N(n) 0 k Z n 1 mod 3     X∈ ≡ X f where Σ′ indicates that the sum is over n Z[ω] with no Q-rational prime divisor, ∈ √ 3 n− g3(0,n) N(n) M = XW (0) ′ 3 Φ , 0  N(n) Y n 1 (mod3)   ≡ X and f √ 3 n− g3(k,n) N(n) kX R = X ′ 3 Φ W .  N(n) Y N(n) k Zn 1 (mod3)     kX=0∈ ≡ X 6 f

3.2. The Term M0. We estimate M0 first. It follows directly from the definition that g3(0,n)= ϕω(n) if n is a cubic power and g3(0,n) = 0 otherwise. Here ϕω(n) denotes the number of reduced residue classes in Z[ω]/(n). Thus ϕ (n) N(n) M = XW (0) ′ ω Φ . 0 N(n) Y n 1 mod 3   n≡aX cubic f As it is easy to see that n3 has no Q-rational prime divisor if and only if n has no Q-rational prime divisor, we can 3 recast M0 upon replacing n by n as ϕ (n3) N(n3) ϕ (n) N 3(n) M = XW (0) ′ ω Φ = XW (0) ′ ω Φ . 0 N(n3) Y N(n) Y n 1 mod 3   n 1 mod 3   ≡ X ≡ X By Mellin inversion, wef have f

3 s ∞ N (n) 1 Y s 1 Φ = Φ(s)ds where Φ(s)= Φ(t)t − dt. Y 2πi N 3(n)   (2)Z   Z0 b b Integration by parts shows Φ(s) is a function satisfying the bound for all (s) > 0, and integers A> 0, ℜ A A 1 (3.3) Φ(s) (1 + s )− U − . b ≪ | | We then deduce that b XW (0) ϕ (n) (3.4) M = Y sΦ(s) ′ ω ds. 0 2πi N(n)1+3s n 1 mod 3 ! f (2)Z ≡ X b Note that (see [10, Prop. 9.1.2]) a prime ̟ Z[ω] is not Q-rational if and only if N(̟)= p 1 (mod 3) . We then deduce that when (s) > 1, ∈ ≡ ℜ ϕ (n) ϕ (n) ′ ω = ω N(n)1+s N(n)1+s n 1 mod 3 n ≡ ̟ n N(̟)=p 1 mod 3 X | ⇒ X ≡ 1 p s χ (p)+ χ (p) 1 p s = 1+ 1 − = 1+ 0,3 1,3 1 − , − p 1 p s 2 − p 1 p s p    −  p      −  p 1Y mod 3 − Y − ≡ MEAN VALUES OF CUBIC AND QUARTIC DIRICHLET CHARACTERS 7 where χ0,3 is the principal Dirichlet character modulo 3 and χ1,3 the non-principal Dirichlet character modulo 3. Let L(s,χ ) stand for the corresponding Dirichlet L-functions for i = 0, 1. Now we define for (s) > 1, i,3 ℜ s 2 1 1 χ0,3(p)+ χ1,3(p) 1 p− f(s)= L− (s,χ0,3)L− (s,χ1,3) 1+ 1 s . p 2 − p 1 p− Y      −  Observe that f(x)= p fp(s) with s 1 2 χQ0,3(p)+ χ1,3(p) 1 p − (χ0,3(p)+ χ1,3(p)) 1 1 f (s)= 1+ − 1 p p2s · 1 p s − 4 − p p2s(1 p s)  − −   − − χ (p)χ (p) (χ (p)+ χ (p))χ (p)χ (p) 1 1 + 0,3 1,3 + 0,3 1,3 0,3 1,3 1 p2s 4 − p p3s(1 p s)   − − (χ (p)+ χ (p))2 1 1 χ (p)+ χ (p) χ (p)χ (p) + 0,3 1,3 1 1 0,3 1,3 + 0,3 1,3 . 4 − p p2s(1 p s)2 − ps p2s   − −   It follows from the expression of f (s) that f(s) is analytic for (s) > 1/2. p ℜ We then derive from (3.4) that 1 Y sg(s) (3.5) M0 = XW (0) ds, 2πi s 1/3 (2)Z − f where p 1 g(s)= Φ(s) s L(3s,χ )L(3s,χ )f(3s). − 3 0,3 1,3 s  It is easy to see that g(s) is analytic inb a neighbourhood of 1/3 and that (3.6) g(s)= g(1/3)+ O( s 1/3 ) | − | when s is near 1/3.

We now follow a method of E. Landau [12] (see also [14, p. 187, exercise 21]) by shifting the contour of integration in (3.5) to ′ , where ′ is the contour running from 1/3 ε0 i to 1/3 ε0 iδ vertically and from 1/3 ε0 + iδ to 1/3 ε C+∪Ci vertically.C The contour is from 1/3 −ǫ −iδ ∞to 1/3 −iδ horizontally,− then along the semicircle− − 0 ∞ C − 0 − − 1/3+ δe(iθ), 1/4 θ 1/4, and finally along a horizontal line to 1/3 ε0 + iδ. Here ε0 is sufficiently small and δ =1/ log Y . − ≤ ≤ −

To estimate the integral over ′, we note that L(s,χ1,3) is bounded when (s) > 0 and that (see [11, p. 100, exercise 3, ]) when σ = (s) 0, C ℜ ℜ ≥ (1 σ)/2+ǫ (3.7) L(s,χ ) (1 + s ) − , i =0, 1. i,3 ≪ | | We now divide the integral over ′ into two parts, C = + , Z′ Z′ Z′ C C1 C2 where ′ is the part of ′ with (s) T (T is to be chosen later) and ′ being the rest. Applying (3.7) with (3.3) by C1 C |ℑ |≤ C2 taking A = 1 for the integral over ′ and (3.7) with (3.3) by taking A = 2 for the integral over ′ , we deduce that the C1 C2 integral over ′ is C 1/3 ǫ 2ǫ U 1/3 ε 2ε (3.8) XY − 0 T 0 + XY − 0 U 0 , ≪ T 1 2ε0 ≪  −  upon setting T = U.

Next, the integral over is, using (3.6), C 1 Y sg(1/3) Y σ s 1/3 = ds + O | − |d s . 2πi s 1/3  s 1/3 | | Z − Z − C C p  p  8 PENG GAO AND LIANGYI ZHAO

After two changes of variables, we get that s 1/3 1 Y g(1/3) Y g(1/3) w 1/2 (3.9) ds = e w− dw 2πi s 1/3 2πi√log Y Z − Z C D where D is the contour that goes from εplog Y i to i horizontally, then to i along the right half of the unit circle − 0 − − centered at the origin and then to ε0 log Y + i horizontally. Using [14, Theorem C.3] with s = 1/2, the right-hand side of (3.9) is −

1/3 g(1/3)Y 1 1 w 1/2 e w− dw , √log Y Γ(1/2) − 2πi  Z −  D+∪D  where are the horizontal rays from ε0 logY i to i with the appropriate directions. The integrals over D± ε − ± −∞± D± can be easily estimated as Y − 0 . Thus ≪ s 1/3 1 Y g(1/3) g(1/3)Y 1/3 ε (3.10) ds = + O Y − 0 . 2πi s 1/3 √π log Y Z − C   On the other hand, it is easy to show thatp Y σ s 1/3 Y 1/3 (3.11) | − |d s . s 1/3 | | ≪ (log Y )3/2 Z − C Combining (3.8), (3.10) and (3.11), we see thatp 1/3 1/3 1 XY XY 1/3 ε0 2ε0 M0 = g W (0) + O + XY − U . 3 √π log Y (log Y )3/2     Using the observations that f 1 1 1 Φ =3+ O and W (0) =1+ O , 3 U 1/3 U       we can further rewrite M0 as b f 1/3 1/3 1/3 XY XY XY 1/3 ǫ0 2ε0 (3.12) M0 = C1 + O + + XY − U , √log Y (log Y )3/2 (log Y )1/2U 1/3   where 3 1 (3.13) C1 = lim s L(3s,χ0,3)L(3s,χ1,3)f(3s). √π s 1/3 − 3 s →   We note that as χ1,3 is quadratic, it is easy to see that C1 > 0. 3.3. The Term R. Now suppose k = 0. We first apply the M¨obius function to detect the condition that n 1 (mod 3) has no rational prime divisor to see6 that ≡

√ 3 nd− g3(k,nd) 3 N(nd) kX R = X µZ(d) Φ W .  N(nd) Y N(nd) k Z d Z n Z[ω]     kX=0∈ d 1X∈ mod 3 n 1∈X mod 3 6 ≡ ≡ f where we define µZ(d)= µ( d ), the usual M¨obius function. | | We now apply (2.4) to conclude that

√ 3 d− g3(k, d) 3 R = X µZ(d) H(k, d; X, Y ),  N(d) k Z d Z kX=0∈ d 1X∈ mod 3 6 ≡ where

d√ 3 n− g3(k,n) N(nd) kX H(k, d; X, Y )= 3 Φ W .  N(n) Y N(nd) n Z[ω]     n 1∈X mod 3 ≡ f MEAN VALUES OF CUBIC AND QUARTIC DIRICHLET CHARACTERS 9

We now write

R = R1(Z)+ R2(Z), with √ 3 d− g3(k, d) 3 R (Z)= X µZ(d) H(k, d; X, Y ) 1  N(d) k Z d Z, d Z kX=0∈ d∈ 1X mod| |≤ 3 6 ≡ and √ 3 − g3(k, d) d 3 R (Z)= X µZ(d) H(k, d; X, Y ). 2  N(d) k Z d Z, d >Z kX=0∈ d∈ 1X mod| | 3 6 ≡ We first estimate R2(Z) by noting that it follows from the definition of Φ that H = 0 unless N(nd) Y . We also note that if d is square-free as a rational integer, it is also square-free in Z[ω]. Hence it follows from (2.6)≤ that (3.14) g (k, d) N(d)1/2. 3 ≤ We further note that it follows from the definition of W and integration by parts that for any l 0, j 1, ≥ ≥ U j 1 (3.15) W (l)(t) − . ≪ t j | | Applying the above bound with l = 0, j = 1 orfj = 2 together with the trivial bound g3(k,n) N(n), we deduce that ≤

kX N(nd) N(nd) 2 H(k, d; X, Y ) W min , U ≪ N(nd) ≪  k X kX  N(n) Y/d2   N(n) Y/d2 | | N(n) Y/d2   X≤ X≤ X≤ f   Y Y 2 Y 2 Y Y 2 min , U min , U . ≪  k X kX  ≪ k d2X d2 kX N(n) Y/d2 N(n) Y/d2     ! X≤ | | X≤ | | Using (3.14) and the above bound for H leads us to the bound  Y 2 Y Y 2 XY Y 2 (3.16) R (Z) X + X U U ε. 2 ≪ k d3X d3 kX ≪ Z2 X k Z d Z | | k Z d Z     kX=0∈ d 1X∈ mod 3 kX=0∈ d 1X∈ mod 3 k 6 U ≡d >Z k 6 >U ≡d >Z | |≤ | | | | | | Now, to estimate R1(Z), we apply the Mellin inversion to obtain

s ∞ N(n) kX 1 Y kX s 1 Φ W = f˜(s, k)ds, where f˜(s, k)= Φ(t)W t − dt. Y N(n) 2πi N(n) Yt     (2)Z   Z0   f f Integration by parts and using (3.15) shows f˜(s) is a function satisfying the bound E+D D k X − E 1 (3.17) f˜(s, k) (1 + s )− 1+ | | U − , ≪ | | Y   for all (s) > 0, and integers D 0,E > 0. We deduce from the above discussions and (2.3) that ℜ ≥ √ s 3 1 Y n− g3(dk,n) H(k, d; X, Y )= f˜(s, k) G(1 + s, dk)ds, where G(1 + s, dk)= 3 . 2   1+s 2πi d Z N(n) (2)Z   n [ω], (n,d)=1 ∈n 1X mod 3 ≡ We now move the line of integration to the line (s) = ε. By Lemma 2.5, the only possible poles are at s = 1/3. ℜ Thus we may write R1(Z)= R1,1(Z)+ R1,2(Z), where

√ 3 d− g3(k, d) 1/3 3 1 R (Z)= XY µZ(d) f˜ , k Res G(1 + s, dk), 1,1  N(d)d2/3 3 s=1/3 k Z d Z, d Z   kX=0∈ d∈ 1X mod| |≤ 3 6 ≡ 10 PENG GAO AND LIANGYI ZHAO and √ 3 − g3(k, d) s X d 3 Y R (Z)= µZ(d) f˜(s, k) G(1 + s, dk)ds. 1,2   2 2πi Z Z N(d) d k d , d Z (Zε)   kX=0∈ d∈ 1X mod| |≤ 3 6 ≡ To estimate R1,1(Z), we note first that by the remark above (2.6), we may restrict the sum over d to those satisfying (d, k) = 1. We then apply Lemma 2.5 and the bound (3.17) with D =0, E = 1 to obtain Y N(dk ) 1/6+ε Y (3.18) R (Z) XY 1/3 1 − XY 1/3 . 1,1 ≪ k X d5/3 ≪ X k=k k2k3 Z   d Z, (d,k)=1   1 2 3 | | ∈ kX=0 ∈ 0=Xd Z 6 6 ≤

To estimate R1,2(Z), we apply Lemma 2.5 and bound (3.17) with D = 2, E = 4 to get that

2 1/4 1/4 2 ε Y 3 N(d) N(k) 1 ε ε Y 3 1/2 (3.19) R (Z) XY U (1 + t )− − dt XY U Z . 1,2 ≪ kX d | | ≪ X k Z   d Z | | ZR   kX=0∈ 0=Xd∈ Z 6 6 | |≤ Combining (3.16), (3.18) and (3.19), we conclude that XY Y 2 Y Y 2 (3.20) R U ε + XY 1/3 + XY ε U 3Z1/2. ≪ Z2 X X X      

3.4. Conclusion. We now combine (3.1), (3.12) and (3.20) and adjust the value of ε0 to see that

1/3 1/3 1/3 XY XY XY 1/3 Y 1/3 ε 2ε S3(X, Y )= C1 +O + + XY + XY − U √log Y (log Y )3/2 (log Y )1/2U 1/3 X (3.21)    XY 1/3+ε + Y 3/2+ε XY Y 2 Y 2 + + U ε + XY ε U 3Z1/2 , U Z2 X X     ! where C is given in (3.13). As Y X6/7 implies that Y 3/2 XY 1/3, we now choose the values of U,Z so that 1 ≥ ≥ Y 3/2 XY Y 2 Y 2 (3.22) = = X U 3Z1/2. U Z2 X X     We then deduce that X 5/17 U = Y 3/34 . Y   Substituting the above value of U into (3.21), making use of (3.22) and our assumption that Y X6/7, we arrive at the expression given in (1.5). ≥

We end this paper by giving a sketch on the proof of (1.6). We proceed in a way similar to the proof (1.5) and the main term corresponding to M0 given in (3.12) is 1/4 1/4 1/4 XY XY XY 1/4 ǫ0 3ε0 C2 + O + + XY − U , √log Y (log Y )3/2 (log Y )1/2U 1/4   where 4 1 (3.23) C2 = lim s L(4s,χ0,4)L(4s,χ1,4)h(4s), √π s 1/4 − 4 s →   with 2 s 1 1 χ0,4(p)+ χ1,4(p) 1 p− h(s)= L− (s,χ0,4)L− (s,χ1,4) 1+ 1 s . p 2 − p 1 p− ! Y      −  Here χ0,4 is the principal Dirichlet character modulo 4 and χ1,4 the non-principal Dirichlet character modulo 4. L(s,χi,4) is the corresponding Dirichlet L-functions for i =0, 1. It is also easy to see that C2 > 0. MEAN VALUES OF CUBIC AND QUARTIC DIRICHLET CHARACTERS 11

The estimation corresponding to R2 for S3(X, Y ) remains the same for S4(X, Y ). The estimation corresponding to 2 R1,1 for S3(X, Y ) in this case becomes (note that by (2.5) and (2.3), we have g4(d k,n) in place of g3(dk,n)) Y N(d2)1/8+ǫN(k)1/8+ǫ Y 2 N(d2)1/8+ǫN(k)1/8+ǫ XY 1/4 + XY 1/4 U 3 k X d k X d k Z, k=0 d Z k Z, k=0 d Z ∈ 6 | |  ∈ | | ∈ 6 | |  ∈ | | k XY U 3/X 0=Xd Z k >YX U 3/X 0=Xd Z | |≤ 6 | |≤ | | 6 | |≤ Y 5/4 XY 1/4 U 3/4+ǫZ1/2+ǫ, ≪ X   provided that (3.24) YU 3/X 1. ≥ The terms in S4(X, Y ) analogous to R1,2 in S3(X, Y ) become (by applying Lemma 2.5 and (3.17) with D = 3, E = 5) 2 2 1/4 1/4 2 ǫ Y 4 N(d ) N(k) 3/2 ǫ Y 4 XY U (1 + t )− dt XY U Z. ≪ kX d | | ≪ X k Z   d Z | | ZR   kX=0∈ 0=Xd∈ Z 6 6 | |≤ We then conclude that when Y X4/5, ≥ 1/4 1/4 1/4 XY XY XY 1/4 ε 3ε S4(X, Y )= C2 +O + + XY − U √log Y (log Y )3/2 (log Y )1/2U 1/4  Y 5/4 Y 3/2+ε XY Y 2 Y 2 +XY 1/4 U 3/4+εZ1/2+ε + + U ε + XY ε U 4Z , X U Z2 X X       ! where C2 is given in (3.23).

We now choose U,Z such that Y 5/4 XY Y 2 Y 2 XY 1/4 U 3/4Z1/2 = = X U 4Z. X Z2 X X       This implies that Y 12/31 X 9/31 Z = Y 9/31 ,U = Y 1/31 . X Y     One checks that (3.24) is satisfied when Y X4/5 and this leads to the expression for S (X, Y ) in (1.6). ≥ 4 Acknowledgments. P. G. is supported in part by NSFC grant 11871082 and L. Z. by the FRG grant PS43707 and the Faculty Silverstar Award PS49334 at the University of New South Wales (UNSW). Parts of this work were done when P. G. visited UNSW in August 2018. He wishes to thank UNSW for the invitation, financial support and warm hospitality during his pleasant stay. Both authors would like to thank the anonymous referee for his/her comments and suggestions. References

[1] S. Baier and M. P. Young, Mean values with cubic characters, J. Number Theory 130 (2010), no. 4, 879–903. [2] B. C. Berndt, R. J. Evans, and K. S. Williams, Gauss and Jacobi sums, Canadian Mathematical Society Series of Monographs and Advanced Texts, John Wiley & Sons, New York, 1998. [3] J. B. Conrey, D. W. Farmer, and K. Soundararajan, Transition mean values of real characters, J. Number Theory 82 (2000), no. 1, 109–120. [4] H. Davenport, Multiplicative Number Theory, Third edition, Graduate Texts in Mathematics, vol. 74, Springer-Verlag, Berlin, etc., 2000. [5] A. Diaconu, Mean square values of Hecke L-series formed with r-th order characters, Invent. Math. 157 (2004), no. 3, 635–684. [6] P. Gao and L. Zhao, Large sieve inequalities for quartic character sums, Q. J. Math. 63 (2012), no. 4, 891–917. [7] , Mean values of some Hecke characters, Acta Arith. 187 (2019), no. 2, 125–141. [8] , One level density of low-lying zeros of quadratic and quartic Hecke L-functions, Canad. J. Math. (to appear). arXiv:1708.01701. [9] D. R. Heath-Brown and S. J. Patterson, The distribution of Kummer sums at prime arguments, J. Reine Angew. Math. 310 (1979), 111–130. [10] K. Ireland and M. Rosen, A Classical Introduction to Modern Number Theory, Second edition, Graduate Texts in Mathematics, vol. 84, Springer-Verlag, New York, 1990. [11] H. Iwaniec and E. Kowalski, , American Mathematical Society Colloquium Publications, vol. 53, American Mathematical Society, Providence, 2004. 12 PENG GAO AND LIANGYI ZHAO

[12] E. Landau, Uber¨ die einteilung der positiven ganzen zahlen in vier klassen nach der mindestzahl der zu ihrer additiven zusammensetzung erforderlichen quadrate, Arch. Math. Phys. 13 (1908), no. 3, 305–312. [13] F. Lemmermeyer, Reciprocity Laws. From Euler to Eisenstein, Springer-Verlag, Berlin, 2000. [14] H. L. Montgomery and R. C. Vaughan, Multiplicative Number Theory. I. Classical Theory, Cambridge Studies in Advanced Mathematics, vol. 97, Cambridge University Press, Cambridge, 2007. [15] S. J. Patterson, The distribution of general Gauss sums and similar arithmetic functions at prime arguments, Proc. London Math. Soc. (3) 54 (1987), 193–215. [16] I. Petrow, Transition mean values of shifted convolution sums, J. Number Theory 133 (2013), no. 10, 3264–3282. L s 1 152 [17] K. Soundararajan, Nonvanishing of quadratic Dirichlet -functions at = 2 , Ann. of Math. (2) (2000), no. 2, 447–488.

School of Mathematical Sciences School of Mathematics and Statistics Beihang University University of New South Wales Beijing 100191 China Sydney NSW 2052 Australia Email: [email protected] Email: [email protected]