Gaussian almost primes in almost all narrow sectors

We show that almost all sectors of the disc $\{z \in \mathbb{C}: |z|^2\leq X\}$ of area $(\log X)^{15.1}$ contain products of exactly two Gaussian primes, and that almost all sectors of area $(\log X)^{1 + \varepsilon}$ contain products of exactly three Gaussian primes. The argument is based on mean value theorems, large value estimates and pointwise bounds for Hecke character sums.


Introduction
Our aim in this paper is to establish results on the distribution of Gaussian almost primes in very small sectors. The ring Z[i] of Gaussian integers is a unique factorization domain, so we have a unique representation for a Gaussian integer as a product of primes, up to factors that are powers of i.
In what follows, for symmetry reasons we restrict our Gaussian integers to : 0 ≤ arg(n) < π/2}, i.e., the set of Gaussian integers in the first quadrant. The primes in Z[i] * are precisely 1 + i, the rational primes ≡ 3 (mod 4), and elements a + bi with a, b > 0 whose norm N(a+bi) := a 2 +b 2 is an odd prime. By a product of k Gaussian primes (or loosely speaking a Gaussian almost prime) we mean an element n ∈ Z[i] * of the form n = up 1 · · · p k , where p i ∈ Z[i] * are Gaussian primes and u ∈ {±1, ±i} is a unit.
We shall investigate the angular distribution of the Gaussian almost primes. Thus, we consider the measure of θ ∈ [0, π/2) for which a narrow sector S θ := {n ∈ Z[i] * , N(n) ≤ X : θ ≤ arg(n) < θ + h/X} contains no Gaussian almost primes, with h as small as possible in terms of X. In this connection, we say that a property P θ,X holds for almost all θ ∈ [0, π/2) if the Lebesgue measure of those θ for which P θ,X fails is o X→∞ (1).
For h < X 1/2 , it is easy to see that there exist sectors (in particular S θ for θ close enough to 0) which contain no Gaussian integers, let alone Gaussian almost primes. This is in contrast to the situation of primes in short intervals, where Cramér's conjecture predicts for h = (log X) 2+ε the existence of primes in [X, X + h] for any X ≥ X 0 (ε). One can also easily see (just by cardinality considerations) that if h = o((log X)/(log log X) k−1 ), then almost all sectors S θ contain no products of k Gaussian primes. Our first main theorem shows that this is essentially sharp; as soon as we have a sector of slightly larger width (log X)(log log X) C /X, with C suitably large, it does almost always contain products of three Gaussian primes. Theorem 1.1. Let h = (log X)(log log X) 19.2 . Almost all sectors {n ∈ Z[i] * , N(n) ≤ X : θ ≤ arg n < θ + h X } contain a product of exactly three Gaussian primes. When it comes to products of two Gaussian primes, we are able to find them in almost all narrow sectors of "logarithmic width" (log X) C /X for some explicit C > 1.  15.1 . Almost all sectors {n ∈ Z[i] * , N(n) ≤ X : θ ≤ arg n < θ + h X } contain a product of exactly two Gaussian primes. We in fact prove a quantitative bound for the number of p 1 p 2 or p 1 p 2 p 3 (with N(p i ) belonging to suitable intervals) in almost all narrow sectors; see Theorem 2.1.

Previous works
A central problem in the study of the distribution of Gaussian primes is to count primes in sectors {n ∈ Z[i] * : N(n) ≤ X, α ≤ arg n < β}. An asymptotic formula for the number of primes has been established by Ricci [19] for sectors of area X 7/10+ε , and a positive lower bound has been given by Harman and Lewis [9] for sectors of area X 0.619 .
The problem becomes easier if one only considers almost all sectors. Huang, Liu and Rudnick show in [10] that almost all sectors of area X 2/5+ε contain the expected number of primes. Under GRH, works of Rudnick-Waxman [20] and Parzanchevski-Sarnak [17] show that almost all sectors of area (log X) 2+ε contain Gaussian primes for any fixed ε > 0.
Another problem of interest is counting Gaussian primes in small circles. This corresponds to imposing both angular and norm constraints on Gaussian primes. Harman, Kumchev and Lewis [8] have shown that the distance to the nearest Gaussian prime from any point z = 0 is |z| 0.53 . Lewis has improved this to |z| 0.528 in his thesis [14]. Previous works in this area include Coleman's papers [2,4]. Asymptotic formulas for the number of primes satisfying both angular and norm constraints are given by Stucky [22].
See also Chapter 11 of Harman's book [7] for more on the topic and Duke's work [6] for some related problems over general number fields.

Overview of the method
The overall strategy of our argument follows the approach of the second author [24] to almost primes in almost all short intervals, which in turn borrows ideas from the work of Matomäki and Radziwi l l [15] on multiplicative functions in short intervals. However, adapting these methods efficiently to the Gaussian primes requires several additional ideas.
By a simple Fourier argument (Lemma 2.2) and separation of variables, we reduce the task of bounding the variance of products of exactly two Gaussian primes in narrow sectors to mean square estimates of the shape with P 1 ≈ h/(log X) and T ≈ X/h, and with λ m (z) = (z/|z|) 4m the angular Hecke characters. The Hecke polynomial P (m) is decomposed with Heath-Brown's identity as a product of several "smooth" Hecke polynomials (partial sums of Hecke L-functions), as well as some harmless very short Hecke polynomials, and one then splits the summation over m into regions depending on the sizes of P 1 (m) and the factors coming from Heath-Brown's identity, different regions being handled by different arguments.
We then attack the problem of bounding (1.1) by using various mean value theorems, large value estimates and pointwise bounds for Hecke polynomials. However, some complications arise when adapting such methods from the integers to the Gaussian integers.
The main source of complications is that less is known about the Hecke L-functions λ m (n)N(n) −1/2−it in the m-aspect than about the Riemann zeta function ζ(1/2 + it) in the t-aspect. In particular, while for the Riemann zeta function one has estimates for twisted fourth moments (such as Watt's theorem [25] that was employed in [24], [16]), not even the fourth moment m≤T |L(1/2, λ m )| 4 T 1+o (1) (or any moment higher than the second) is currently known for the Hecke L-functions. Furthermore, as remarked in e.g. [9], there is no good analogue of the Halász-Montgomery inequality (that was used in [15], [24], [16]) for Hecke polynomials. This is ultimately because the L-function L(s, λ m ) is of degree two, so that the pointwise estimates for it are essentially quadratic compared to the integer case (for instance, we have |L(0, m)| m, whereas |ζ(it)| |t| 1/2 , and we have |L(1/2, λ m )| m 1/3+o(1) by [13], whereas we have |ζ(1/2 + it)| |t| 1/6−δ+o (1) for δ = 1/84 by [1]). To overcome these limitations, we provide three tools: (1) An inequality of Halász-Montgomery type for Hecke polynomials that gives nontrivial bounds even for short polynomials (Proposition 5.1). (2) An improved mean value theorem for prime-supported Hecke polynomials, which takes into account the sparsity of the Gaussian primes (Proposition 6.2). (3) An improved large value theorem for short (of length (log X) a ) prime-supported Hecke polynomials (Corollary 5.3). For (1), our first aim is to obtain a power-saving bound for the sum N(n)∼N λ m (n).
We do this via the theory of exponential pairs. Writing n = x + iy, the sum at hand is a two-dimensional exponential sum with the phase function m arctan(y/x)/(π/2). By the triangle inequality it then suffices to obtain bounds for one-dimensional sums, to which the theory of exponential pairs may be applied. However, we encounter a technical complication: some of the higher order partial derivatives of arctan(y/x) vanish on certain lines y = kx. Hence, we must restrict our sums outside of the resulting problematic narrow sectors. As a result we obtain bounds of the form for certain (very short) intervals I i , in the full range N = m α , 0 < α < 1, with δ = δ(α) > 0 explicit (and reasonable); this is Proposition 4.6(i). (We note that we also employ another approach based on Hecke L-functions and Perron's formula, which gives us a certain pointwise bound without any problematic sectors -see Proposition 4.6(ii).) By the usual Halász-Montgomery method, we then obtain an inequality of the form m∈T N(n)∼N arg n ∈I 1 ∪...∪Ir a n λ m (n) that we need for adapting the Matomäki-Radziwi l l method (here T ⊂ [−T, T ] ∩ Z and δ = δ(α) with α = (log N )/(log T )), see Proposition 5.1. Our exponent of log log X or log X in the main theorems naturally depends on the values of δ that we obtain in (1.3), so we optimize the step where we apply exponent pairs. We consider the exponent pairs obtained from the application of A-and B-processes to the exponent pair (0, 1).
For (2), we provide a mean value theorem for Hecke polynomials (Lemma 3.3) that takes into account the sparsity of the coefficient sequence as in [24,Lemma 4]. The mean value theorem itself is rather simple to derive, but to bound the resulting expression in the case of prime-supported sequences we need sharp upper bounds for sums over Gaussian primes of the type In the integer case, the corresponding sum (with | arg p 1 − arg p 2 | ≤ h/X replaced by |p 1 − p 2 | ≤ h) may be bounded quite directly with Selberg's sieve, but our problem here is more involved. Writing p 1 = a + bi, p 2 = c + di, the conditions in the sum translate (more or less) to a 2 + b 2 and c 2 + d 2 being primes with a, b, c, d ≤ √ X and |ad − bc| ≤ h. We wish to apply a sieve, and we thus consider, for various values of |k| ≤ h and T 1 , T 2 ≤ X δ , the sums a,b,c,d≤ √ X ad−bc=k T 1 |a 2 +b 2 T 2 |c 2 +d 2 1. (1.4) This is similar to the divisor correlation a,b,c,d∈Z + bc≤X ad−bc=k 1 = n≤X τ (n)τ (n + k), albeit with slightly different boundary conditions and additional congruence conditions on the variables. We adapt (in Section 7) the work of Deshouillers and Iwaniec [5] on divisor correlations to evaluate (1.4) with a power-saving error term for T 1 , T 2 less than a small power of X. For the sieve approach to work, it is crucial that there is indeed a good error term and uniformity in all the parameters.
The application of this improved mean value theorem then importantly saves us a few factors of log X in certain parts of the argument, and this significantly reduces the value of the exponent that we obtain.
For (3), we prove a large value estimate for a prime-supported polynomial P (m) = p∼P a p λ m (p), where P = (log X) a , by applying a large value theorem to a suitable moment of P (m). Such a method was used in [15,Lemma 8], where a moment of length ≈ X was used, together with a simple large value theorem arising from the usual mean value theorem. In contrast, we raise P to a moment of length X α for suitable 0 < α < 1, and apply a Huxley-type large value theorem (see Corollary 5.3). This gives improved results for the number of large values m for which |P (m)| ≥ P −o(1) when a > 6. Remark 1.3. We believe that there is no fundamental obstacle in also establishing an analogue of the Matomäki-Radziwi l l theorem for cancellations of multiplicative functions in almost all narrow sectors 2 by using our lemmas on Hecke polynomials in place of the Dirichlet polynomial lemmas in [15].
It is plausible that the methods used in this paper could be adapted to finding almost primes in almost all very small circles, too. Indeed, finding Gaussian primes in circles tends to be easier than for sectors (since we do have tools like the Halász-Montgomery inequality and Watt's bound for Hecke polynomials when averaging over both t and m). For example, as mentioned in Section 1.1, one can find Gaussian primes of norm less than X in circles of area X 0.528 , whereas for sectors the best result works for an area of X 0.619 .
It should be possible to improve the exponent in Theorem 1.2 by incorporating Harman's sieve into our argument; to avoid complicating the arguments further, we do not pursue this improvement here. By y ∼ X and y X we mean X < y ≤ 2X and X y X, respectively. The norm a 2 + b 2 of n = a + bi ∈ Z[i] is denoted by N(n). For Gaussian integers n, m, we write n ≡ m if n = um for some unit u. We denote by P Z[i] the set of all Gaussian primes.
We define analogues of usual multiplicative functions for Gaussian integers as follows. If n = up 1 · · · p k , where p i ∈ Z[i] * are Gaussian primes and u ∈ {1, i, −1, −i} is a unit, we let µ(n) = 0 if p i = p j for some i = j, and otherwise µ(n) = (−1) k . If n is a unit times the power of a Gaussian prime p, then we let Λ(n) = log N(p) and otherwise Λ(n) = 0. We let τ (n) denote the number of d ∈ Z[i] * for which there exists m ∈ Z[i] with n = dm.
If k = 0 is an integer and p is a rational prime, we use v p (k) to denote the largest integer a such that p a | k.
The angular Hecke characters are given by with m ∈ Z and the corresponding Hecke L-function is given by Note that the problem reduces to the integer case if one considers Gaussian integers with their norm in a short interval, i.e. sums of the form x<N(n)≤x+h f (n) with f : Z[i] → C multiplicative. Indeed, if one writes g(k) = n:N(n)=k f (n), then g is multiplicative, divisor-bounded if f is, and one has x<N(n)≤x+h f (n) = x<k≤x+h g(k). The analogous remark holds for multiplicative functions defined on the ideals of any number field.
for Re(s) > 1. One can continue L(s, λ m ) meromorphically to the whole complex plane, and the resulting function is entire apart from a simple pole at s = 1 in the case m = 0. We denote λ(n) = λ 1 (n).
The distance of t to the closest integer(s) is denoted by t .

Structure of the paper
In Section 2, we reduce Theorem 1.2 and Theorem 1.1 to mean square estimates for Hecke polynomials using a standard Fourier expansion. We then derive some basic bounds for Hecke polynomials in Section 3. In Section 4, we establish pointwise bounds for smooth Hecke polynomials, in particular using the theory of exponent pairs. In Section 5, we apply the pointwise bounds from the previous section to obtain a Halász-Montgomery type estimate for Hecke polynomials and as its consequences several large value estimates for Hecke polynomials, including a large value estimate that works well for very short prime-supported Hecke polynomials. In Section 6, we show how to factorize mean squares of Hecke polynomials using the improved mean value theorem, and most importantly, how to bound the error term in the case of Hecke polynomials supported on the primes or almost primes. The bounding of the error term relies on Theorem 6.4, an additive divisor problem in progressions with power-saving error term, whose proof we postpone to Section 7. Our task in Sections 8 and 9 is then to put the above-mentioned tools together to prove Theorems 1.2 and 1.1, respectively. Finally, in Appendix A, we give a proof of a slight generalization of the theory of exponent pairs that was needed in Section 4, following work of Ivić.

Acknowledgments
The first author was supported by the Emil Aaltonen foundation and worked in the Finnish Centre of Excellence in Randomness and Structures (Academy of Finland grant no. 346307). The second author was supported by Academy of Finland grant no. 340098, a von Neumann Fellowship (NSF grant DMS-1926686), and funding from European Union's Horizon Europe research and innovation programme under Marie Sk lodowska-Curie grant agreement No 101058904. We thank Kaisa Matomäki for helpful comments, discussions and corrections on the manuscript.

Reduction to Hecke polynomials
Let k ∈ {2, 3} be fixed, let ε > 0 be sufficiently small and fixed, and let Let also For a Gaussian integer n, let where we recall that a ≡ b means that a = ub for some unit u. To prove Theorems 1.1 and 1.2, it suffices to prove the following.
Theorem 2.1. Let k ∈ {2, 3}, and let ε > 0 be small but fixed. Let h be as in (2.1), let P i be as in (2.2), and let β n be as in (2.3). Then

Reduction to mean values of Hecke polynomials
The distribution of Gaussian integers in narrow sectors is governed by the angular Hecke characters λ m with m ∈ Z and more precisely the Hecke polynomials N(n)≤X a n λ m (n).
Recall the definition of β n in (2.3). For m ∈ Z, define Lemma 2.2 (Reduction to Hecke polynomials). Let X be large, h be as in (2.1), and F be as above. Assume that for some function K = K(X) tending to infinity we have Proof. Let T = KX/h. By a truncated Fourier expansion [7,Lemma 2.1] for σ ∈ {−, +}. Hence, as β n ≥ 0 for any n, we have and thus for some σ ∈ {+, −} we have After expanding out the square to obtain a double sum m,m , the terms with m = m vanish as the integral over θ vanishes in this case. Thus, the previous expression is which we bound via the prime number theorem in Z[i] and the bound |c σ m | h/X as By the assumption (2.6) and the choice of T , this is small enough.
In the rest of this paper, our task is to prove (2.6).

Gaussian integers in narrow sectors
For later use we give the following simple bound for the number of Gaussian integers in a given sector.
possibilities for Re(m). Furthermore, given k, the real part uniquely determines Im(m). Hence the number of m with N(m) ≤ N and 3 Lemmas on Hecke polynomials

Bounds for Hecke polynomials
For the proofs of our main theorems, we shall need various estimates for Hecke polynomials N(n)≤N a n λ m (n).
Remark 3.1. Recall our convention that sums over n are taken over Z[i] * . Hence, if F (m) = N(n 1 )≤N 1 a n 1 λ m (n 1 ) and G(m) = N(n 2 )≤N 2 b n 2 λ m (n 2 ), then F (m)G(m) = N(n)≤N 1 N 2 c n λ m (n) with c n = n≡n 1 n 2 a n 1 b n 2 , where we recall that n ≡ a means n = ua for some unit u.
We begin with a simple mean value theorem for Hecke polynomials. signifies that the summation is only over primitive Gaussian integers, that is, those a + bi ∈ Z[i] * with (a, b) = 1. Moreover, we have Proof. See [7, Lemma 11.1 and Lemma 11.2].
The mean value theorem can be improved in the case of sparse coefficient sequences as follows.
Lemma 3.3 (Improved mean value theorem). Let N, T ≥ 1 and F (m) = N(n)≤N a n λ m (n) with a n ∈ C. Then Recall from Section 1.3 that arg n is only defined up to multiples of π/2, and thus | arg n 1 − arg n 2 | ≤ 1/T is satisfied if i k 1 n 1 and i k 2 n 2 lie in the same narrow sector for some integers k 1 , k 2 . 10T for m = 0 and g(0) = 1/(10T ). As g is continuous and the Fourier coefficients g(m) are absolutely summable, it follows that g(x) = m∈Z g(m)e(mx) for any x. Note furthermore that g(m) ≥ 0 for all m and g(m) 1/T for |m| ≤ T . Hence, ,N(n 2 )≤N a n 1 a n 2 m∈Z g(m)λ m (n 1 )λ m (n 2 ) ≤ T N(n 1 ),N(n 2 )≤N |a n 1 a n 2 | m∈Z g(m)e m arg n 1 − arg n 2 π/2 = T N(n 1 ),N(n 2 )≤N |a n 1 a n 2 |g arg n 1 − arg n 2 π/2 ≤ T | arg n 1 −arg n 2 |≤1/T N(n 1 ),N(n 2 )≤N |a n 1 a n 2 |, as desired.
Lemma 3.4 (A pointwise bound). Let 2 ≤ N ≤ N ≤ 2N , and let k ≥ 1 be a fixed integer. Let where each g i is either the Möbius function (of Z[i]), the characteristic function of Gaussian primes, the von Mangoldt function (of Z[i]), the constant function 1 or the log-norm function n → log N(n). We have Proof. By writing the sum over N(n) ∈ (N, N ] as the difference of a sum over N(n) ≤ N and a sum over N(n) ≤ N , we may assume that the summation in (3.3) is over N(n 1 · · · n k ) ≤ N . Moreover, we may assume without loss of generality that N − 1/2 is an integer.
Consider first the case k = 1, g 1 = 1. Denote c = 1/ log N . By the truncated Perron formula Move the integral to the line Re(s) = −σ = −(log(N + |m|)) −3/4 , noting that there is no pole as m = 0. Let C be the rectangle having the line segments [c − iN, c + iN ] and [−σ − iN, −σ + iN ] as two of its sides. By [3, Theorems 1 and 6] (applied with f = 1 and for s ∈ C, so the error arising from moving the integral is O((log |m|) 2/3 /N ), and we have Finally, note that this is exp(−(log N ) 1/10 ) as long as 0 < |m| ≤ exp((log N ) 10/9 ), by our choice of σ.
The cases with k = 1 and g i being equal to the Möbius function, the indicator function of Gaussian primes or the log-norm function are handled similarly, noting that if C is as above, for s ∈ C we have by an analogue of the Vinogradov-Korobov zero-free region for L(s, λ m ) [3, Theorem 2]. Finally, the cases k ≥ 2 follow from the case k = 1 by decomposing the sum to dyadic intervals N(n i ) ∈ (N i , 2N i ], for fixed N 1 , . . . , N k summing over the variable n i for which N i is largest using the case k = 1, and applying the triangle equality to the sum over the other variables.

Heath-Brown's decomposition
Next, we give a suitable version of Heath-Brown's identity for Hecke polynomials.
we have a n = 1 I (N(n)) for all n or a n = 1 I (N(n)) log N(n) for all n.
By splitting the sum P (m) over (P, P ] into subsums over intervals of the form (Q, Q(1+ (log P ) −B )] with B large enough (and one shorter interval) and applying the triangle inequality, it suffices to prove the claim with P ≤ P (1 + (log P ) −B ). Now, we write By the mean value theorem (Lemma 3.2) and the prime number theorem for Gaussian integers with classical error term, E 1 (m) satisfies property (1). By writing P (m) as a difference of sums over [1, P ] and [1, P ], we see that it suffices to prove the claim for sums of the form Fix an integer m ∈ [−T, T ]\{0} as in the lemma. By Heath-Brown's identity in Z[i] (which is derived precisely as in the case of Z) and (1 + δ)-adic decomposition, (3.4) may be written as where the constants c M 1 ,...,M 2k are bounded in magnitude by O k (1). By the triangle inequality, (3.4) is thus bounded by , and let P 0 ∈ {P, 2P }. Then, from the above we deduce that where E 2,j (m) arises from removing the summation condition N(n 1 · · · n 2k ) ≤ (1 + δ) j P , and from inserting the condition M 1 · · · M 2k ≥ δ 2k+10 P . One easily sees from the mean value theorem that E 2,j (m) satisfies condition (1). We can further estimate the product in (3.5) by bounding trivially as 1 all those terms for which M i ≤ exp((log T ) 19/20 /(4k)); the product of the remaining M i is P exp(−(log T ) 19/20 ). We have now arrived at the desired decomposition, since the Hecke polynomials

Pointwise bounds
The goal of this section is to establish Proposition 4.6, a pointwise bound for smooth Hecke polynomials. For stating the result, we need the notion of exponent pairs.

Exponent pairs
We define exponent pairs following Ivić [11,Chapter 2.3], but impose slightly milder conditions on the derivatives of the phase function, since the functions we apply the theory to do not quite satisfy the original definition. (1) f ∈ C ∞ (I).
(2) For all t ∈ I and all integers 1 ≤ r ≤ R Definition 4.2. We say that a pair of real numbers (κ, λ) with 0 ≤ κ ≤ 1/2 ≤ λ ≤ 1 is an exponent pair if the following holds for some integer R ≥ 1.

For any A, B, M ≥ 1 and any
We call the least integer R with this property the degree of (κ, λ).
The difference between our definition and [11] is that there only the case M = O(1) is considered (and the derivative bound is assumed for all r).
Trivially, (0, 1) is an exponent pair. We recall the A and B processes that allow us to generate infinitely many exponent pairs from a given pair.

Lemma 4.3 (A and B processes). (A) If (κ, λ) is an exponent pair, so is
is also an exponent pair.
Proof. The claim is a slight generalization of [11, Lemmas 2.8 and 2.9] (see also [18]), since our conditions for exponent pairs allow M to be unbounded. The proof works similarly in our case; see Appendix A for the details.
In our proofs we will use the following exponent pairs.

Pointwise bounds
For the proof of Proposition 4.6 below, we will need to evaluate and estimate derivatives of x → arctan(y/x). Lemma 4.5. Let n ≥ 1 be an integer and let y > 0. We have which agrees with the claim for n = 1. Moreover, for n ≥ 1, we have The claim now follows by induction. (i) For any fixed exponent pair (κ, λ) and any fixed ε > 0 small enough in terms of (κ, λ), there exists an integer R such that the following holds. If I ⊂ [0, π/2] is an interval such that all the real solutions of Im((1 + i tan(t)) k ) = 0 with k = 1, . . . , R have distance ≥ N −ε 2 to I, then we have and if either a n = 1/N(n) or a n = (log N(n))/N(n), then

2)
and if either a n = 1/N(n) or a n = (log N(n))/N(n), then Remark 4.7. One may at first wonder about the need in part (i) to excludes some small sectors. The estimate should be true even without it, but our proof method does not work without this condition. The exponential sum (4.1) is interpreted as a two-dimensional exponential sum involving the phase function m arctan(y/x) π/2 , and to apply the theory of exponent pairs to this function we need to know that its derivatives do not vanish, so we need to exclude certain narrow sectors of the (x, y)-plane inside of which the derivatives of some bounded order do vanish. See also Remark 4.9.
Remark 4.8. Part (i) of the lemma gives us explicit power savings in the range |m| ε ≤ N ≤ |m| (using the exponent pair with k large enough in terms of ε). The most critical case for the proof of our main theorem is N ∈ [|m| 1/2 , |m| 2/3 ]; in this range the estimate of part (ii) is trivial. However, when N ≥ |m| 1−δ for somewhat small δ, part (ii) is stronger.
Proof. (ii) By partial summation, it suffices to prove the first claim in part (ii). By writing the sum over N < N(n) ≤ N as a difference of two sums, it suffices to prove (4.2) with the summation condition N < N(n) ≤ N changed to N(n) ≤ N .
We may assume |m| ≤ N 3/2 , since otherwise the claim is trivial. Let T = |m| + N 3/8 . By a truncated form of Perron's formula ([23, Corollary 2.4 of Section II.2] applied to the sequence a k = N(n)=k λ m (n)), we have We shift the integration to the line Re(s) = 1/2 and use the estimate which follows from [13] and the Phragmén-Lindelöf principle [11,Appendix A.8], to bound the horizontal integrals. We obtain Using (4.3) again to bound the integral, the claim follows.
(i) By partial summation, it suffices to prove the first claim in part (i). By writing the sum over N < N(n) ≤ N as a difference of two sums, it suffices to prove (4.1) with the summation condition N < N(n) ≤ N changed to N(n) ≤ N . Furthermore, we may assume that |m| ≥ N 3/4 , since otherwise the claim follows directly from part (ii).
Note that Note also that λ(x + iy) = λ(y + ix). Lastly, observe that the contribution of n of the form x + ix or x + 0i to the left-hand side of (4.1) is N 1/2 , which is admissible.
Hence, it suffices to prove (4.1) with the sum restricted to the region n = x + iy with 1 ≤ y ≤ x. Thus, our task is to bound We can write the condition arctan(y/ By dyadic decomposition, we can bound Now, for a given y ≥ 1, consider the function By Lemma 4.5, for any n ≥ 1 we have Expanding out (x + iy) n and using the triangle inequality, for 1 ≤ y ≤ x we obtain On the other hand, Im((x + iy) n ) = yx n−1 P n (y/x) for some polynomial P n (t) of degree ≤ n − 1 and constant coefficient n, and the zeros of P n in the region [0, 1] are precisely the zeros of Im((1 + it) n ) = 0. By the assumption on I, For any x ∈ yJ and 1 ≤ n ≤ R, the number y/x is distance N −ε 2 away from any solution to Im((1 + it) n ) = 0, so we have |P n (y/x)| n N −nε 2 when x ∈ yJ (since if P (t) is a monic polynomial of degree n and t 0 is at least δ > 0 away from all of the roots α i of P , then |P (t 0 )| = 1≤i≤n |t 0 − α i | ≥ δ n ). Therefore, for 1 ≤ n ≤ R and x ∈ yJ we have We conclude that f ∈ F yJ (A, B, O(N Rε 2 ), R), where A = |m|y/X 2 and B = X. We have A ≥ 1 if y ≥ X 2 /|m|, and in the case y < X 2 /|m| we use the trivial estimate for the inner sum in (4.5). Hence, by the definition of exponent pairs, if ε > 0 is small enough we have, using X ≤ N 1/2 and |m| ≥ N 3/4 , Substituting this to (4.4) we see that as desired.
Remark 4.9. Note that it was important in the proof of Proposition 4.6(i) that I contains no solutions to Im((1 + i tan(t)) k ) = 0. Indeed, otherwise the inner sum over x in (4.5) would contain zeros of the kth derivative of the phase function f , so the theory of exponent pairs would not be applicable.

Halász-Montgomery type estimate
In this section, we employ Proposition 4.6 to establish large value theorems for Hecke polynomials that will be key to our arguments in Section 8. These large value estimates are based on the following estimate of Halász-Montgomery type.
(i) Let (κ, λ) = (0, 1/2) be a fixed exponent pair, and let J be a large enough integer. Let ε > 0 be small but fixed, and suppose that a n = 0 whenever arg(n) is within distance Proof. (i) We may assume that N ≤ T 1+ε for any fixed ε > 0, since otherwise the claim follows directly from the mean value theorem (Lemma 3.2). Let J be an integer large enough in terms of (κ, λ), and let S be the set of complex numbers whose argument is at least N −ε 2 away from any solution to Im((1+i tan(t)) k ) = 0 with k = 1, . . . , J. Let T = {m r } r≤R with R = |T |. We may assume that R ≤ T , as otherwise the claim follows from Lemma 3.2. By the duality principle (see e.g. [12,Chapter 7]), the statement is equivalent to the claim that, for any complex numbers c r and distinct integers m r ∈ [−T, T ], we have Opening the square and using |c r ||c s | |c r | 2 + |c s | 2 , the left-hand side of (5.1) becomes N r≤R |c r | 2 + r,s≤R r =s |c r | 2 N(n)≤N n∈S λ mr−ms (n) . (5.2) By Proposition 4.6(i) and the fact that S is a union of O(1) intervals, for r = s we have Note that by definition 0 ≤ κ ≤ 1/2 ≤ λ for any exponent pair (κ, λ), and moreover we assumed that κ > 0 or λ > 1/2. Since N ≤ T 1+ε , we thus have for small enough ε > 0. Hence, the second term on the right of (5.3) can be removed, and the claim follows by substituting (5.3) into (5.2).
(ii) The proof of this part is identical, except that we use Proposition 4.6(ii) instead of Proposition 4.6(i) and do not restrict to n ∈ S.

Large value estimates
We now deduce from Proposition 5.1 a large value estimate, refined using Huxley's subdivision trick.
Lemma 5.2 (A large value estimate). Let N, T ≥ 2, V > 0, and let F (m) = N(n)≤N a n λ m (n) with a n ∈ C. Write G = N(n)≤N |a n | 2 , and let T denote the set of m ∈ [−T, T ] ∩ Z for which |F (m)| ≥ V .
(i) Let (κ, λ) = (0, 1/2) be a fixed exponent pair, and let J be a large enough integer. Let ε > 0 be small but fixed, and suppose that a n = 0 whenever arg(n) is within distance N −ε 2 of some real solution to Im((1 + i tan(t)) k ) = 0 with k = 1, . . . , J. Then, we have Proof. (i) We may assume that N and T are large enough, as otherwise the claim is trivial. Let T 0 > 0 be a parameter to be chosen. We combine the Halász-Montgomery type estimate of Proposition 5.1(i) with Huxley's subdivision. Thus, we split T into subsets T j = [jT 0 , (j + 1)T 0 ) ∩ T with |j| T /T 0 + 1 and estimate By Proposition 5.1(i) (applied to the coefficient sequence a n λ jT 0 (n)), we may bound the right-hand side as where we wrote a = κ and b = (λ − κ + 1)/2. Let T 0 = V 2/a N −b/a−2ε/a G −1/a , so that the second term in (5.5) contributes |T |V 2 N −ε . We then have from (5.4) which is the desired bound (after adjusting ε).
(ii) The proof of this part is identical, except that we apply Proposition 4.6(ii) to obtain (5.5) also with a = 1/3, b = 1/2 and with the N ε factor replaced by (log(N + T )) O(1) .
Remark 5.4. Applying the same argument, but using in place of Lemma 5.2 a large value estimate following directly from the mean value theorem (Lemma 3.2), gives for the number of large values a bound of for a > 1.

Density bounds
We apply Lemma 5.2 to produce some "density bounds" (in the spirit of estimates towards the density hypothesis) for the number of large values of Hecke polynomials. These bounds will be employed in the proof of Theorem 1.2. In the integer setting, a different density bound was used in [16,Lemma 4.1] to study almost primes in almost all short intervals.
provided that one of the following holds.
(ii) We have β ≥ 2/3 and for some large absolute constant C 0 .
Proof. (i) By Lemma 5.2(i), the number of large values in question is The first term in (5.9) is and this is ≤ T (2−ε)σ when the second inequality in (5.7) holds. (Note that the denominator on the right hand side of (5.7) is positive since β ≥ 2/5 and κ ≤ 1/2.) (ii) By Lemma 5.2(ii), the number of large values in question is The first term here is admissible as in part (i), and the second term is and this is ≤ T (2−ε)σ when the second inequality in (5.8) holds. (Note that the denominator in (5.8) is positive since β > 1/4.) Lemma 5.6 (A density bound using amplification). Let ε > 0 be fixed and small enough, and let A ≥ 2 be fixed.
, A ≥ 2, T ≥ 2 and P = T β . Let P (m) = P ≤N(n)≤10P a n λ m (n)/N(n), where a n are complex numbers with |a n | ≤ τ (n), and let F (m) for some large absolute constant C 0 .
Note that by the divisor bound τ +1 (n) |n| o(1) and Cauchy-Schwarz we have Using this together with Lemma 5.2(ii) and recalling (5.12), we deduce that the number of large values in question is Elementary manipulation shows that this is T (2−ε)σ when (5.11) holds.

Factorizing Hecke polynomials and bounding the error term
Our next lemma shows how to factorize certain Hecke polynomials arising in our arguments. for some K > K ≥ 2 and for some complex numbers a k , b n . Let H ≥ 1. Denote Proof. The proof is analogous to that of [24, Lemma 2], using the improved mean value theorem (Lemma 3.3) in place of its integer analogue, [24,Lemma 4].
We use the following result to handle the error term in Lemma 6.1. The proof requires a substantial amount of work, spanning the rest of this section and the next section. Proposition 6.2. Let X, T ≥ 2. Let r ≥ 0 be a fixed integer, let ε > 0 be small enough in terms of r, and let I 1 , . . . , I r be pairwise disjoint intervals of form otherwise.
The proof of the proposition uses the fundamental lemma of the sieve together with the following estimate for a divisor correlation of a certain kind, where it is crucial that the moduli are allowed to go up to a power of x. This estimate is based on the method of Deshouillers and Iwaniec [5] for proving a power-saving estimate for n≤x τ (n)τ (n + 1) (with error term O ε (x 2/3+ε )). Proposition 6.4 (A divisor problem in progressions with power-saving error term). Let δ > 0 be a sufficiently small fixed constant. Let x ≥ 2, and let T 1 , T 2 , k and be integers satisfying 1 ≤ T 1 , T 2 , |k| ≤ x δ with T 1 , T 2 square-free and (k, T 1 T 2 ) = 1. Let   a, b, c) is a certain function whose value only depends on the largest powers of p dividing a, b and c and which is symmetric in b and c. Explicitly, we have the following formulas, where p is a prime and v ≥ 0: • For any prime p, we have .
(In particular f p (1, 1, 1 Remark 6.5. The result holds even without the condition (k, T 1 T 2 ) = 1 (with more complicated formulas for f p (a, b, c)), and we only utilize this assumption at the end of the proof when computing the main term. Likely the result extends to non-square-free T 1 , T 2 as well. We have presented the simplest result that fits our needs, as computing the main terms in more general cases gets quickly rather laborious.
Below we show how Proposition 6.4 implies Proposition 6.2. Section 7 is then devoted to the proof of Proposition 6.4.
Our claim follows by summing over p 1 , . . . , p k−1 : the number V is bounded by V y (log y) 2 + k<10 log log y k r−1 · k · p 1 ∈I 1 ,...,p k−1 ∈I k−1 ηy p 1 · · · p k−1 log y for some intervals I i = I i (k) that are of form [z j , z 2 j ], 1 ≤ j ≤ r, and this is bounded, for any ε > 0, by ε y (log y) 2 + k∈N ηy log y k r (log 2 + ε) k ηy log y .
Denote by C η the supremum of values of y with η −20 log log y ≥ y. One can check that C η exp((log η) 2 /2). We thus have, for given n and C η ≤ z ≤ 2X, that the number of v ∈ [z, (1 + η)z] with α vn = 0 is O(ηz/ log z). For z ≤ C η we use the trivial bound O(C η ) for the number of such v. Hence, the right hand side of (6.2) is bounded by As above, the number of n, N(n) ≤ y with α n = 0 is O(y/ log y). Thus, the contribution of the C η term is bounded by T C 2 η X(log X) , which suffices, as T ≤ η 2 exp(−(log η) 2 )X/ log X. The contribution of the rest is bounded by to which we apply a dyadic decomposition. The contribution of N(n) ∈ [y, 2y] to the above sum is bounded by 1/((log y)(log X/y) 2 ), and thus we obtain an upper bound of T η 2 X/(log X) .
Writing n 1 = a + bi, n 2 = c + di with 0 ≤ a, b, c, d ≤ √ 2X, we thus have |ad − bc| ≤ 2X/T . Let δ be as in Proposition 6.4. Next, we discard the contribution of the case min(a, b, c, d) ≤ X 1/2−δ/10 . This corresponds to min(| arg n 1 |, | arg n 2 |) X −δ/10 , where we recall our convention on arg n being defined modulo π/2. We handle the case 0 ≤ arg n 1 X −δ/10 , the other case is similar. There are O(X 1−δ/10 ) Gaussian integers n 1 with N(n 1 ) ≤ 2X in the sector 0 ≤ arg n 1 X −δ/10 , and given n 1 , the number of n 2 with N(n 2 ) ≤ 2X, 0 < | arg n 2 −arg n 1 | ≤ 1/T is by Lemma 2.3 bounded by O(X/T ). Hence, the contribution of this case to the left-hand side of (6.1) is which is small enough. Hence, we have reduced matters to bounding Note that α a+bi = 0 in particular implies that N(a + bi) = a 2 + b 2 has no prime factors which lie in [2, . Let the set of such integers be Q. Hence, the previous sum is at most To treat the conditions a 2 + b 2 , c 2 + d 2 ∈ [X, (1 + η)X], we perform a smoother-thandyadic decomposition over a, b, c, d.
For a fixed tuple (J i 1 , J i 2 , J i 3 , J i 4 ), let b i 1 , b i 2 , b i 3 , b i 4 be nonnegative smooth functions with the following properties for all 1 ≤ k ≤ 4: With these choices we have T X 2 (1) For 1 ≤ m ≤ 4X 2 , we have where δ is as in Proposition 6.4; (3) For any multiplicative function g : N → [0, 1] with 0 ≤ g(p) < 1 for all p | Π and with g satisfying the dimension condition Note that we may insert the condition (D, k) = 1 to (6.5) and (6.7): If (6.5) holds without the condition (D, k) = 1 for given (λ D ), it also holds with the condition present, as for any m we have where by m/(m, k ∞ ) we denote the largest divisor of m coprime with k. If (6.7) holds without the condition (D, k) = 1 for all g as in (6.7), one may then replace g(D) by g(D) · 1 (D,k)=1 to recover (6.7).
Hence, we may upper bound (6.4) by a,b,c,d ad−bc=k m 1 n 1 |a 2 +b 2 m 2 n 2 |c 2 +d 2 Noting that supp(b i j ) ⊂ [X 1/2−δ/10 , √ 2X], we may apply Proposition 6.4 to evaluate the previous expression as Denote the value of the integral by I = I i 1 ,i 2 ,i 3 ,i 4 . By multiplicativity, we may write the above as (Recall that D is square-free.) Note that the value of g p (k, D) depends only on the exponents v p (k) and v p (D) of p in k and D and that g p (k, 1) = f p (k, 1, 1). In particular, g p (1, 1) = 1.
Plugging (6.9) into (6.8), we obtain The error term is negligible when compared to the right-hand side of (6.1). To evaluate the sum over D we apply the fundamental lemma. To do so, we have to check the dimension condition (6.6). Fix k and let g(p) = g p (1, p) for primes p, extending g multiplicatively to all integers dividing Π. We compute, using (6.10) and the formulas for f p in Proposition 6.4, that for p | D, p ≡ 1 (mod 4) we have One easily checks that g(p) < min(10/p, 1), say. Hence, by Mertens's theorem, g satisfies the dimension condition (6.6) (for some K = O(1)) and we have, by (6.7), We bound this in a routine way using the prime number theorem in arithmetic progressions and the fact that z≤p≤z 2 (1 + 4/p) 1 for any z ≥ 1, obtaining the bound Plugging the obtained bound to (6.11), we can upper bound the main term there by The sum over k is bounded by routine methods. Note that f p (k, 1, 1) ≤ p/(p−1) ≤ 1+2/p. Hence, if ω(m) denotes the number of distinct prime factors of m ∈ Z + , we have Thus, (6.12) is bounded by We are left with estimating the sum of integrals. Recall that The integral over t is supported in those values for which AD ≤ t ≤ AD(1 + η) 6 and BC ≤ t ≤ BC(1 + η) 6 . In particular, in order for I to be non-zero we must have BC(1 + η) −6 ≤ AD ≤ BC(1 + η) 6 . The inner integrals are bounded by log((1 + η) 3 ), resulting in the bound By symmetry, we also have the bound I BCη 3 , and thus Furthermore, as we consider only (J i 1 , . . . , J i 4 ) ∈ J , we must have A 2 + B 2 ≤ X(1 + η) and A 2 (1 + η) 6 + B 2 (1 + η) 6 ≥ X. Hence, in particular, the set [A, The analogous result holds for C and D.
Finally, note that the bound (6.13) may be written as I η ABη 2 CDη 2 , the terms All in all, we have Noting that in the inner sums A, B, C and D run over O(1) values, we obtain as desired.
7 An additive divisor problem -proof of Proposition 6.4 In this section we prove Proposition 6.4. As our argument closely follows the proof in [5], we are at times brief with the exposition, referring the reader to [5] for details.

Rephrasing
We first note a parametrization for the solutions of x 2 + y 2 ≡ 0 (mod T ) for square-free T . For a given x, let g = (x, T ). Then one has (y, T ) = g as well, and one may take the common factor g out. For invertible x , y , the solutions of x 2 + y 2 ≡ 0 (mod T ) are given by a set of lines of form y ≡ tx (mod T ), where t varies over the solutions of t 2 ≡ −1 (mod T ). (Indeed, if y ≡ tx (mod T ) for such t, then clearly x 2 + y 2 ≡ 0 (mod T ), and if x 2 + y 2 ≡ 0 (mod T ), then (y /x ) 2 ≡ −1 (mod T ) and hence we can write y ≡ tx (mod T ) with t ≡ y /x (mod T ).) Note that m 1 m 2 − m 3 m 4 = k, (k, T 1 T 2 ) = 1 and T 1 | m 2 1 + m 2 3 imply (m 1 , T 1 ) = (m 3 , T 1 ) = 1. Similarly (m 2 , T 2 ) = (m 4 , T 2 ) = 1. Hence, our task is to estimate for each t

Eliminating m 2
We start by eliminating the variable m 2 in our sum. Note that by the mean value theorem and the bound |b 2 (t)| 1/M 2 , we have, for m i as in (7.1), From this and the divisor bound, we deduce that for any ε > 0. The error is negligible. By elementary number theory, This equation is solvable in m 4 ∈ Z if and only if g := (t 2 m 1 − m 3 , T 2 m 1 ) | k. In this case the solution set is where (t 2 m 1 − m 3 )/g is the inverse of (t 2 m 1 − m 3 )/g modulo T 2 m 1 /g. For brevity, we denote this congruence by m 4 ≡ R m 1 ,m 3 (mod T m 1 ,m 3 ). Hence,

Eliminating m 4
The argument is similar to [5, Section 3], so our exposition is brief. By the Poisson summation formula, one is able to treat sums of form n≤x n≡a (mod q) f (n) for C 1 functions f . This leads to 3) The first term in (7.2) corresponds to a main term, while the E term where the sum ranges over h = 0 corresponds to an error term. Let us write in (7.3) where E ≤H corresponds to the summation condition 0 < |h| ≤ H and E >H corresponds to the summation condition |h| > H. We show that the sum over h is small enough, first taking care of the tails |h| > H := x 10δ (say), after which we consider small values of h.

Estimation of the tails
Write g(t) = b 2 (tm 3 /m 1 )b 4 (t). Then the integral in (7.3) may be written as which, after partial integration and the triangle inequality, is bounded by for any K > 0. One computes |g (K) (t)| K x K(−1+2δ) . Since |h| > x 10δ and T m 1 ,m 3 x 1+δ , by taking K to be a large enough constant we obtain an upper bound of h −2 x −10 (say) to the above. Plugging this into (7.3) gives us (say), which is sufficient.

Estimation of contribution of small h
We are interested in bounding By the triangle inequality, for fixed m 1 , h and t we reduce to bounding Similarly as when eliminating m 4 , we apply the Poisson summation formula to the sum over m 3 . We bound (7.5) by where the integral is over the support of b 3 . We consider the contribution of | | > x 10δ and | | ≤ x 10δ separately. For large | | > x 10δ , the idea is to bound the sum over r trivially as L and estimate the integral by integrating by parts K times for a large constant K. Write One sees that if f 1 and f 2 both are compactly supported functions satisfying the derivative bound |f (k) i (s)| k C i s −k in their domain for all k ∈ Z ≥0 and some constants C i independent of k, then f 1 + f 2 and f 1 f 2 satisfy such bounds as well with the corresponding factors C 1 + C 2 and C 1 C 2 . Since s → s/m 1 , s → b 2 (ts/m 1 ), s → b 4 (s), s → b 2 (ts/m 1 ), s → b 4 (s) and s → b 3 (s) are such functions with C = max(M 1 /M 3 , M 3 /M 1 ) x δ , it follows that Hence, by integrating the integral over s in (7.6) by parts K times and estimating the sum over r trivially as L, we bound the contribution of | | > x 10δ by for K a large enough constant. We then consider the contribution of small | | ≤ x 10δ . In this case we estimate the integral in (7.6) trivially as O(x 2δ ), and our task is to obtain a non-trivial bound for The idea is that the (7.7) is essentially a Kloosterman sum for which we have power-saving bounds. However, the details require some attention.
We begin by writing S m 1 ,h as k/g · (t 2 m 1 − r)/gh T 2 m 1 /g e r L , (7.8) where a denotes the inverse of a modulo T 2 m 1 /g. We separate the condition r ≡ t 1 m 1 (mod T 1 ) by writing We perform the substitution t 2 m 1 − r → r in the inner sum above, obtaining Note that the translations by t 2 m 1 do not affect the absolute value of the sum. We then let r = gs in (7.9) to get Let L 1 denote the largest divisor of L/g coprime with T 2 m 1 /g and let L 2 = L/(L 1 g). Any s (mod L/g) may be written uniquely as L 2 a + b, where b is an integer modulo L 2 and a is an integer modulo L 1 . Note that L 2 ≡ 0 (mod T 2 m 1 /g) and that (s, T 2 m 1 /g) = 1 if and only if b is invertible modulo L 2 . Hence, the above may be written as (7.10) By Bezout's lemma, we may write 1/(L/g) as c/L 1 + d/L 2 for some c, d ∈ Z. This gives 1/T 1 = c /L 1 + d /L 2 for c = cL/(T 1 g) and d = dL/(T 1 g). Plugging these in (7.10) gives The value of the a-sum is independent of b by the coprimality of L 1 and L 2 , and it is bounded by L 1 in absolute value, so we obtain an upper bound This inner sum is finally a Kloosterman sum, to which we apply Weil's upper bound [12,Corollary 11.12] to get, for any ε > 0, where in the last step we used L ≤ T 1 T 2 m 1 ≤ x 2δ m 1 Plugging this upper bound to (7.6), we bound E ≤H in (7.4) by which is x 1.6 , say, for δ > 0 small enough.

Calculating the main terms
We finally evaluate the main term (7.11) in (7.2). Recall from Section 7.2 that T m 1 ,m 3 = T 2 m 1 /g = T 2 m 1 /(t 2 m 1 − m 3 , T 2 m 1 ). We write (7.11) as We compute the sum inside the integral. First, by Möbius inversion, Note that if b is a smooth, compactly supported function, then by partial summation for any a, q ∈ N we have Plugging this into (7.13), summing the error over g, e and m 1 (noting that we may restrict to e x 1+δ ) and integrating over t in (7.12) gives a total error x 1+O(δ) , which is acceptable. The main term in (7.13) then becomes By another application of (7.14), the inner sum here may be written as and again the error is found to be negligible. Thus, the main term (7.12) is (up to admissible errors) equal to µ(e) lcm(T 1 , ge) · 1 lcm(ge/(ge, T 2 ), (ge, T 1 )/(ge, T 1 , t 2 − t 1 )) . (7.15) The integral over t, which agrees with the one given in Proposition 6.4, is a normalization factor depending only on the chosen functions b i . We are left with computing the sum S t 1 ,t 2 := 1 T 2 g|k g e∈N µ(e) lcm(T 1 , ge) · 1 lcm(ge/(ge, T 2 ), (ge, T 1 )/(ge, T 1 , t 2 − t 1 )) . (7.16) and summing it over t 2 i ≡ −1 (mod T i ). Some manipulation yields At this point we invoke the assumption (k, T 1 T 2 ) = 1, from which it follows that (g, T 1 T 2 ) = 1. The sum simplifies to The sum over e is multiplicative, and thus by Euler products Recalling that T 1 , T 2 are square-free, for e = p a prime the numerator equals p v for some v ∈ {0, 1, 2}. The case v = 2 occurs if and only if p | T 1 , T 2 , t 1 − t 2 , and v = 1 occurs if p divides T 1 T 2 but not (T 1 , T 2 , t 2 − t 1 ). Note that if v = 2 occurs for some p, then S t 1 ,t 2 vanishes. Hence we may write We now sum S t 1 ,t 2 over all t 1 (mod T 1 ), t 2 (mod T 2 ) satisfying t 2 i ≡ −1 (mod T i ). We have (and g p (1, 1) = 1). Combining (7.15), (7.17) and (7.18) we conclude the proof of Proposition 6.4.

Proof of Theorem 1.2
In view of Lemma 2.2, Theorem 2.1 for k = 2 (and thus Theorem 1.2) follows from the following proposition.
For the proof of this proposition (as well as for Proposition 9.1 below), we need the following mean square estimate of prime Hecke polynomials; the strength of the exponents in this result determines our exponent C. Proposition 8.2 (Sparse mean squares of Hecke polynomials over primes). Let ε > 0 be small but fixed. Let X ≥ X ≥ X/2 ≥ 2, and let P (m) = X ≤N(p)≤X λ m (p)/N(p). Let T ⊂ [−X, X] ∩ Z satisfy |T | X 20/363+ε , (8.1) and suppose that for some F ∈ [X ε/2 , X 2ε ] and some Hecke polynomial

Then for any
Let us first see how Proposition 8.2 implies Proposition 8.1.
Proof of Proposition 8.1 assuming Proposition 8.2. Let ε > 0 be small enough. Write T = X/(log X) C−ε and let η be a parameter tending to 0 slowly in terms of X. Applying Lemma 6.1 with H = 1/ log(1 + η), we obtain, with where c n = 1 N(n) The second sum on the right of (8.2) is η 2 /(log X) 2 = o(1/(log X) 2 ) by Proposition 6.2. For the first sum on the right of (8.2) we take the maximum over v. Let the maximum be attained by v = v 0 , and denote P 1 (m) = A v 0 ,H (m) and P (m) = B v 0 ,H (m), so that , P (m) = We shall in fact prove a bound of (log X) −2−ε 2 . Note that P 1 = (log X) C−1+O(ε) . Let The contribution of T 1 to the sum in (8.3) is bounded via the pointwise bound |P 1 (m)| ≤ P −ε 2 1 and the improved mean value theorem (Lemma 3.3), yielding ] and a n = 1/N(n) if n is a Gaussian prime and a n = 0 otherwise. We estimate this sum using Proposition 6.2 and see that the previous expression is since T = X/(log X) C−ε and P 1 > log X.
We are the left with the contribution of T . Since Secondly, note that if and if b n are the coefficients of F (m), then b n are supported in F 1−ε 2 ≤ N(n) ≤ F and Finally, note that, since F = T ε+o(1) , for m ∈ T we have In view of these properties of T , we may apply Proposition 8.2 to deduce (8.4).
We then turn to the proof of Proposition 8.2.
with R a large enough constant. Then by the mean value theorem (Lemma 3.2), the divisor bound, and the fact that |a n,j | ≤ log N(n) we have by Lemma 2.3 if ε > 0 is small enough. Arguing similarly, we see that for all 1 ≤ k ≤ J we have Hence, it suffices to show that For any interval J ⊂ [0, π/2], let M j,J (n) be the same sum as M j , but with the additional summation condition arg(n) ∈ J . By the pigeonhole principle, there exist some intervals J 1 , . . . , J J of length X −2ε 4 such that Now, by permuting the indices if necessary, it suffices to show that Let us write With this notation, it suffices to show that We have now decomposed our Hecke polynomial in the desired manner. We recall here for convenience that by the above analysis we have the constraints Moreover, for later use we note the following important properties of N 1 (m): (a) The coefficients of N 1 (m) are supported in arg(n) ∈ I, where I is some interval that is X −ε 4 away from all the solutions to Im((1 + i tan(t)) k ) = 0 with k = 1, . . . , R (this follows directly from the construction of I 1 , . . . , I r in (8.8)). (b) The coefficients of N 1 (m) 2 are supported in arg(n) ∈ I , where I is some interval that is X −ε 4 away from all the solutions to Im((1 + i tan(t)) k ) = 0 with k = 1, . . . , R (this is because if J 1 = [α − δ, α + δ], the coefficients of N 1 (m) 2 are supported in arg(n) ∈ [2α − 2δ, 2α + 2δ], and by the construction of I 1 , . . . , I r in (8.8) the interval [2α − 2δ, 2α + 2δ] is X −ε 4 away from all the solutions to Im((1 + i tan(t)) k ) = 0 with k = 1, . . . , R.).
Step 2: Splitting of the summation range and conclusion. Define Observe for later use that, since N 1 N 2 X 1−o(1) and ε > 0 is small, by (8.11) we have (8.12) if We split the proof of (8.12) into cases depending on the size of N 1 .
Case 2: N 1 ∈ (X 1/2−ε , X 3/4 ). By property (a), the Hecke polynomial N 1 (m) is the restriction of a smooth Hecke polynomial to a region where Proposition 4.6(i) is applicable. By Proposition 4.6(i) with the exponent pair (κ, λ) = (0.02381, 0.8929) as in Lemma 4.4, we see that T σ is empty unless In the range (8.17), the left-hand side of (8.18) is maximized at β = 1/2 − ε and the right-hand side of (8.18) is minimized either at β = 1/2 − ε. Hence, (8.13)  Now we apply Lemma 5.5(i) to N 1 (m) 2 with the exponent pair (κ, λ) = (0.05, 0.825) as in Lemma 4.4 (noting that by property (b) the coefficients of N 1 (m) 2 are supported in the set required for the application of Lemma 5.5(i)). We deduce that (8.13) holds provided that In the range (8.21), the right-hand side is minimized at β = 1/3 − ε, in which case the previous inequality implies Combining all the above cases, (8.13) follows, and this was enough to complete the proof of Proposition 8.1.
9 Proof of Theorem 1.1 By Lemma 2.2, Theorem 2.1 for k = 3 (and thus Theorem 1.1) will follow from the following proposition.