# Complex moments of class numbers with fundamental unit restrictions

Jérémy Dousselin

► To cite this version:

Jérémy Dousselin. Complex moments of class numbers with fundamental unit restrictions. 2024. [hal-04667983]

HAL Id: hal-04667983

https://hal.science/hal-04667983v1

Preprint submitted on 5 Aug 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Complex moments of class numbers with fundamental unit restrictions

Jérémy Dousselin

ABSTRACT. We explore the distribution of class numbers $h(d)$ of indefinite binary quadratic forms, for discriminants $d$ such that the corresponding fundamental unit $\epsilon_d$ is lower than $d^{1/2+\alpha}$, where $0 < \alpha < 1/2$. To do so we find an asymptotic formula for $z^{th}$-moments of such $h(d)$'s, over $d \le x$, uniformly for a complex number $z$ in a range of the form $|z| \le (\log x)^{1+o(1)}$, $\Re(z) \ge -1$. This is achieved by constructing a probabilistic random model for these values, which we will use to obtain estimates for the distribution function of $h(d)$ over our family. As another application, we give an asymptotic formula for the number of $d$'s such that $h(d) \le H$ and $\epsilon_d \le d^{1/2+\alpha}$ where $H$ is a large real number.

## 1 Introduction

Let $\mathcal{D} := \{d \in \mathbb{N} : d \equiv 0, 1 \pmod 4\}$, and $d$ is not a square} be the set of positive discriminants. For $d \in \mathcal{D}$, let $h(d)$ be the number of equivalence classes of primitive binary indefinite quadratic forms $ax^2+bxy+cy^2$ of discriminant $d = b^2-4ac$. Ever since Gauss' 200 years old *Disquisitiones Arithmeticae*, the study of the class number $h(d)$ is still active, and many questions remain unanswered. While we know a lot about binary forms corresponding to negative discriminants, little is known about its positive counterpart. For example, Heilbronn [6] proved in 1934 that $h(d) \to \infty$ when $d \to -\infty$, but it is still an open problem to know if $h(d) = 1$ for infinitely many positive discriminants. The main difference between these cases is the presence of non-trivial units, in the case $d > 0$, which affects the size of $h(d)$. This is explained by Dirichlet's Class Number Formula, which states that

$$ \forall d \in \mathcal{D}, \quad h(d) = \frac{L(1, \chi_d)\sqrt{d}}{\log \epsilon_d}. $$

Here and throughout $\chi_d = (\frac{d}{\cdot})$ is Kronecker's symbol, and $L(s, \chi_d)$ is the Dirichlet $L$-function attached to it. The fundamental unit $\epsilon_d$ will be defined by $(t + \sqrt{du})/2$, if $(t, u) \in \mathbb{N} \times \mathbb{N}^*$ is the smallest solution in $t$ of the Pell equation $t^2 - du^2 = 4$. We also define, for $A \subset \mathbb{R}$, $A(x) := \{a \in A : a \le x\}$.

Gauss already understood that the irregularities of $h(d)$ are due to huge variations of the regulator $\log \epsilon_d$ (that may be as small as $\log d$ or as large as $\sqrt{d}$). For instance, instead of directly studying the mean of $h(d)$ for $d \in \mathcal{D}(x)$, he conjectured in 1801 that

$$ \sum_{d \in \mathcal{D}(x)} h(d) \log \epsilon_d \sim \frac{\pi^2}{18\zeta(3)} x^{3/2}. $$

Siegel [11] proved this asymptotic formula in 1944, and we had to wait until 1984 for Hooley [7, Conjecture 7] to give a conjecture -which is still an open problem to this day- concerning the mean of $h(d)$. Hooley's conjecture states that

$$ \sum_{1 \le d \le x : d \ne \square} h(d) \sim \frac{25}{12\pi^2} x(\log x)^2. $$
Here the notation $d \neq \square$ stands for the assertion "$d$ is not a perfect square."

To achieve such a tour de force, Hooley considered a family of integers with small associated fundamental unit. More precisely, for $0 \le \alpha \le 1$ he considered the family $\mathcal{D}_{\alpha}^{\text{Hooley}}$ of $d \in \mathbb{N}$, $d \neq \square$, such that $\varepsilon_{d}^{\text{Hooley}} \le d^{1/2+\alpha}$. Here $\varepsilon_{d}^{\text{Hooley}}$ is the fundamental unit as defined by Hooley, which slightly differs from our definition: we have $\varepsilon_{d}^{\text{Hooley}} = t + \sqrt{du}$, where $(t, u)$ is the smallest solution in $t$ of the Pell equation $t^2 - du^2 = 1$. We will detail some consequences of this difference in Remark 1.5 and Section 2.

Hooley proved that uniformly in $0 < a \le \alpha \le 1/2$, where $0 < a < 1/2$ is fixed:

$$ \sum_{d \in \mathcal{D}_{\alpha}^{\text{Hooley}}(x)} 1 \sim \frac{4\alpha^2}{\pi^2} \sqrt{x} \log^2 x. $$

If $0 < \alpha < 1/2$ is fixed, he also proved that

$$ \sum_{d \in \mathcal{D}_{\alpha}^{\text{Hooley}}(x)} h(d) \sim \frac{4(2\alpha - \log(1 + 2\alpha))}{\pi^2} x \log x. $$

Since the fundamental unit $\varepsilon_{d}^{\text{Hooley}}$ used by Hooley is defined in a different way than ours, the constant terms above will differ from ours.

In our case, it will be more suitable to define:

$$ \mathcal{D}_{\alpha} := \{d \in \mathcal{D} : \varepsilon_{d} \le d^{1/2+\alpha}\}. \qquad (1.1) $$

Following Hooley's idea and assuming GRH, Dahl [1] showed (with our definition of $\varepsilon_{d}$) that for $\lambda > -1$ and $0 < \alpha < 1/2$ fixed:

$$ \sum_{d \in \mathcal{D}_{\alpha}(x)} h(d)^{\lambda} \sim C(\lambda, \alpha) x^{(\lambda+1)/2} \log(x)^{2-\lambda}, $$

where $C(\lambda, \alpha)$ is an explicit constant. He also found a different formula in the case $\lambda = -1$. Combining ideas introduced by Lamzouri [9] and Dahl-Lamzouri [2], we are able to improve upon this result, allowing $\lambda$ to be a complex function of $x$ (uniformly in some range $|\lambda| \le (\log x)^{1+o(1)}$, $\Re(\lambda) \ge -1$), and removing the need for GRH. However in order to properly state our results, we first need to construct a random model for $L(1, \chi_d)$ when $d$ varies in $\mathcal{D}_{\alpha}(x)$.

## 1.1 Settings of the problem and main statement

Using techniques of Granville-Soundararajan [4] and Dahl-Lamzouri [2], we wish to compare the distribution of $L(1, \chi_d)$ for $d \in \mathcal{D}_{\alpha}(x)$ to that of a random Euler product $L(1, \mathbb{X}) := \prod_p (1 - \mathbb{X}(p)/p)^{-1}$, where the $\mathbb{X}(p)$'s are independent random variables taking the values 0, $\pm 1$. The idea is to think of $\mathbb{X}(p)$ as a random model for the value $\chi_d(p)$ when $d \in \mathcal{D}_{\alpha}$. To do so, we define

$$ a_p := \mathbb{P}(\mathbb{X}(p) = 1) := \frac{(p-1)^2}{2p(p+1)}, \quad b_p := \mathbb{P}(\mathbb{X}(p) = -1) := \frac{p-1}{2p}, $$

$$ c_p := \mathbb{P}(\mathbb{X}(p) = 0) := \frac{2}{p+1}. $$
The reason behind these choices of probabilities, instead of the easier $a_p = b_p = 1/2$, is the following. If $d \in \mathcal{D}_\alpha$, then $d = \tilde{d}\ell^2$, with some $\ell \in \mathbb{N}^*$ and $\tilde{d}$ a fundamental discriminant. A fundamental discriminant being divisible by a prime $p$ with probability $|p\mathbb{Z}/p^2\mathbb{Z}-\{0\}|/|\mathbb{Z}/p^2\mathbb{Z}-\{0\}| = 1/(p+1)$, the multiplicativity of $\chi_d(p)$ implies that $c_p = 1/(p+1)+(1-1/(p+1)) \times 1/p = 2/(p+1)$. Moreover, thanks to calculations carried out in the proof of Lemma 3.3 below, we know that we should have

$$a_p - b_p = \mathbb{E}(\mathcal{X}(p)) = -\frac{p-1}{p(p+1)}.$$

Knowing that $a_p + b_p = 1 - c_p = 1 - 2/(p+1)$, we find the values of $a_p$, $b_p$ and $c_p$ above.

**Remark 1.1:** This probabilistic random model is to be compared with the one introduced by Granville and Soundararajan in [4], where the probabilities that their random variables were equal to 1 and -1 were both equal to $p/(2(p+1))$. In our probabilistic random model however, this is not the case and it appears that our random variables should be equal to -1 more often than they are equal to 1. It may also be interesting to note that our probabilities are independent of $\alpha$, which was not expected at first sight.

Here is a plot comparing the probabilistic random model to the actual distribution of $\chi_d(p)$ for $d \in \mathcal{D}_{1/4}(10^5)$.

<figure><img src="image_2.png" /></figure>

The coloured curves are the plots of the functions that map a prime $p$ to the proportion of $d \in \mathcal{D}_{1/4}(10^5)$ such that $\chi_d(p) = 1$ (in green)/ $\chi_d(p) = -1$ (in red)/ $\chi_d(p) = 0$ (in blue). The dotted curves represent the plots of the corresponding theoretical probabilities $p \mapsto a_p, p \mapsto b_p$ and $p \mapsto c_p$.

We define $\mathcal{X}(n)$ by total multiplicativity, setting $\mathcal{X}(1) = 1$ and $\mathcal{X}(p_1^{\beta_1}...p_r^{\beta_r}) := \mathcal{X}(p_1)^{\beta_1}...\mathcal{X}(p_r)^{\beta_r}$. Here and throughout, we write $\log_k$ for the $k^{th}$-iterate of the natural logarithm function. We may now state our main result.

**Theorem 1.2:** Let $x$ be large and $0 < \alpha < 1/2$ be fixed. Uniformly for every complex number $z$ satisfying $|z| \le \frac{(1-2\alpha)^2}{75} \log x/(\log_2 x \log_3 x)$ and $\Re(z) \ge -1$, we have that

$$\sum_{d \in \mathcal{D}_\alpha(x)} h(d)^z = \frac{\mathbb{E}(L(1, \mathcal{X})^z)}{2\zeta(2)} \int_2^x \frac{t^{\frac{z-1}{2}}}{\log(t)^z} \left[ I_{z,1}(\alpha) \log^2(t) + \phi(z) I_{z,0}(\alpha) \log(t) \right] dt + Err$$
Here,

$$I_{z,1}(\alpha) := \int_{1/2}^{\alpha+1/2} u^{-z} \left(u - \frac{1}{2}\right) du, \quad I_{z,0}(\alpha) := \int_{1/2}^{\alpha+1/2} u^{-z} du,$$

$$\phi(z) = \sum_{p \ge 3} \frac{\frac{2 \log p}{(p+1)^2} \left(1 - \left(1 - \frac{1}{p}\right)^{-z}\right)}{\mathbb{E}\left(\left(1 - \frac{\mathfrak{X}(p)}{p}\right)^{-z}\right)} - \frac{\log 2}{9} \frac{4 \times 2^z + 5}{\frac{1}{6}2^z + \frac{1}{2}\left(\frac{2}{3}\right)^z + \frac{4}{3}} - \frac{2\zeta'(2)}{\zeta(2)} + 2\gamma,$$

with $\gamma$ being the usual Euler-Mascheroni constant and

$$Err \ll \frac{2^{\Re(z)} \mathbb{E}(L(1, \mathbb{X})^{\Re(z)})}{\Re(z) + 1} \frac{x^{(\Re(z)+1)/2}}{(\log x)^{\Re(z)}} \left( \frac{|z|^2}{(\Re(z) + 1) \log x} + \log \log^3 x \left( 1 + \frac{|z|}{\Re(s) + 2} \right) \right)$$

if $\Re(z) > -1$ and, if $\Re(z) = -1$

$$Err \ll |z|(\log^2 x) \log \log^3 x.$$

Note that for some $z$ -for example any zero of $\mathbb{E}((1 - \mathbb{X}(p)/p)^{-z})$ for $p$ a prime-, $\phi(z)$ is not properly defined, but the product $\mathbb{E}(L(1, \mathbb{X})^z)\phi(z)$ is. This naturally gives a meaning to the formula above for such $z$'s.

More explicitly we have the following corollary:

**Corollary 1.3:** Let $x$ be a large real number, $0 < \alpha < 1/2$ be fixed, and let $z$ be a complex number satisfying $|z| \le \frac{(1-2\alpha)^2}{75} \log x/(\log_2 x \log_3 x)$. We also assume that $\Re(z)$ is large and that $\Im(z) \ll \Re(z)$. Then we have that

$$\sum_{d \in \mathcal{D}_{\alpha}(x)} h(d)^z = \frac{1}{\zeta(2)} \frac{x^{\frac{z+1}{2}}}{z+1} I_{z,1}(\alpha) \log(x)^{-z+2} \left( \mathbb{E}(L(1, \mathbb{X})^z) + \mathcal{O}\left( \frac{\mathbb{E}(L(1, \mathbb{X})^\sigma)}{\log_2 x \log_3 x} \right) \right) + Err,$$

where Err is defined in Theorem 1.2 above. In particular if $z$ is a large real number such that $z \le \frac{(1-2\alpha)^2}{75} \frac{\log x}{(\log_2 x)^2}$, then

$$\sum_{d \in \mathcal{D}_{\alpha}(x)} h(d)^z = \frac{1}{\zeta(2)} \frac{\mathbb{E}(L(1, \mathbb{X})^z)}{z+1} I_{z,1}(\alpha) x^{\frac{z+1}{2}} \log(x)^{-z+2} \left( 1 + \mathcal{O}\left( \frac{1}{\log_2 x} \right) \right).$$

To prove our main theorem, we have to study moments of $L$-functions associated with $\chi_d$, for $d \in \mathcal{D}_\alpha(x)$.

**Theorem 1.4:** Let $x \ge 2$ and $0 < \alpha' < 1/2$ be fixed. Then uniformly for $0 < \alpha \le \alpha'$ and $|z| \le \frac{(1-2\alpha')^2}{75} \frac{\log x}{\log_2 x \log_3 x}$, we have

$$\sum_{d \in \mathcal{D}_{\alpha}(x)} L(1, \chi_d)^z = \frac{\sqrt{x}}{\zeta(2)} \mathbb{E}(L(1, \mathbb{X})^z) \left( \alpha^2 \frac{\log^2 x}{2} + \alpha (\phi(z) - 2\alpha) (\log x - 2) \right) + \mathcal{O}\left( \sqrt{x}(\log \log x)^3 \mathbb{E}(L(1, \mathbb{X})^{\Re(z)}) \right).$$

Here $\phi$ was defined in Theorem 1.2.
This result might be compared with the ones of [2, Theorem 1.4] and [4, Theorem 2], where the authors obtained similar estimates (over different families of discriminants).

**Remark 1.5:** Unlike the results of [2] and [4], we encountered a major technical difficulty in the proof of Theorem 1.2. In order to use Theorem 1.4 to prove Theorem 1.2, we have to use Stieltjes integration. This forces us to obtain our Theorem 1.4 uniformly in $0 < \alpha < \alpha' < 1/2$. When proving this result, we observe that the behaviour of the studied sum is quite different depending on the size of $\alpha$ compared to $x$. To understand why, let us recall some facts about the fundamental unit. If $\varepsilon_d = (t + u\sqrt{d})/2$ where $t^2 - du^2 = 4$, $u \ge 1$, we may deduce that $t \ge \sqrt{d}$ and hence $\varepsilon_d \ge (1 + u)\sqrt{d}/2$. Therefore, when $\alpha$ is relatively small compared to $x$ ($\alpha \approx 1/\log x$ as we will show later), the condition $\varepsilon_d \le d^{1/2+\alpha}$ implies that $u = 1$. We will give more precise details in Section 2, but until then we can outline the following heuristic:

1. If $\alpha$ is very small, then $D_\alpha(x)$ is empty;

2. If $\alpha$ is of intermediate size (so that we can only have $u = 1$), then the only discriminants in $D_\alpha(x)$ are of the form $d = t^2 - 4$;

3. If $\alpha$ is larger, then we may have $u > 1$, and this case is the only one contributing to the main term of our theorem above.

The second case corresponds to discriminants that are almost like those in Chowla's family, studied in [2]. We will say that the discriminants from the third case are of Hooley's type. Hooley did not encounter such difficulties with the intermediate case, for his definition of the fundamental unit $\varepsilon_d^{Hooley} = t + \sqrt{du}$ and $t^2 - du^2 = 1$ implies that $\varepsilon_d^{Hooley} \ge 2\sqrt{d}$, and hence $\alpha$ cannot be too small. In our case, we will deal with the very difficult transition from Hooley's discriminants to Chowla's discriminants by stating our intermediary results according to the size of $\alpha$, and we will then show that the contribution of Chowla's type discriminants goes in the error term.

## 1.2 Study of the distribution of $h(d)$ over $d \in D_\alpha(x)$

**Corollary 1.3** might be used to study the distribution function of $h(d)$'s over our family of discriminants. We will prove the following:

**Theorem 1.6:** Let $x$ be large. For some positive constant $B$, uniformly in the range $B \le \tau \le \log_2 x - 2\log_3 x + 2\log(1 - 2\alpha) - \log(75)$, the proportion of $d \in D_\alpha(x)$ such that

$$h(d) \ge 2e^{\gamma} \frac{\sqrt{x}}{\log x} \tau$$

equals

$$\exp\left(-\frac{e^{\tau-C_0}}{\tau}\left(1+O\left(\frac{1}{\sqrt{\tau}}\right)\right)\right),$$

where

$$C_0 := \int_0^1 \frac{\tanh(t)}{t} dt + \int_1^\infty \frac{\tanh(t) - 1}{t} dt \approx 0.819.$$

Here is an illustration of this fast decreasing proportion.
<figure><img src="image_3.png" /></figure>

The graph of the function that maps $t$ to the proportion of $d \in D_{1/10}(10^6)$ such that $h(d) \ge 2e^{\gamma \frac{10^3}{6 \log 10} t}$.

Although their probabilistic random models differ from ours, the random variable $L(1, \mathbb{X}_{Chowla})$ introduced by Dahl and Lamzouri [2] to "mimic" $L(1, \chi_d)$ when $d \le x$ is in Chowla's family, as well as the random variable $L(1, X)$ introduced by Granville and Soundararajan [4] to approximate $L(1, \chi_d)$ when $d$ is a fundamental discriminant such that $|d| \le x$ both satisfy a similar estimate to that of Theorem 1.7 below (see respectively their Theorem 1.3 and Proposition 1). More precisely, the tails of the probability distribution of these values share a common "double exponential decay," as properly stated in the theorem below, in the case of our probabilistic random model.

**Theorem 1.7:** We define $\Phi_X(\tau) := \mathbb{P}(L(1, \mathbb{X}) > e^{\gamma\tau})$ and $\Psi_X(\tau) := \mathbb{P}(L(1, \mathbb{X}) < \frac{\zeta(2)}{e^{\gamma\tau}})$. For large $\tau$, we have

$$ \Phi_X(\tau) = \exp\left(-\frac{e^{\tau-C_0}}{\tau}\left(1+\mathcal{O}\left(\frac{1}{\tau}\right)\right)\right). $$

The same estimate holds for $\Psi_X$. Moreover, if $0 \le \lambda \le e^{-\tau}$, then we have

$$ \Phi_X(e^{-\lambda}\tau) = \Phi_X(\tau)(1 + \mathcal{O}(\lambda e^{\tau})), \text{ and } \Psi_X(e^{-\lambda}\tau) = \Psi_X(\tau)(1 + \mathcal{O}(\lambda e^{\tau})). $$

The proof is the same to that of [2, Theorem 1.3], since our probabilities satisfy $a_p, b_p = 1/2 + \mathcal{O}(1/p)$ and $a_p - b_p, c_p \ll 1/p$.

## 1.3 Counting the number of Hooley's quadratic fields with bounded class numbers

Another application of our main theorem is given in Section 8, where we aim to find an asymptotic formula in $H$ for $\sum_{h \le H} \mathcal{F}_\alpha(h)$, the number of $d$'s in $D_\alpha$ such that $h(d) \le H$. Here $\mathcal{F}_\alpha(h)$ is defined as the number of $d \in D_\alpha$ such that $h(d) = h$. The method we use was designed by Soundararajan [12], and he used it to find an asymptotic formula for the average value of the number of imaginary quadratic fields with class number $h$. Heuristically, we know that $L(1, \chi_d)$ is constant on average, thanks to Theorem 1.4. Thus the main contribution to the average we want to estimate comes from $d \ll H^2(\log H)^2$, by the Class Number Formula. Since there are
around $H \log^3 H$ such discriminants by Proposition 4.1, we may expect the average of $\mathcal{F}_\alpha$ to be around $H \log^3 H$. This is indeed the case.

**Theorem 1.8:** We fix $0 < \alpha < 1/2$. Let $H$ be a positive integer and $\varepsilon > 0$ be small. Then, as $H \to \infty$, we have that

$$ \sum_{h \le H} \mathcal{F}_{\alpha}(h) = 2 \frac{\alpha^2(4\alpha + 3)}{3} \prod_{p} \left(1 - \frac{2p-1}{p^4}\right) H \log^3 H \left\{1 + \mathcal{O}_{\varepsilon}\left(\frac{1}{(\log H)^{1/3-\varepsilon}}\right)\right\}. $$

**Remark 1.9:** If we had uniformity in the parameter $\alpha$ and choose $\alpha \asymp 1/\log H$, the sum above should roughly be the number of Chowla's discriminants with class number $\le H$. Our Theorem would show that this quantity should be $\asymp H \log H$, which is precisely the result obtained by Dahl and Lamzouri [2]: if $\mathcal{F}_{\text{ch}}(h)$ is the number of discriminants $d$, squarefree, of the form $d = 4m^2 + 1$ for some $m \ge 1$, and with class number $h$, then

$$ \sum_{h \le H} \mathcal{F}_{\text{ch}}(h) = \frac{1}{2G} H \log H \left(1 + \mathcal{O}\left(\frac{(\log_2 H)^2 \log_3 H}{\log H}\right)\right), $$

where $G = L(2, \chi_{-4})$ is Catalan's constant, and $\chi_{-4}$ is the non-principal character modulo 4.

One can also compare this with the same result in the context of imaginary quadratic fields, proved by Soundararajan [12]: if $\mathcal{F}(h)$ is the number of imaginary quadratic fields with class number $h$, then, as $H \to \infty$,

$$ \sum_{h \le H} \mathcal{F}(h) = \frac{3\zeta(2)}{\zeta(3)} H^2 \left(1 + \mathcal{O}\left((\log H)^{-1/2+\varepsilon}\right)\right). $$

Due to weaker error terms than theirs in our formula for complex moments of class numbers, our proof will be slightly more technical than theirs.

**Acknowledgement:** I would like to thank my PhD advisor Youness Lamzouri for his time, guidance, and several useful suggestions through the preparation of this paper.

## 2 On the differences of context between Hooley's paper and ours

In his paper, Hooley [7] considers the number $h(d)$ of properly primitive classes of indefinite forms $ax^2 + 2bxy + cy^2$. However as mentioned by Davenport at the beginning of the section 6 of [3], Lagrange and now most modern writers would instead use the notation $ax^2 + bxy + cy^2$ for a quadratic form (see [10] for instance).

Hooley then defines the discriminant of his quadratic form to be $d = b^2 - ac$, while ours is defined by $d = b^2 - 4ac$. In other words, while we define the set of positive discriminants by

$$ \mathcal{D} = \{d \in \mathbb{N} : d \equiv 0(\text{mod } 4) \text{ or } d \equiv 1(\text{mod } 4); \ d \neq \square\}, $$

Hooley only studies $d/4$ when $d \in \mathcal{D}$ and $d \equiv 0(\text{mod } 4)$. By doing so Hooley avoids the technical difficulties arising from the case $d \equiv 1(\text{mod } 4)$, described in Remark 1.5 above.

We shall now start to give some lemmas, and we will highlight how Hooley's definition would change some of them. First, we start by parametrizing our family $\mathcal{D}_\alpha(x)$ defined in (1.1), $x > 0$ large and $0 < \alpha < 1/2$. For $t \ge 0$, $u \ge 1$, we define

$$ d(t, u) := \frac{t^2 - 4}{u^2}. $$
As shown by Hooley, we have the following lemma:

**Lemma 2.1:** Let $x$ be large, $0 < \alpha < 1/2$, and put $X_\alpha := x^\alpha - x^{-1-\alpha}$. Let $Y_1 := Y_1(u, \alpha)$ be the unique positive solution to $u = Y_1^\alpha - Y_1^{-1-\alpha}$, $Y_2 = (Y_1 u^2 + 4)^{1/2}$ and $Y_3 = (x u^2 + 4)^{1/2}$. Then each $d \in \mathcal{D}_\alpha(x)$ may be uniquely written as a $d(t, u)$, where

$$1 \le u \le X_{\alpha}, \quad Y_2 \le t \le Y_3, \quad d(t, u) \in \mathcal{D}.$$

*Proof:* Since the only unit lower that $d$ is the fundamental unit, we can write that $d \in \mathcal{D}_\alpha(x)$ if, and only if,

$$t^2 - du^2 = 4, \quad \varepsilon_d = \frac{t + \sqrt{du}}{2} \le d^{1/2+\alpha}, \quad u \ge 1, \quad d \le x. \qquad (2.1)$$

Observe that the first condition ensures that $d \neq \square$. Furthermore, knowing that $u = \frac{\varepsilon_d - \varepsilon_d^{-1}}{\sqrt{d}}$, we may replace the second and fourth conditions above by

$$u \le d^{\alpha} - d^{-1-\alpha} \le x^{\alpha} - x^{-1-\alpha} = X_{\alpha},$$

since $d^{\alpha} - d^{-1-\alpha}$ is an increasing function of $d$. Now this inequality between $u$ and $d$ implies that $d \ge Y_1$. Furthermore the first condition of (2.1) may be replaced by the following inequality for each $u$:

$$Y_2 = (Y_1 u^2 + 4)^{1/2} \le t \le (x u^2 + 4)^{1/2} = Y_3.$$

This concludes the proof. □

With his definition, Hooley gets a slightly different parametrization, and in particular $X_\alpha^{Hooley} = \frac{1}{2}X_\alpha$. It is now time to give a more quantitative version of Remark 1.5 above, where the technical difficulty mentioned is related to the size of $X_\alpha$. We shall define $\alpha_0$ to be such that $X_{\alpha_0} = 1$, and $\alpha_1$ to be such that $X_{\alpha_1} = 2$. Observe that $\mathcal{D}_\alpha(x)$ is empty if $\alpha < \alpha_0$, since we would have $X_\alpha < 1$. Also note that

$$\alpha_1 \asymp 1/\log x. \qquad (2.2)$$

By definition, the family studied by Hooley is empty as soon as $X_\alpha < 2$, which is the case whenever $\alpha < \alpha_1$.

For several reasons detailed later, we will have to study $\sum_{d \in \mathcal{D}_\alpha(x)} \chi_d(m)$, for a fixed $m \ge 1$. We may use this Lemma 2.1 to write that

$$\sum_{d \in \mathcal{D}_\alpha(x)} \chi_d(m) = \sum_{u=1}^{X_\alpha} \sum_{\substack{Y_2 \le t \le Y_3 \\ d(t,u) \in \mathcal{D}}} \left( \frac{d(t,u)}{m} \right) = \sum_{u=1}^{X_\alpha} \sum_{\substack{2 < a \le 4u^2+2 \\ d(t,u) \in \mathcal{D}}} \sum_{\substack{Y_2 \le t \le Y_3 \\ t \equiv a \pmod{4u^2}}} \left( \frac{d(t,u)}{m} \right).$$

We define

$$C_{m,a,u} := \sum_{0 < \ell \le m} \left( \frac{16u^2\ell^2 + 8a\ell + d(a, u)}{m} \right)$$

and $\rho(u)$ as the number of $2 < a \le 4u^2 + 2$ such that $d(a, u) \in \mathcal{D}$. If $t \equiv a \pmod{4u^2}$ then $d(t, u) = 16u^2\ell^2 + 8a\ell + d(a, u)$, for some $\ell \in \mathbb{Z}$, and hence $d(a, u)$ and $d(t, u)$ are equal
modulo $8^1$. Therefore if $t \equiv a \pmod{4u^2}$ and $t \ge Y_2$, we have that $d(t, u) \in \mathcal{D}$ if, and only if, $d(a, u) \in \mathcal{D}$. Thus

$$
\begin{align*}
\sum_{d \in \mathcal{D}_\alpha(x)} \chi_d(m) &= \sum_{u=1}^{X_\alpha} \sum_{2 < a \le 4u^2+2} \sum_{d(a,u) \in \mathcal{D}} \left( \frac{d(a+4u^2n, u)}{m} \right) \\
&= \sum_{u=1}^{X_\alpha} \sum_{2 < a \le 4u^2+2} \sum_{d(a,u) \in \mathcal{D}} \left( \frac{d(a+4u^2\ell, u)}{m} \right) \sum_{\substack{n \le 1 \\ n \equiv \ell \pmod m}} 1 \\
&= \sum_{u=1}^{X_\alpha} \sum_{2 < a \le 4u^2+2} C_{m,a,u} \left( \frac{Y_3 - Y_2}{4u^2m} + \mathcal{O}(1) \right) \\
&= \sum_{u=1}^{X_\alpha} \frac{\sqrt{x} - \sqrt{Y_1}}{4u} \sum_{\substack{2 < a \le 4u^2+2 \\ d(a,u) \in \mathcal{D}}} \frac{C_{m,a,u}}{m} + \mathcal{O} \left( m \sum_{u=1}^{X_\alpha} \rho(u) \right), \tag{2.3}
\end{align*}
$$

since $|C_{m,a,u}| \le m$. We shall require the following lemma, due to Lamzouri.

**Lemma 2.2** (Lemma 3.3 of [9]): Let $a, u$ be positive integers such that $d(a, u) \in \mathcal{D}$. Let $m$ be a positive integer and write $m = 2^{e_1} p_2^{e_2} \cdots p_r^{e_r}$, where $e_1 \ge 0$ and $e_j \ge 1$ for $2 \le j \le r$. Also let $m_0$ be the squarefree part of $m/2^{e_1}$. Then if $(m_0, u) > 1$ we have $C_{m,a,u} = 0$. Moreover, if $(u, m_0) = 1$ then we have

$$
\frac{C_{m,a,u}}{m} = b_{a,u}(m) \frac{(-1)^{\omega(m_0)}}{m_0} \prod_{\substack{2 \le j \le r \\ e_j \text{ is even}}} \left(1 - \frac{2}{p_j}\right) \prod_{\substack{p_j \mid u \\ e_j \text{ is even}}} \left(1 + \frac{1}{p_j - 2}\right)
$$

where $\omega(m_0)$ is the number of prime factors of $m_0$, and $b_{a,u}(m) = 1$ if $m$ is odd, and if $m$ is even then

$$
b_{a,u}(m) = \begin{cases} 0 & \text{if } d(a, u) \equiv 0 \pmod{4}, \\ 1 & \text{if } d(a, u) \equiv 1 \pmod{8}, \\ (-1)^{e_1} & \text{if } d(a, u) \equiv 5 \pmod{8}. \end{cases}
$$

At this point, there is would be no significant difference if we were to prove the same lemma in
the context of Hooley's work (we would have to change $\equiv 0(\text{mod } 4)$ by $\equiv 0(\text{mod } 2)$, $\equiv 1(\text{mod } 8)$
by $\equiv \pm 1(\text{mod } 8)$, and $\equiv 5(\text{mod } 8)$ by $\equiv \pm 5(\text{mod } 8)$ in the expression above). A fundamental
difference between Hooley's definition and ours lies in the following lemma.

**Lemma 2.3:** We keep the notations of the lemma above and we put $B_m(u) := \sum_{\substack{3 \le a \le 4u^2+2 \\ d(a,u) \in \mathcal{D}}} b_{a,u}(m)$,
and let $\eta(u)$ be the number of odd prime factors of $u$. Let $r_1$ be the 2-adic valuation of $u$. Then
if $e_1 = 0$

$$
B_m(u) = \begin{cases} 4 \times 2^{\eta(u)} & \text{if } r_1 = 0 \text{ or } 1, \\ 8 \times 2^{\eta(u)} & \text{if } r_1 = 2, \\ 16 \times 2^{\eta(u)} & \text{if } r_1 \ge 3. \end{cases}
$$

<footnote n="1">¹The fact that we are computing modulo 8 is actually a natural thing to do due to the definition of Kronecker's
character.</footnote>
If $e_1 \ge 1$, we have

$$B_m(u) = \begin{cases} 2(-1)^{e_1} 2^{\eta(u)} & \text{if } r_1 = 0, \\ 4(1 + (-1)^{e_1}) 2^{\eta(u)} & \text{if } r_1 \ge 3, \\ 0 & \text{otherwise.} \end{cases}$$

*Proof:* It is an immediate consequence of Lemma 3.4 of [9], as detailed in the proof of Theorem 3.1 of the said paper. □

The mentioned Lemma 3.4 of [9] is an estimate of incongruent solutions of some equations modulo 4 and 8. These equations are, for the sake of an example, of the form

$$d(a, u) \equiv 0(\text{mod } 4),$$

to be solved in $a$. By the Chinese remainder Theorem, we have to solve $a^2 - 4 \equiv 0(\text{mod } 2^{2+2r_1})$, and in Hooley's case we would rather have to solve $a^2 - 1 \equiv 0(\text{mod } 2^{2+2r_1})$, which does not have the same number of incongruent solutions if $r_1 \ge 2$. If we were to define $B_m^{\text{Hooley}}(u)$ in a similar way to that of $B_m(u)$, then we would have, if $e_1 = 0$:

$$B_m^{\text{Hooley}}(u) = \begin{cases} 4 \times 2^{\eta(u)} & \text{if } r_1 = 0, \\ 8 \times 2^{\eta(u)} & \text{if } r_1 = 1, \\ 16 \times 2^{\eta(u)} & \text{if } r_1 \ge 2. \end{cases}$$

If $e_1 \ge 1$, we would have

$$B_m^{\text{Hooley}}(u) = \begin{cases} (1 + (-1)^{e_1}) 2^{\eta(u)} & \text{if } r_1 = 0, \\ 0 & \text{if } r_1 = 1, \\ 4(1 + (-1)^{e_1}) 2^{\eta(u)} & \text{if } r_1 \ge 2. \end{cases}$$

We keep the notations of the two lemmas above. Again, we leave the technical details for later, but to estimate the main term of (2.3) we will rely on Perron's formula, and hence we shall compute the Dirichlet series (for $\Re(s) > 1$):

$$\sum_{\substack{u \ge 1 \\ (u, m_0) = 1}} \frac{B_m(u)}{u^s} \prod_{\substack{p_j | u \\ e_j \text{ is even}}} \left( 1 + \frac{1}{p_j - 2} \right).$$

In order to get a multiplicative function of $u$ inside the sum, we should normalize $B_m(u)$ as follows.

**Lemma 2.4:** We keep the notations of Lemma 2.2. We put $a(m) = 4$ if $m$ is odd and $a(m) = 2(-1)^{e_1}$ otherwise. Then for $\Re(s) > 1$:

$$\Sigma(m, s) := \sum_{\substack{u \ge 1 \\ (u, m_0) = 1}} \frac{B_m(u)/a(m)}{u^s} \prod_{\substack{p_j | u \\ e_j \text{ is even}}} \left( 1 + \frac{1}{p_j - 2} \right) = G_m(s)\zeta(s)^2$$

where

$$G_m(s) := \kappa(m, s) \frac{\prod_{\substack{2 \le j \le r \\ e_j \text{ even}}} \left( 1 + \frac{2(p_j - 1)}{(p_j - 2)(p_j^s - 1)} \right)}{\prod_{p \mid 2m} \left( 1 + \frac{2}{p^{s-1}} \right)} \frac{1}{\zeta(2s)} \quad (2.4)$$
and

$$ \kappa(m, s) := \begin{cases} 1 + \frac{2(1+(-1)^{e_1})}{4^s(2^s-1)} & \text{if } e_1 \ge 1, \\ 1 + \frac{1}{2^s} + \frac{2}{4^s} + \frac{4}{4^s(2^s-1)} & \text{otherwise,} \end{cases} \qquad (2.5) $$

*Proof:* The proof of Theorem 3.1 of [9] shows that

$$ \Sigma(m, s) = \kappa(m, s) \prod_{\substack{2 \le j \le r \\ e_j \text{ even}}} \left( 1 + \frac{2(p_j - 1)}{(p_j - 2)(p_j^s - 1)} \right) \prod_{p \nmid 2m} \left( 1 + \frac{2}{p^s - 1} \right). $$

The lemma follows by noticing that for $p \ge 2$ an integer,

$$ 1 + \frac{2}{p^s - 1} = \frac{1 - \frac{1}{p^{2s}}}{\left(1 - \frac{1}{p^s}\right)^2}. $$

□

Now, because of Lemma 2.2 and (2.3) we see that it should be interesting to define the function

$$ H_m(s) := \frac{(-1)^{\omega(m_0)}}{4m_0} \prod_{\substack{2 \le j \le r \\ e_j \text{ even}}} \left(1 - \frac{2}{p_j}\right) a(m)G_m(s). \qquad (2.6) $$

In Hooley's case, this function $H_m$ would be almost the same, but we would have

$$ H_m^{\text{Hooley}}(s) = \frac{(-1)^{\omega(m_0)}}{4m_0} \prod_{\substack{2 \le j \le r \\ e_j \text{ even}}} \left(1 - \frac{2}{p_j}\right) \kappa^{\text{Hooley}}(m, s) \frac{\prod_{\substack{2 \le j \le r \\ e_j \text{ even}}} \left(1 + \frac{2(p_j - 1)}{(p_j - 2)(p_j^s - 1)}\right)}{\prod_{p \nmid 2m} \left(1 + \frac{2}{p^{s-1}}\right)} \frac{1}{\zeta(2s)}, $$

where

$$ \kappa^{\text{Hooley}}(m, s) = \begin{cases} 4 \frac{2^s}{2^s-1} \left(1 + \frac{1}{2^s} + \frac{2}{4^s}\right) & \text{if } e_1 = 0, \\ (1 + (-1)^{e_1}) \left(1 + \frac{4}{2^s(2^s-1)}\right) & \text{if } e_1 \ge 1. \end{cases} $$

In our proof of Proposition 4.1, we will establish that for a fixed $0 < \alpha < 1/2$ and fixed $m \ge 1$,

$$ \sum_{d \in \mathcal{D}_{\alpha}(x)} \chi_d(m) \sim \frac{H_m(1)}{2} \alpha^2 \sqrt{x} \log^2 x, $$

and hence our probabilistic random model must satisfy

$$ \mathbb{E}(\mathbb{X}(m)) = \lim_{x \to \infty} \frac{\sum_{d \in \mathcal{D}_{\alpha}(x)} \chi_d(m)}{\sum_{d \in \mathcal{D}_{\alpha}(x)} 1} = \frac{H_m(1)}{H_1(1)} = H_m(1)\zeta(2). $$

One would find a similar equivalent with Hooley's definition, as one can observe when we see the expression for $H_1^{\text{Hooley}}(s)$ which appears between (16) and (17) of [7]. Therefore, we can compute what would be a good probabilistic random model for his definition. If we were to define random independent variables $(\mathbb{X}^{\text{Hooley}}(p))$ taking values in $\{\pm 1, 0\}$, to "mimic" the behaviour of $\chi_d(p)$ for $d \in \mathcal{D}_{\alpha}^{\text{Hooley}}(x)^1$, then we a good way to define them should be

$$ \mathbb{P}(\mathbb{X}^{\text{Hooley}}(p) = 1) = a_p, \quad \mathbb{P}(\mathbb{X}^{\text{Hooley}}(p) = -1) = b_p, \quad \mathbb{P}(\mathbb{X}^{\text{Hooley}}(p) = 0) = c_p, $$

<footnote n="1">¹Recall that $\mathcal{D}_{\alpha}^{\text{Hooley}}(x) = \{d \neq \square, d \le x, \varepsilon_d^{\text{Hooley}} \le d^{1/2+\alpha}\}$.</footnote>
for any odd prime $p$, and

$$ \mathbb{P}(\mathbb{X}^{\text{Hooley}}(2) = 1) = 3/16, \quad \mathbb{P}(\mathbb{X}^{\text{Hooley}}(2) = -1) = 3/16, \quad \mathbb{P}(\mathbb{X}^{\text{Hooley}}(2) = 0) = 5/8. $$

Similarly to our $\mathbb{X}$'s, we would then put $\mathbb{X}^{\text{Hooley}}(1) = 1$ and for $n \ge 2$, $\mathbb{X}^{\text{Hooley}}(n) := \prod_{p^e \mid n} \mathbb{X}^{\text{Hooley}}(p)^e$.

This is very coherent with the following heuristic: Hooley studies integers $d$ such that $4d \in \mathcal{D}$. Therefore, the probability that $d$ is divided by an odd prime $p$ is the same as the probability of $p$ dividing $4d$. However, in the case $p = 2$, we are looking at discriminants divisible by 8, knowing that they are already divisible by 4. Using Bayes’ Theorem, we should have

$$ c_2^{\text{Hooley}} = \frac{\mathbb{P}(8|d; d \in \mathcal{D})}{\mathbb{P}(4|d; d \in \mathcal{D})}. $$

Recall that a discriminant $d$ can be uniquely written as $d = \tilde{d}\ell^2$ with $\tilde{d}$ a fundamental discriminant and $\ell \ge 1$ and integer. Also recall that the fundamental discriminant $\tilde{d}$ must satisfy $\tilde{d} \equiv 1(\text{mod } 4)$ or $\tilde{d} \equiv 8, 12(\text{mod } 16)$. Therefore to have $8|\tilde{d}\ell^2$, we have to be in one of the three cases:

1. $8|\tilde{d}$, which happens for 1 of the 6 available classes modulo 16 for $\tilde{d}$:

2. $4|\tilde{d}$ and $8 \nmid \tilde{d}$, which happens for only 1 class modulo 16, and in this case $8|\tilde{d}\ell^2 \iff 2|\ell$ (the latter happens with probability $1/2$);

3. $4 \nmid \tilde{d}$, which happens for 4 classes modulo 16, and in this case $8|\tilde{d}\ell^2 \iff 4|\ell$ (the latter happens with probability $1/4$).

By doing similar computations for the case $4|d$, we find that the probability of a Hooley discriminant being divisible by 2 is given by

$$ \frac{1/6 + 1/6 \times 1/2 + 4/6 \times 1/4}{2/6 + 4/6 \times 1/2} = 5/8 = c_2^{\text{Hooley}} $$

as expected.

We can go even further, but we will avoid technicalities and only outline a very informal proof. In 6 of [7], Hooley writes the class number formula as $h(d) = 2\sqrt{d}L_d(1)/\log(\varepsilon_d^{\text{Hooley}})$, where $L_d(1)$ is a Dirichlet’s $L$-function satisfying $L_d(1) = \sum_{m \text{ odd}} \frac{\frac{d}{m}}{m}$. Therefore, by removing the contribution of the powers of 2 in the Euler product for $L_d(1)$, we should have

$$ \sum_{d \in \mathcal{D}_{\alpha}^{\text{Hooley}}(x)} L_d(1) \sim \frac{\mathbb{E}(L(1, \mathbb{X}^{\text{Hooley}}))}{\mathbb{E}\left(\left(1 - \frac{\mathbb{X}^{\text{Hooley}}(2)}{2}\right)^{-1}\right)} \sum_{d \in \mathcal{D}_{\alpha}^{\text{Hooley}}(x)} 1 \sim \frac{4}{\pi^2} \alpha^2 \sqrt{x} \log^2 x. $$

Then, a partial summation leads to

$$ \sum_{d \in \mathcal{D}_{\alpha}^{\text{Hooley}}(x)} \frac{2\sqrt{d}L_d(1)}{\log d} \sim 2 \int_2^x \frac{\sqrt{t}}{\log t} \times \frac{4\alpha^2 \log^2(t)}{\pi^2} \frac{\log^2(t)}{2\sqrt{t}} dt \sim \frac{4\alpha^2}{\pi^2} x \log x. $$

Finally, we would get by the class number formula and Stieltjes integration:

$$ \begin{aligned} \sum_{d \in \mathcal{D}_{\alpha}^{\text{Hooley}}(x)} h(d) &= \sum_{d \in \mathcal{D}_{\alpha}^{\text{Hooley}}(x)} \frac{2\sqrt{d}L_d(1)}{\log d} \frac{\log d}{\log \varepsilon_d^{\text{Hooley}}} \sim \int_0^{\alpha} (1/2 + u)^{-1} \times \frac{8u}{\pi^2} x \log x \, du \\ &\sim \frac{4[2\alpha - \log(2\alpha + 1)]}{\pi^2} x \log x, \end{aligned} $$

as Hooley found.
### 3 Lemmata and definitions

**Lemma 3.1:** Uniformly in $0 < \alpha < 1/2$, we have for all $u \ge 2$

$$ \sqrt{Y_1} = u^{1/(2\alpha)} + \mathcal{O}\left(\frac{1}{u^2}\right). $$

*Proof:* We have that

$$ Y_1^\alpha = u + Y_1^{-1-\alpha} = u + (u + Y_1^{-1-\alpha})^{(-1-\alpha)/\alpha} = u + \mathcal{O}(u^{(-1-\alpha)/\alpha}). $$

Since $u^{-1/(2\alpha)}/\alpha$ is uniformly bounded for $0 < \alpha < 1/2$, we deduce that

$$ \begin{aligned} \sqrt{Y_1} &= u^{1/(2\alpha)} \exp \left( \frac{1}{2\alpha} \log (1 + \mathcal{O}(u^{-1/\alpha-2})) \right) = u^{1/(2\alpha)} \left( 1 + \mathcal{O} \left( \frac{1}{\alpha} u^{-1/\alpha-2} \right) \right) \\ &= u^{1/(2\alpha)} + \mathcal{O}(u^{-1/(2\alpha)-2}/\alpha) = u^{1/(2\alpha)} + \mathcal{O}(u^{-2}). \end{aligned} $$

□

We shall now introduce several notations. First, we define another sequence of independent random variables, $(X_s(p))_p$, for $s > 1/2$ and where $p$ runs over the set of primes. They are defined by the following probabilities, for $p$ an odd prime number,

$$ a_p(s) := \mathbb{P}(X_s(p) = 1) := \frac{p-3}{2p} + \frac{2}{p^s+1}\frac{1}{p}, \quad b_p(s) := \mathbb{P}(X_s(p) = -1) := \frac{p-1}{2p}, $$

$$ c_p(s) := \mathbb{P}(X_s(p) = 0) := 1 - \frac{1}{p} \left( p - 2 + \frac{2}{p^s - 1} \right). \quad (3.1) $$

In the case $p=2$, we have

$$ a_2(s) := \mathbb{P}(X_s(2) = 1) := \frac{1}{8^s + 2^s + 2}, \quad b_2(s) := \mathbb{P}(X_s(2) = -1) := \frac{1}{2} \frac{8^s - 4^s + 2}{8^s + 2^s + 2}, $$

$$ c_2(s) := \mathbb{P}(X_s(2) = 0) := \frac{2^{s-1}(4^s + 2^s + 2)}{8^s + 2^s + 2}. $$

We then extend the definition of these variables to integers by putting $X_s(n) = \prod_{p^e \nparallel n} X_s(p)^e$ and $X_s(1) = 1$. Note that by definition $X(m)$ has the same law as $X_1(m)$. In addition, we define $(X_\infty(m))_m$ to be the random variables defined by

$$ a_p(\infty) := \mathbb{P}(X_\infty(p) = 1) := \frac{p-3}{2p}, \quad b_p(\infty) := \mathbb{P}(X_\infty(p) = -1) := \frac{p-1}{2p}, $$

$$ c_p(\infty) := \mathbb{P}(X_\infty(p) = 0) := \frac{2}{p}. $$

for $p$ an odd prime and

$$ a_2(\infty) := \mathbb{P}(X_\infty(2) = 1) = 0, \quad b_2(\infty) := \mathbb{P}(X_\infty(2) = -1) = \frac{1}{2}, $$

$$ c_2(\infty) := \mathbb{P}(X_\infty(2) = 0) := \frac{1}{2}. $$
We also put $\mathbb{X}_{\infty}(n) := \prod_{p^e \parallel n} \mathbb{X}_{\infty}(p)^e$, and $\mathbb{X}_{\infty}(1) = 1$.

To isolate the multiplicative part of $H_m(s)$ defined in (2.6), we write it in the form

$$ H_m(s) = \frac{8^s + 2^s + 2}{8^s + 4^s} \frac{1}{\zeta(2s)} \left\{ \frac{(-1)^{\omega(m_0)} \prod_{\substack{2 \le j \le r \\ e_j \text{ even}}} \left(1 - \frac{2}{p_j}\right) \left(1 + \frac{2(p_j-1)}{(p_j-2)(p_j^s-1)}\right)}{m_0 \prod_{p|m} \left(1 + \frac{2}{p^{s-1}}\right)} \tilde{\kappa}(m, s) \right\} \\ =: \frac{8^s + 2^s + 2}{8^s + 4^s} \frac{1}{\zeta(2s)} h_m(s), \qquad (3.2) $$

with $\tilde{\kappa}(m, s) = 1$ if $m$ is odd and equals $\frac{(-1)^{e_1}}{2} \frac{8^s+4^s}{8^s+2^s+2} \left(1 + \frac{2(1+(-1)^{e_1})}{4^s(2^s-1)}\right)$ otherwise, and $h_m(s)$ is implicitly defined by the last equality above. By definition, $h_m(s)$ is multiplicative for any fixed real $s > 1/2$. It also happens to be the expectation of $\mathbb{X}_s(m)$ (which is the reason for its definition).

**Remark 3.2:** These quantities may seem to be artificial at first sight. The case $s = 1$ is the case corresponding to our random model. The case $s = \infty$ is actually a better random model when $\alpha$ is very small compared to $x$ ($\alpha \le 1/(2 \log x)$, say), as future computations will show. Finally, the other cases are indeed artificial in the sense that the aim for their introduction is not to model any behaviour, but rather to use the expectation formalism to greatly simplify several computations to come. In a few words it will allow us to express a multiplicative function as the expectation of a totally multiplicative random variable, which will come in handy for factorizing some series as Euler products.

**Lemma 3.3:** Let $m = 2^{e_1}p_2^{e_2}\dots p_r^{e_r}$ be the prime factorization of $m$ ($e_1 \ge 0$, $e_j \ge 1$ if $j = 2, \dots, r$). Let $m_0$ be the squarefree part of $m/2^{e_1}$. Then for any real $s > 1/2$:

$$ \mathbb{E}(\mathbb{X}_s(m)) = h_m(s). $$

Furthermore,

$$ \mathbb{E}(\mathbb{X}_{\infty}(m)) = \frac{(-1)^{\omega(m_0)}}{m_0} \prod_{\substack{2 \le j \le r \\ e_j \text{ even}}} \left(1 - \frac{2}{p_j}\right) \frac{a(m)}{4}. $$

*Proof:* By the independence of the $\mathbb{X}_s(p)$'s, we know that $\mathbb{E}(\mathbb{X}_s(\cdot))$ is a multiplicative function. Therefore, $h_m(s)$ being multiplicative as well, we may check the equality only for integers $p^k$, $p$ prime and $k \ge 1$. If $p$ is odd, then if $k$ is odd,

$$ \mathbb{E}(\mathbb{X}_s(p^k)) = a_p(s) - b_p(s) = \frac{1}{p} \left( \frac{2}{p^s + 1} - 1 \right) = h_{p^k}(s). $$

If $k$ is even,

$$ \mathbb{E}(\mathbb{X}_s(p^k)) = a_p(s) + b_p(s) = \frac{1}{p} \left( p - 2 + \frac{2}{p^s + 1} \right) = h_{p^k}(s). $$

Now if $p = 2$ and $k$ is odd, then

$$ \mathbb{E}(\mathbb{X}_s(2^k)) = a_2(s) - b_2(s) = \frac{1}{2} \frac{4^s - 8^s}{8^s + 2^s + 2} = h_{2^k}(s). $$

Finally, if $k$ is even,

$$ \mathbb{E}(\mathbb{X}_s(2^k)) = a_2(s) + b_2(s) = \frac{1}{2} \frac{8^s - 4^s + 4}{8^s + 2^s + 2} = h_{2^k}(s). $$
By continuity, we find the result for $X_\infty$ by letting $s \to \infty$, since $\tilde{\kappa}(m, s) \underset{s \to \infty}{\to} a(m)/4$. $\square$

**Lemma 3.4:** Let $m \ge 1$ and let $m_0$ be the squarefree part of $m$. We have

$$h_m(1), h'_m(1), h''_m(1) \ll \log^2(m+1)/m_0.$$

If we fix $1/2 < \sigma < 1$, then we also have the more general estimate

$$\sup_{\Re(s)>\sigma} |h_m(s)| \ll m^{\mathcal{O}(1/\log(1+m)^{\sigma/2})}/m_0.$$

*Proof:* First, it is clear that $\tilde{\kappa}(m, 1) \ll 1$, and this holds true for the first and second derivatives of $\tilde{\kappa}(m, s)$ at $s = 1$. We start by studying the product $\prod_{\substack{2 \le j \le r \\ e_j \text{ even}}} \left(1 - \frac{2}{p_j}\right) \left(1 + \frac{2(p_j-1)}{(p_j-2)(p_j^s-1)}\right)$, and we denote the factors of this product by $u_{p_j}(s)$. We have

$$u_{p_j}(1) = 1, \quad u'_{p_j}(1) \ll \log(p_j)/p_j, \quad u''_{p_j}(1) \ll (\log p_j)^2/p_j.$$

Thus

$$\left( \prod_{\substack{2 \le j \le r \\ e_j \text{ even}}} u_{p_j}(s) \right)' \Big|_{s=1} \ll \sum_{p|m} |u'_p(1)| \ll \log(1+m).$$

Similarly,

$$\left( \prod_{\substack{2 \le j \le r \\ e_j \text{ even}}} u_{p_j}(s) \right)'' \Big|_{s=1} \ll \left( \sum_{p|m} |u'_p(1)| \right)^2 + \sum_{p|m} |u''_p(1)| \ll \log^2(1+m).$$

Now we turn to the product $\prod_{p|m} \left(1 + \frac{2}{p^{s-1}}\right)^{-1}$, which is $\ll 1$ if $s = 1$, and as done above, its first derivative at $s = 1$ is $\ll \log(1+m)$ and its second derivative at $s = 1$ is $\ll \log^2(m+1)$. This shows that $h_m(s) \ll \log(m+1)^2/m_0$ if $s = 1$, and this holds true for its first and second derivatives at $s = 1$, which concludes the first part of the proof.

Let $1/2 < \sigma < 1$. Observe that for any $s$ with real part $> \sigma$, we have

$$|h_m(s)| \ll \frac{1}{m_0} \prod_{p|m} \left(1 + \mathcal{O}\left(\frac{1}{p^\sigma}\right)\right) \ll \frac{1}{m_0} \exp \left( \mathcal{O}\left(\sum_{p|m} \frac{1}{p^\sigma}\right) \right).$$

The inner sum is, if $P$ is the $\omega(m)$-th prime number:

$$\ll \sum_{p \le P} \frac{1}{p^\sigma} \ll P^{1-\sigma} \ll \log(1+m)^{1-\sigma/2},$$

which comes from $P \ll \omega(m) \log(\omega(m))$ by the prime number theorem, and using $\omega(m) \ll \log(m+1)$. This proves that

$$|h_m(s)| \ll m^{\mathcal{O}(1/\log(1+m)^{\sigma/2})}/m_0,$$
which completes the proof.

Now we recall standard bounds (also found in [2]) for $d_z$, the multiplicative function defined on prime powers by $d_z(p^\nu) = \Gamma(z+\nu)/(\Gamma(z)\nu!)$. Observe that $|d_z(n)| \le d_{|z|}(n) \le d_k(n)$, for any $k \ge |z|$, and $d_k(mn) \le d_k(m)d_k(n)$ for any positive integers $k, m, n$. Also note that for $k \in \mathbb{N}$ and $y > 3$, we have that

$$d_k(n)e^{-n/y} \le e^{k/y} \sum_{a_1 \dots a_k = n} e^{-(a_1 + \dots + a_k)/y}.$$

Therefore,

$$\sum_{n=1}^{\infty} \frac{d_k(n)}{n} e^{-n/y} \le \left( e^{1/y} \sum_{a=1}^{\infty} \frac{e^{-a/y}}{a} \right)^k \le (\log(3y))^k. \quad (3.3)$$

**Lemma 3.5:** Let $y > 3$. Then for $1 \le k \le \log(y)/3$:

$$\sum_{m=1}^{\infty} d_k(m) e^{-m/y} \ll y(\log(3y))^{k+2}.$$

*Proof:* We split the sum $\sum_{m=1}^{\infty} d_k(m)e^{-m/y}$ into two sums: the sum $\Sigma_1$ over $m \le y \log^2 y$, and the sum $\Sigma_2$ over $m > y \log^2 y$. By (3.3), we find that

$$\Sigma_1 \le \sum_{m \le y \log^2 y} \frac{y \log^2 y}{m} d_k(m) e^{-m/y} \ll y(\log(3y))^{k+2}.$$

Again as in (3.3), the second sum is bounded by

$$\Sigma_2 \le \exp\left(-\frac{\log^2 y}{2}\right) \sum_{m=1}^{\infty} d_k(m) e^{-m/(2y)} \le \exp\left(-\frac{\log^2 y}{2}\right) \left(e^{1/(2y)} \sum_{m=1}^{\infty} e^{-m/(2y)}\right)^k \\ \ll \exp\left(-\frac{\log^2 y}{2}\right) (2y)^k \ll 1.$$

This proves the result.

**Lemma 3.6:** Let $x$ be large, ($a_m$) be a complex sequence such that $a_m \ll m^{\mathcal{O}(1/\log(1+m)^\kappa+1/\log_2 x)}/m_0$, where $m_0$ is the squarefree part of $m$ and $0 < \kappa < 1/2$ is a real number. Then for $B > 0$, $z \in \mathbb{C}$ such that $|z| \le B \log x/(\log_2 x \log_3 x)$:

$$\sum_{m=1}^{\infty} \frac{d_z(m)}{m} a_m \ll \exp\left((2B + o(1)) \frac{\log x}{\log_2 x}\right).$$

*Proof:* We split the above sum into two sums: one over $m \le e^{(\log \log x)^{1/\kappa}}$ and the other one over $m > e^{(\log \log x)^{1/\kappa}}$. We let $m = m_0 m_1^2$ and put $k = \lceil |z| \rceil$. Since $d_k(m) \le d_k(m_0)d_k(m_1^2) \le d_k(m_0)d_k(m_1)^2$, the first sum is

$$\ll \sum_{m=1}^{\infty} \frac{d_k(m) \exp\left(\mathcal{O}\left(\log_2^{1/\kappa-1} x\right)\right)}{m_0 m} \ll \exp\left(\mathcal{O}\left(\log_2^{1/\kappa-1} x\right)\right) \sum_{m=1}^{\infty} \frac{d_k(m)}{m_0 m} \\ \ll \exp\left(\mathcal{O}\left(\log_2^{1/\kappa-1} x\right)\right) \sum_{m_0=1}^{\infty} \frac{d_k(m_0)}{m_0^2} \sum_{m_1=1}^{\infty} \frac{d_k(m_1)^2}{m_1^2} = \exp\left(\mathcal{O}\left(\log_2^{1/\kappa-1} x\right)\right) \zeta(2)^k \sum_{m=1}^{\infty} \frac{d_k(m)^2}{m^2}.$$
Lemma 3.3 of [8] reveals that this expression is

$$ \ll \exp\left(\mathcal{O}\left(\log_2^{1/\kappa-1} x\right)\right) \zeta(2)^k \exp\left((2+o(1))k \log_2(k+3)\right) \ll \exp\left((2B+o(1))\frac{\log x}{\log_2 x}\right), $$

Similarly the other sum is

$$ \begin{aligned} & \ll \sum_{m>e^{(\log \log x)^{1/\kappa}}} \frac{d_z(m) m^{\mathcal{O}(1/\log(1+m)^\kappa+1/\log_2 x)}}{m m_0} \ll \sum_{m=1}^{\infty} \frac{d_k(m) m^{\mathcal{O}(1/\log \log x)}}{m m_0} \\ & \ll \sum_{m_0=1}^{\infty} \frac{d_k(m_0)}{m_0^{2-\mathcal{O}(1/\log \log x)}} \sum_{m_1=1}^{\infty} \frac{d_k(m_1)^2}{m_1^{2-\mathcal{O}(1/\log \log x)}}. \end{aligned} $$

Once again, Lemma 3.3 of [8] shows that this expression above is $\ll \exp\left((2B+o(1))\frac{\log x}{\log_2 x}\right)$, which concludes the proof. $\square$

**Lemma 3.7:** Let $x$ be large, $B > 0$ be a constant and $z \in \mathbb{C}$ be such that $|z| \le B \log x/(\log_2 x \log_3 x)$, let $s$ be a complex with real part $> 1/2$. Then

$$ \sum_{m=1}^{\infty} \frac{d_z(m)}{m} h_m(s) = \prod_p \left( a_p(s) \left(1 - \frac{1}{p}\right)^{-z} + b_p(s) \left(1 + \frac{1}{p}\right)^{-z} + c_p(s) \right) $$

and both of these terms are analytic in the variable $s$ in this region.

*Proof:* This equality is true for any real number $s > 1/2$, since in this case Lemma 3.3 ensures that

$$ \sum_{m=1}^{\infty} \frac{d_z(m)}{m} h_m(s) = \sum_{m=1}^{\infty} \frac{d_z(m)}{m} \mathbb{E}(X_s(m)) = \mathbb{E}(L(1, X_s)^z), $$

which concludes (in the case of real numbers), thanks to the Euler product expression for $L(1, X_s)$. To prove that the equality holds for complex numbers, we shall rely on the analytic continuation principle. For any $1/2 < \sigma < 1$ and any $s$ such that $\Re(s) > \sigma$, Lemma 3.4 and Lemma 3.6 ensure that

$$ \sum_{m=1}^{\infty} \sup_{s:\Re(s)>\sigma} \left| \frac{d_z(m)}{m} h_m(s) \right| \ll \sum_{m=1}^{\infty} \frac{d_{|z|}(m)}{m_0 m} m^{\mathcal{O}(1/\log(1+m)^\sigma/2)} \ll_{\sigma,x} 1. $$

This proves that $\sum_{m=1}^{\infty} \frac{d_z(m)}{m} h_m(s)$ is a series of analytic functions that converges uniformly in any compact of the half-plane $\Re(s) > 1/2$, and hence is analytic in this region. Furthermore in
this region, we have $a_p(s), b_p(s) = 1/2 + O(1/p)$, which leads to<fnref n="1" />

$$ 
\begin{align*}
& \prod_{p \ge 3} \left( a_p(s) \left(1 - \frac{1}{p}\right)^{-z} + b_p(s) \left(1 + \frac{1}{p}\right)^{-z} + c_p(s) \right) \\
&= \prod_{p \ge 3} \left( a_p(s) \left[ \left(1 - \frac{1}{p}\right)^{-z} - 1 \right] + b_p(s) \left[ \left(1 + \frac{1}{p}\right)^{-z} - 1 \right] + 1 \right) \\
&= \prod_{p \ge 3} \left( \left[ \frac{1}{2} + O\left(\frac{1}{p}\right) \right] \left[ \frac{z}{p} + O_z\left(\frac{1}{p^2}\right) \right] + \left[ \frac{1}{2} + O\left(\frac{1}{p}\right) \right] \left[ -\frac{z}{p} + O_z\left(\frac{1}{p^2}\right) \right] + 1 \right) \\
&= \prod_{p \ge 3} \left( 1 + O_z\left(\frac{1}{p^2}\right) \right),
\end{align*}
$$

which is analytic in $\Re(s) > 1/2$. The factor corresponding to $p = 2$ is also analytic in this region. This concludes the proof. □

**Remark 3.8:** We may sometimes write $\mathbb{E}(L(1, \mathbb{X}_s)^z)$ even when $s$ is a complex number. This should not be defined, since $(\mathbb{X}_s(n))$ are not defined if $s \notin \mathbb{R}$. However, thanks to the result above, we can extend the definitions and denote the Euler product of Lemma 3.7 above by $\mathbb{E}(L(1, \mathbb{X}_s)^z)$.

**Lemma 3.9:** Let $z \in \mathbb{C}$. Then

$$ \sum_{m=1}^{\infty} \frac{d_z(m)}{m} H_m(1) = \frac{\mathbb{E}(L(1, \mathbb{X})^z)}{\zeta(2)} $$

and

$$ \sum_{m=1}^{\infty} \frac{d_z(m)}{m} H'_m(1) = \frac{\mathbb{E}(L(1, \mathbb{X})^z)}{\zeta(2)} (\phi(z) - 2\gamma), $$

with $\phi$ being defined in Theorem 1.2.

*Proof:* Let $s > 1/2$ be a real number and put $\psi(s) := \frac{8^s+2^{s+2}}{8^s+4^s}$ for commodity. By (3.2) and by Lemma 3.3:

$$ \sum_{m=1}^{\infty} \frac{d_z(m)}{m} H_m(s) = \frac{\psi(s)}{\zeta(2s)} \sum_{m=1}^{\infty} \frac{d_z(m)}{m} h_m(s) = \frac{\psi(s)}{\zeta(2s)} \mathbb{E} \left( \sum_{m=1}^{\infty} \frac{d_z(m)}{m} \mathbb{X}_s(m) \right) = \frac{\psi(s)}{\zeta(2s)} \mathbb{E}(L(1, \mathbb{X}_s)^z). $$

At $s = 1$, we simply find the expected $\mathbb{E}(L(1, \mathbb{X})^z)/\zeta(2)$. Furthermore,

$$ 
\begin{align}
\sum_{m=1}^{\infty} \frac{d_z(m)}{m} H'_m(1) &= \frac{\psi'(1)}{\zeta(2)} \mathbb{E}(L(1, \mathbb{X})^z) - \frac{2\zeta'(2)\psi(1)}{\zeta(2)^2} \mathbb{E}(L(1, \mathbb{X})^z) + \frac{\psi(1)}{\zeta(2)} \frac{d}{ds} \mathbb{E}(L(1, \mathbb{X}_s)^z) \Big|_{s=1} \nonumber \\
&= \frac{\mathbb{E}(L(1, \mathbb{X})^z)}{\zeta(2)} \left\{ -\frac{\log 2}{2} - \frac{2\zeta'(2)}{\zeta(2)} + \frac{\frac{d}{ds} \mathbb{E}(L(1, \mathbb{X}_s)^z)}{\mathbb{E}(L(1, \mathbb{X})^z)} \Big|_{s=1} \right\}. \tag{3.4}
\end{align}
$$

<footnote n="1">¹Recall that $c_p(s) = 1 - a_p(s) - b_p(s)$.</footnote>
Recalling the definitions (3.1) of $a_p(s)$, $b_p(s)$ and that $c_p(s) = 1 - a_p(s) - b_p(s)$, we may use the Euler product expression for $\mathbb{E}(L(1, \mathbb{X}_s)^z)$ to find that

$$ 
\begin{aligned}
\frac{\frac{d}{ds} \mathbb{E}(L(1, \mathbb{X}_s)^z)|_{s=1}}{\mathbb{E}(L(1, \mathbb{X})^z)} &= \left. \frac{d}{ds} \log \mathbb{E}(L(1, \mathbb{X}_s)^z) \right|_{s=1} \\
&= \sum_{p \ge 3} \frac{a'_p(1) \left[ \left(1 - \frac{1}{p}\right)^{-z} - 1 \right]}{a_p(1) \left(1 - \frac{1}{p}\right)^{-z} + b_p(1) \left(1 + \frac{1}{p}\right)^{-z} + c_p(1)} + \frac{\log 2}{9} \frac{\frac{-13}{4} 2^z + \frac{9}{4} \left(\frac{2}{3}\right)^z + 1}{\frac{1}{6} 2^z + \frac{1}{2} \left(\frac{2}{3}\right)^z + \frac{4}{3}} \\
&= \sum_{p \ge 3} \frac{\frac{2 \log p}{(p+1)^2} \left[ 1 - \left(1 - \frac{1}{p}\right)^{-z} \right]}{\mathbb{E}\left(\left(1 - \frac{\mathbb{X}(p)}{p}\right)^z\right)} + \frac{\log 2}{9} \frac{\frac{-13}{4} 2^z + \frac{9}{4} \left(\frac{2}{3}\right)^z + 1}{\frac{1}{6} 2^z + \frac{1}{2} \left(\frac{2}{3}\right)^z + \frac{4}{3}}.
\end{aligned} 
\quad (3.5) $$

In (3.4), this proves that

$$ \sum_{m=1}^{\infty} \frac{d_z(m)}{m} H'_m(1) = \frac{\mathbb{E}(L(1, \mathbb{X})^z)}{\zeta(2)} (\phi(z) - 2\gamma), $$

which is the expected result.

**Lemma 3.10:** Let $z \in \mathbb{C}$, $\Re(z) \ge -1$. Then for any $s$ with real part $\ge 2/3$:

$$ \mathbb{E}(L(1, \mathbb{X}_s)^z) \ll \mathbb{E}(L(1, \mathbb{X})^{\Re(z)}). $$

This also holds for $\mathbb{X}_\infty$.

Furthermore, this estimate above holds if the left-hand side is replaced by $\left. \frac{d}{ds} \mathbb{E}(L(1, \mathbb{X}_s)^z) \right|_{s=1}$ or $\left. \frac{d^2}{ds^2} \mathbb{E}(L(1, \mathbb{X}_s)^z) \right|_{s=1}$.

*Proof:* We put $\sigma := \Re(z)$. First, we assume that $-1 \le \sigma \le 8$. In this case for $p \ge 3$,

$$ 
\begin{aligned}
& \left| a_p(s) \left(1 - \frac{1}{p}\right)^{-z} + b_p(s) \left(1 + \frac{1}{p}\right)^{-z} + c_p(s) \right| \\
& \le \left[ \frac{1}{2} - \frac{3}{2p} + \mathcal{O}(p^{-5/3}) \right] \left(1 - \frac{1}{p}\right)^{-\sigma} + \left[ \frac{1}{2} - \frac{1}{2p} \right] \left(1 + \frac{1}{p}\right)^{-\sigma} + \frac{2}{p} + \mathcal{O}(p^{-5/3}) \\
& = \left[ \frac{1}{2} - \frac{3}{2p} + \mathcal{O}(p^{-5/3}) \right] \left\{ \left(1 - \frac{1}{p}\right)^{-\sigma} - 1 \right\} + \left[ \frac{1}{2} - \frac{1}{2p} \right] \left\{ \left(1 + \frac{1}{p}\right)^{-\sigma} - 1 \right\} + 1 + \mathcal{O}(p^{-5/3}) \\
& = 1 + \mathcal{O}(p^{-5/3}),
\end{aligned}
$$

which is obtained by Taylor expanding the factors $(1 \pm 1/p)^{-\sigma}$. Taking the product over primes $\ge 3$ and using the fact that the factor corresponding to $p = 2$ is $\mathcal{O}(1)$, we find that

$$ \mathbb{E}(L(1, \mathbb{X}_s)^z) \ll \prod_p (1 + \mathcal{O}(p^{-5/3})) \ll 1 \ll \mathbb{E}(L(1, \mathbb{X})^\sigma), $$

which is the expected result.
If $\sigma > 8$, notice that for any $p \ge 2$:

$$ \left| a_p(1) \left(1 - \frac{1}{p}\right)^{-z} + b_p(1) \left(1 + \frac{1}{p}\right)^{-z} + c_p(1) \right| \ge a_p(1) \left(1 - \frac{1}{p}\right)^{-8} - b_p(1) \left(1 + \frac{1}{p}\right)^{-8} - c_p(1) \\ \ge 1 > 0, \qquad (3.6) $$

and hence the following computations are licit<fnref n="1" />:

$$ \frac{\mathbb{E}(L(1, \mathbb{X}_s)^z)}{\mathbb{E}(L(1, \mathbb{X})^z)} \ll \frac{\prod_{p \ge 3} \left| a_p(s) \left[ \left(1 - \frac{1}{p}\right)^{-z} - 1 \right] + b_p(1) \left[ \left(1 + \frac{1}{p}\right)^{-z} - 1 \right] + 1 \right|}{\prod_{p \ge 3} \left| a_p(1) \left[ \left(1 - \frac{1}{p}\right)^{-z} - 1 \right] + b_p(1) \left[ \left(1 + \frac{1}{p}\right)^{-z} - 1 \right] + 1 \right|} \\ = \prod_{p \ge 3} \left| 1 + \frac{(a_p(s) - a_p(1)) \left[ \left(1 - \frac{1}{p}\right)^{-z} - 1 \right]}{a_p(1) \left[ \left(1 - \frac{1}{p}\right)^{-z} - 1 \right] + b_p(1) \left[ \left(1 + \frac{1}{p}\right)^{-z} - 1 \right] + 1} \right|. \qquad (3.7) $$

By definition, since $\Re(s) \ge 2/3$:

$$ a_p(s) - a_p(1) \ll 1/p^{5/3}. \qquad (3.8) $$

If $(1 - \frac{1}{p})^{-\sigma} > e^{10}$, then we see that

$$ \left| a_p(1) \left[ \left(1 - \frac{1}{p}\right)^{-z} - 1 \right] + b_p(1) \left[ \left(1 + \frac{1}{p}\right)^{-z} - 1 \right] + 1 \right| \ge \frac{1}{10} \left[ \left(1 - \frac{1}{p}\right)^{-\sigma} - 1 \right], $$

and if $(1 - \frac{1}{p})^{-\sigma} \le e^{10}$, then we may use (3.6) to show that the denominator in (3.7) is $\ge 1$ and (3.8) to show that the numerator is $\ll p^{-5/3}$. Either way,

$$ \frac{\mathbb{E}(L(1, \mathbb{X}_s)^z)}{\mathbb{E}(L(1, \mathbb{X})^z)} \ll \prod_{p \ge 3} \left( 1 + \mathcal{O} \left( \frac{1}{p^{5/3}} \right) \right) \ll 1. $$

Since $\mathbb{E}(L(1, \mathbb{X})^z) \ll \mathbb{E}(L(1, \mathbb{X})^\sigma)$, this implies that for any value of $\sigma \ge -1$, we have

$$ \mathbb{E}(L(1, \mathbb{X}_s)^z) \ll \mathbb{E}(L(1, \mathbb{X})^\sigma). $$

By the analyticity proved in Lemma 3.7 above, we may let $s \to \infty$, which concludes the first part of the proof.

We now turn to the other two estimates. We first bound $\frac{d}{ds}\mathbb{E}(L(1, \mathbb{X}_s)^z)|_{s=1}$. By our (3.5) above, we know that

$$ \frac{d}{ds} \mathbb{E}(L(1, \mathbb{X}_s)^z)|_{s=1} = \mathbb{E}(L(1, \mathbb{X})^z) \left( \sum_{p \ge 3} \frac{\frac{2 \log p}{(p+1)^2} \left[ 1 - \left(1 - \frac{1}{p}\right)^{-z} \right]}{\mathbb{E}\left(\left(1 - \frac{\mathbb{X}(p)}{p}\right)^z\right)} + \frac{\log 2}{9} \frac{-13}{4} 2^z + \frac{9}{4} \left(\frac{2}{3}\right)^z + 1}{\frac{1}{6} 2^z + \frac{1}{2} \left(\frac{2}{3}\right)^z + \frac{4}{3}} \right). \qquad (3.9) $$

<footnote n="1">¹Observe that $b_p(s) = b_p(1)$.</footnote>
Observe that, for a given prime $p$ and $-1 \le \sigma \le 8$, we have $\prod_{q \ne p} \mathbb{E} \left( \left(1 - \frac{\mathcal{X}(q)}{q}\right)^{-z} \right) \ll \mathbb{E}(L(1, \mathcal{X})^{\sigma})$, since the missing factor $\mathbb{E}\left((1 - \mathcal{X}(p)/p)^{-\sigma}\right)$ is $\gg 1$. Thus following the same reasoning as above, if $-1 \le \sigma \le 8$ we have

$$ \left. \frac{d}{ds} \mathbb{E}(L(1, \mathcal{X}_s)^z) \right|_{s=1} \ll \mathbb{E}(L(1, \mathcal{X})^{\sigma}) \left( \sum_{p \ge 3} \frac{2 \log p}{(p+1)^2} \left[ 1 + \left(1 - \frac{1}{p}\right)^{-\sigma} \right] + \mathcal{O}(1) \right) \\ \ll \mathbb{E}(L(1, \mathcal{X})^{\sigma}). $$

Otherwise if $\sigma > 8$, then by considering the cases $\left(1 - \frac{1}{p}\right)^{-\sigma} > e^{10}$ and $\left(1 - \frac{1}{p}\right)^{-\sigma} \le e^{10}$, we deduce that the term inside parenthesis in (3.9) is $\ll 1$. Therefore, for all $\sigma \ge -1$, we have

$$ \left. \frac{d}{ds} \mathbb{E}(L(1, \mathcal{X}_s)^z) \right|_{s=1} \ll \mathbb{E}(L(1, \mathcal{X})^{\sigma}). $$

We now turn to the quantity $\left. \frac{d^2}{ds^2} \mathbb{E}(L(1, \mathcal{X}_s)^z) \right|_{s=1}$. For convenience, we put $E_{z,p}(s) := \mathbb{E} \left( \left(1 - \frac{\mathcal{X}_s(p)}{p}\right)^{-z} \right)$, so that $\mathbb{E}(L(1, \mathcal{X}_s)^z) = \prod_p E_{z,p}(s)$. We have

$$ \left. \frac{d^2}{ds^2} \mathbb{E}(L(1, \mathcal{X}_s)^z) \right|_{s=1} = \sum_p E'_{z,p}(1) \sum_{q \ne p} \left[ \prod_{r \ne p, q} E_{z,r}(1) \right] E'_{z,q}(1) + \sum_p E''_{z,p}(1) \prod_{q \ne p} E_{z,q}(1). \quad (3.10) $$

Now and for the rest of the proof, observe that we have for $p \ge 3$:

$$ E''_{z,p}(1) = \frac{2(p-1)(\log p)^2}{(p+1)^3} \left( \left(1 - \frac{1}{p}\right)^{-z} - 1 \right), \quad (3.11) $$

and recall that in (3.9) we showed that

$$ E'_{z,p}(1) = \frac{2 \log p}{(p+1)^2} \left[ 1 - \left(1 - \frac{1}{p}\right)^{-z} \right]. \quad (3.12) $$

Once again, we do the exact same reasoning: if $-1 \le \sigma \le 8$, then we can introduce the missing factors in the products of (3.10) (respectively $E_{\sigma,p}(1) \times E_{\sigma,q}(1)$ and $E_{\sigma,p}(1)$, which are $\gg 1$), and hence

$$ \prod_{r \ne p, q} E_{z,r}(1), \prod_{q \ne p} E_{z,q}(1) \ll \prod_p E_{z,p}(1) = \mathbb{E}(L(1, \mathcal{X})^z). $$

Therefore

$$ \left. \frac{d^2}{ds^2} \mathbb{E}(L(1, \mathcal{X}_s)^z) \right|_{s=1} \ll \mathbb{E}(L(1, \mathcal{X})^{\sigma}) \left[ \left( \sum_p |E'_{z,p}(1)| \right)^2 + \sum_p |E''_{z,p}(1)| \right] \ll \mathbb{E}(L(1, \mathcal{X})^{\sigma}). $$

Now if $\sigma > 8$ then $|E_{z,p}(1)| \ge 1$ by (3.6) and hence it is licit to deduce from (3.10) that

$$ \left. \frac{d^2}{ds^2} \mathbb{E}(L(1, \mathcal{X}_s)^z) \right|_{s=1} \ll \mathbb{E}(L(1, \mathcal{X})^{\sigma}) \left[ \left( \sum_p \left| \frac{E'_{z,p}(1)}{E_{z,p}(1)} \right| \right)^2 + \sum_p \left| \frac{E''_{z,p}(1)}{E_{z,p}(1)} \right| \right]. $$
As shown earlier when bounding the term inside the parenthesis in (3.9), by considering the cases $(1 - \frac{1}{p})^{-\sigma} > e^{10}$ and $(1 - \frac{1}{p})^{-\sigma} \le e^{10}$ and using (3.12) we show that the first sum above is $\ll 1$ (the case $p = 2$ is dealt with separately). Now we turn to the second sum and once again considering the cases $(1 - \frac{1}{p})^{-\sigma} > e^{10}$ and $(1 - \frac{1}{p})^{-\sigma} \le e^{10}$ and using (3.11), this second sum is $\ll 1$, and hence for all $\sigma \ge -1$,

$$ \left. \frac{d^2}{ds^2} \mathbb{E}(L(1, \mathbb{X}_s)^z) \right|_{s=1} \ll \mathbb{E}(L(1, \mathbb{X})^\sigma). $$

□

Observe that, as in (3.4), if $f(m)$ is a linear combination of $H_m(1)$, $H'_m(1)$ and $H''_m(1)$, then

$$ \sum_{m=1}^{\infty} \frac{d_z(m)}{m} f(m) = A \mathbb{E}(L(1, \mathbb{X})^z) + B \frac{d}{ds} \mathbb{E}(L(1, \mathbb{X}_s)^z) \Big|_{s=1} + C \frac{d^2}{ds^2} \mathbb{E}(L(1, \mathbb{X}_s)^z) \Big|_{s=1} $$

for some constants $A$, $B$, and $C$. Therefore, our Lemma 3.10 implies the following corollary:

**Corollary 3.11:** Let $f(m)$ be a linear combination of $H_m(1)$, $H'_m(1)$ and $H''_m(1)$. Let $z$ be a complex number with real part $\ge -1$. Then

$$ \sum_{m=1}^{\infty} \frac{d_z(m)}{m} f(m) \ll \mathbb{E}(L(1, \mathbb{X})^{\Re(z)}). $$

**Remark 3.12:** In particular, thanks to Lemma 3.9 combined to the corollary above, we know that

$$ \mathbb{E}(L(1, \mathbb{X})^z)\phi(z) \ll \mathbb{E}(L(1, \mathbb{X})^{\Re(z)}). $$

# 4 The sum $\sum_{d \in \mathcal{D}_{\alpha}(x)} \chi_d(m)$

We recall that $X_\alpha := x^\alpha - x^{-1-\alpha}$, $\alpha_0$ is such that $X_{\alpha_0} = 1$ and $\alpha_1$ is such that $X_{\alpha_1} = 2$, as defined above (2.2).

**Proposition 4.1:** Let $m$ be a positive integer, $x$ be a large real number. We recall that $Y_1$ is defined in Lemma 2.1. Then uniformly in $\alpha_1 \le \alpha < 1/2$, we have

$$ \sum_{d \in \mathcal{D}_\alpha(x)} \chi_d(m) = \sqrt{x} \left( \alpha^2 \frac{\mathbb{E}(\mathbb{X}(m))}{2\zeta(2)} \log^2 x + \alpha \left\{ H'_m(1) + (2\gamma - 2\alpha) \frac{\mathbb{E}(\mathbb{X}(m))}{\zeta(2)} \right\} (\log x - 2) + \mathfrak{S}_2(m) \right) \\ + (1 - \sqrt{Y_1(1, \alpha)}) \mathbb{E}(\mathbb{X}_\infty(m)) + \mathcal{I}(x, m, \alpha) + \mathcal{O} \left( m x^\alpha \log x + \frac{\log^2(m+1)}{m_0} \right) $$

where

$$ \mathfrak{S}_2 := \mathfrak{S}_2(m) := \frac{H''_m(1)}{2} + 2\gamma H'_m(1) + (\gamma^2 - 2\gamma_1)H_m(1) $$

with $\gamma_1$ being the first Stieltjes constant, and

$$ \mathcal{I}(x, m, \alpha) := \frac{X_{\alpha}^{1/(2\alpha)}}{2\pi i} \int_{-1/\log \log x - i\infty}^{-1/\log \log x + i\infty} H_m(1+s) \zeta^2(1+s) \frac{1/(2\alpha)}{s(s+1/(2\alpha))} X_{\alpha}^s ds \\ \ll \sqrt{x} \frac{m^{1/\log(1+m)^{1/4}}}{m_0} (\log \log x)^3. $$
Uniformly in $\alpha_0 \le \alpha \le \alpha_1$, we have

$$ \sum_{d \in \mathcal{D}_{\alpha}(x)} \chi_d(m) = (\sqrt{x} - \sqrt{Y_1(1, \alpha)}) \mathbb{E}(\mathbb{X}_{\infty}(m)) + \mathcal{O}(m \log x). $$

**Remark 4.2:** This proves that for any fixed $0 < \alpha < 1/2$:

$$ \sum_{d \in \mathcal{D}_{\alpha}(x)} \chi_d(m) = \alpha^2 \sqrt{x} \frac{\mathbb{E}(\mathbb{X}(m))}{2\zeta(2)} \log^2 x + \mathcal{O}_m(\sqrt{x} \log x), $$

and hence

$$ \#\mathcal{D}_{\alpha}(x) \sim \frac{\alpha^2 \sqrt{x}}{2\zeta(2)} \log^2 x. \qquad (4.1) $$

Therefore, for any fixed $m$ and fixed $0 < \alpha < 1/2$,

$$ \frac{1}{\mathbb{E}(\mathbb{X}(m))} \sum_{d \in \mathcal{D}_{\alpha}(x)} \chi_d(m) \sim \#\mathcal{D}_{\alpha}(x), $$

which is the very reason for the definition of $\mathbb{X}(m)$'s law. However we chose not to present our proposition in this way, for the error terms we would get would not be sharp enough for what the next section requires.

**Proof (of Proposition 4.1):** We recall the equality proved in (2.3) and the definition of $B_m(u)$ in Lemma 2.3, so that using Lemma 2.2 leads to

$$ \begin{aligned} \sum_{d \in \mathcal{D}_\alpha(x)} \chi_d(m) &= \sum_{u=1}^{X_\alpha} \frac{\sqrt{x} - \sqrt{Y_1}}{4u} \sum_{\substack{2 < a \le 4u^2 + 2 \\ d(a,u) \in \mathcal{D}}} \frac{C_{m,a,u}}{m} + \mathcal{O}\left(m \sum_{u=1}^{X_\alpha} \rho(u)\right) \\ &= \sum_{u=1}^{X_\alpha} \frac{\sqrt{x} - \sqrt{Y_1}}{4u} \frac{(-1)^{\omega(m_0)}}{m_0} \prod_{\substack{2 \le j \le r \\ e_j \text{ is even}}} \left(1 - \frac{2}{p_j}\right) \prod_{\substack{p_j \nmid u \\ e_j \text{ is even}}} \left(1 + \frac{1}{p_j - 2}\right) B_m(u) \\ &\quad + \mathcal{O}(mx^\alpha \log x), \end{aligned} \qquad (4.2) $$

since $\rho(u) \ll d(u)$, with $d(u)$ being the usual divisor function, by the Chinese remainder Theorem.

Now if

$$ \mathfrak{F}_m(u) := \frac{(-1)^{\omega(m_0)}}{4m_0} \prod_{\substack{2 \le j \le r \\ e_j \text{ is even}}} \left(1 - \frac{2}{p_j}\right) \prod_{\substack{p_j \nmid u \\ e_j \text{ is even}}} \left(1 + \frac{1}{p_j - 2}\right) B_m(u), $$

Lemma 2.4 reveals that for $\Re(s) > 1$:

$$ \begin{aligned} \mathcal{L}_m(s) := & \sum_{\substack{u \ge 1 \\ (u,m_0)=1}} \frac{\mathfrak{F}_m(u)}{u^s} \\ &= \frac{(-1)^{\omega(m_0)}}{m_0} \prod_{\substack{2 \le j \le r \\ e_j \text{ is even}}} \left(1 - \frac{2}{p_j}\right) \frac{a(m)}{4} \times \Sigma(m, s) \\ &= \frac{(-1)^{\omega(m_0)}}{m_0} \prod_{\substack{2 \le j \le r \\ e_j \text{ is even}}} \left(1 - \frac{2}{p_j}\right) \frac{a(m)}{4} \times G_m(s) \zeta^2(s) = H_m(s) \zeta(s)^2 \end{aligned} $$
where $H_m(s)$ was defined in (2.6). Observe that $H_m(s)$ is analytic in the region $\Re(s) > 1/2$, since $G_m(s)$ is. From now on, we assume that $\alpha \ge \alpha_1$, from which we deduce that $\alpha \gg 1/\log x$ and hence

$$X_{\alpha}^{1/(2\alpha)} = \sqrt{x}(1 - x^{-1-2\alpha})^{1/(2\alpha)} = \sqrt{x} \exp\left(\mathcal{O}\left(\frac{1}{\alpha x}\right)\right) = \sqrt{x} + \mathcal{O}\left(\frac{1}{x^{1/3}}\right). \quad (4.3)$$

Therefore, using Lemma 3.1, (4.3) and the fact that $\mathfrak{F}_m(u) \ll \log(1+u)/m_0$, we may deduce that

$$\begin{align*}
& \sum_{u \le X_\alpha} (\sqrt{x} - \sqrt{Y_1}) \frac{\mathfrak{F}_m(u)}{u} \\
&= \sum_{u \le X_\alpha} (X_\alpha^{1/(2\alpha)} - u^{1/(2\alpha)}) \frac{\mathfrak{F}_m(u)}{u} + \sum_{u \le X_\alpha} (\sqrt{x} - X_\alpha^{1/(2\alpha)}) \frac{\mathfrak{F}_m(u)}{u} + \sum_{u \le X_\alpha} (u^{1/(2\alpha)} - \sqrt{Y_1(u, \alpha)}) \frac{\mathfrak{F}_m(u)}{u} \\
&= \sum_{u \le X_\alpha} (X_\alpha^{1/(2\alpha)} - u^{1/(2\alpha)}) \frac{\mathfrak{F}_m(u)}{u} + (1 - \sqrt{Y_1(1, \alpha)}) \mathbb{E}(X_\infty(m)) + \mathcal{O}\left(\frac{1}{m_0}\right). \tag{4.4}
\end{align*}$$

The expectation appears since $\mathbb{E}(X_\infty(m)) = \mathfrak{F}_m(1)$ by Lemma 3.3, because<fnref n="1" /> $B_m(1) = a(m)$ by Lemma 2.3.

We now apply a weighted version of Perron's formula -which has the advantage of being absolutely convergent-, as a direct consequence of Theorem 2.1 of part II.2 of [14]. We fix $\kappa > 0$, and

$$\sum_{u \le X_\alpha} (X_\alpha^{1/(2\alpha)} - u^{1/(2\alpha)}) \frac{\mathfrak{F}_m(u)}{u} = \frac{X_\alpha^{1/(2\alpha)}}{2\pi i} \int_{\kappa-i\infty}^{\kappa+i\infty} \mathcal{L}_m(1+s) \frac{1/(2\alpha)}{s(s+1/(2\alpha))} X_\alpha^s ds. \quad (4.5)$$

Moving the integration segment to the left<fnref n="2" />, say to $\Re(s) = -1/\log\log x$, we can apply the residue theorem to the only pole of the integrand: a third order pole at $s = 0$. The said residue is equal to

$$\mathrm{Res} = \frac{1}{2!(2\alpha)} \frac{\mathrm{d}^2}{\mathrm{d}s^2} \left. \left( \frac{H_m(1+s)\zeta^2(1+s)s^2}{s+1/(2\alpha)} X_\alpha^s \right) \right|_{s \to 0} = \frac{H_m(1)}{2} \log^2 X_\alpha + \Delta_1 \log X_\alpha + \Delta_2.$$

where

$$\Delta_k = \frac{1}{k} \frac{\mathrm{d}^k}{\mathrm{d}s^k} \left. \frac{H_m(1+s)\zeta^2(1+s)s^2}{2\alpha s + 1} \right|_{s \to 0}, \quad k = 1, 2.$$

If we let

$$\tilde{\partial}_k = \frac{1}{k} \frac{\mathrm{d}^k}{\mathrm{d}s^k} H_m(1+s) \zeta^2(1+s) s^2 \Big|_{s \to 0}, \quad k = 1, 2,$$

then,

$$\tilde{\partial}_1 = H'_m(1) + 2\gamma H_m(1), \quad \tilde{\partial}_2 = \frac{H''_m(1)}{2} + 2\gamma H'_m(1) + (\gamma^2 - 2\gamma_1)H_m(1), \quad (4.6)$$

and

$$\Delta_1 = \tilde{\partial}_1 - 2\alpha H_m(1), \quad \Delta_2 = \tilde{\partial}_2 - 2\alpha \tilde{\partial}_1 + (2\alpha)^2 H_m(1).$$

<footnote n="1">¹Recall that $a(m) = 4$ if $m$ is odd, and equals $2(-1)^{e_1}$ otherwise.</footnote>

<footnote n="2">²This can be done since the integrand is of finite order.</footnote>
Therefore,

$$ \mathrm{Res} = \frac{H_m(1)}{2} \log^2 X_\alpha + \{H'_m(1) + [2\gamma - 2\alpha]H_m(1)\} (\log X_\alpha - 2\alpha) + \mathfrak{O}_2. $$

Consequently, using (4.5) in (4.4) leads to

$$ \sum_{u \le X_\alpha} (\sqrt{x} - \sqrt{Y_1}) \frac{\mathfrak{F}_m(u)}{u} = X_\alpha^{1/(2\alpha)} \mathrm{Res} + (1 - \sqrt{Y_1(1, \alpha)}) \mathbb{E}(\mathbb{X}_\infty(m)) + \mathcal{I}(x, m, \alpha) + \mathcal{O}\left(\frac{1}{m_0}\right), $$

where

$$ \mathcal{I}(x, m, \alpha) := \frac{X_{\alpha}^{1/(2\alpha)}}{2\pi i} \int_{-1/\log \log x - i\infty}^{-1/\log \log x + i\infty} H_m(1+s)\zeta^2(1+s) \frac{1/(2\alpha)}{s(s+1/(2\alpha))} X_{\alpha}^s ds. \quad (4.7) $$

Inserting this estimate in (4.2), we get

$$ \begin{aligned} \sum_{d \in \mathcal{D}_\alpha(x)} \chi_d(m) &= \sum_{u \le X_\alpha} \frac{(\sqrt{x} - \sqrt{Y_1}) \mathfrak{F}_m(u)}{u} + \mathcal{O}(mx^\alpha \log x) \\ &= X_\alpha^{1/(2\alpha)} \mathrm{Res} + (1 - \sqrt{Y_1(1, \alpha)}) \mathbb{E}(\mathbb{X}_\infty(m)) + \mathcal{I}(x, m, \alpha) + \mathcal{O}\left(mx^\alpha \log x + \frac{1}{m_0}\right). \end{aligned} \quad (4.8) $$

Naturally we wish to use that $X_\alpha \approx x^\alpha$ to simplify the above expression. Since $X_\alpha = x^\alpha - x^{-1-\alpha}$, we may write that

$$ \log X_\alpha = \log(x^\alpha) + \log(1 - x^{-1-2\alpha}) = \alpha \log x + \mathcal{O}(1/x), \quad (4.9) $$

and

$$ \log^2 X_\alpha = \alpha^2 \log^2 x + \mathcal{O}(\log x/x). $$

Also recall the estimate (4.3). Therefore changing these expressions in Res by the main term of the above estimates introduces an error

$$ \ll \frac{H_m(1) + H'_m(1) + H''_m(1)}{x^{1/3}} \ll \frac{h_m(1) + h'_m(1) + h''_m(1)}{x^{1/3}} \ll \frac{\log^2(m+1)}{m_0 x^{1/3}}, $$

by Lemma 3.4. Thus (4.8) becomes

$$ \begin{aligned} \sum_{d \in \mathcal{D}_\alpha(x)} \chi_d(m) = & \sqrt{x} \left( \alpha^2 \frac{H_m(1)}{2} \log^2 x + \alpha \{H'_m(1) + (2\gamma - 2\alpha)H_m(1)\} (\log x - 2) + \mathfrak{O}_2 \right) \\ & + (1 - \sqrt{Y_1(1, \alpha)}) \mathbb{E}(\mathbb{X}_\infty(m)) + \mathcal{I}(x, m, \alpha) + \mathcal{O}\left(mx^\alpha \log x + \frac{\log^2(m+1)}{m_0}\right). \end{aligned} $$

This concludes the first part of the proof, since $H_m(1) = \mathbb{E}(\mathbb{X}(m))/\zeta(2)$.

To prove the bound on $\mathcal{I}(x, m, \alpha)$, we will rely on estimates for $\zeta(s)$ in the critical strip and more precisely the fact that for each positive constant $c$ and $t \ge 2$ such that $\sigma \ge 1 - c/\log t$:

$$ \zeta(\sigma + it) \ll \log t \quad (4.10) $$
(see Theorem II.3.9 of [14] for a proof). Furthermore let $\mu(\sigma)$ be the infinimum of all real numbers $a$ such that $\zeta(\sigma + i\tau) = \mathcal{O}(\tau^a)$, $|\tau| \ge 1$, $0 < \sigma \le 1$. It is well known that $\mu$ is convex, thanks to the Phragmén-Lindelöf theorem. It is also known that $\mu(1/2) \le 1/6$. Many improvements of this bound have been given since, but would not bring significantly better results here. These facts may be found through the section II.3.4 of [14]. Since $\mu(\sigma) \le \frac{1}{3}(1-\sigma)$ for any $\sigma \in [1/2, 1]$, we find that

$$ \mu \left( 1 - \frac{1}{\log \log x} \right) \le \varepsilon, \qquad (4.11) $$

for any small and fixed $\varepsilon > 0$. Consequently, since Lemma 3.4 reveals that $H_m(1+s) \ll h_m(1+s) \ll m^{1/\log(1+m)^{1/4}}/m_0$ on the line $\Re(s) = -1/\log \log x$ and since $\zeta(1+s) \ll 1/|s|$ when $s \to 0$, we find that

$$ \mathcal{I}(x, m, \alpha) \ll \sqrt{x} \frac{m^{1/\log(1+m)^{1/4}}}{m_0} \left( \log \log^3 x + \int_2^\infty \frac{|\zeta(1 - 1/\log \log x + it)|^2}{t\sqrt{(2\alpha t)^2 + 1}} dt \right). $$

The contribution to integral above when $t \ge (\log x)^2$ is relatively small. Indeed in this range, we have $\sqrt{t\alpha} \ge \sqrt{t\alpha_1} \gg \sqrt{t}/\log x \ge 1$, and hence $(t\alpha)^2 \gg t$. With (4.11), this implies that

$$ \int_{(\log x)^2}^{\infty} \frac{|\zeta(1 - 1/\log \log x + it)|^2}{t\sqrt{(2\alpha t)^2 + 1}} dt \ll \int_{(\log x)^2}^{\infty} \frac{t^{1/10}}{t^{1+1/2}} dt \ll 1. $$

For the remaining $2 \le t \le (\log x)^2$, we instead use (4.10) to prove that

$$ \int_2^{(\log x)^2} \frac{|\zeta(1 - 1/\log \log x + it)|^2}{t\sqrt{(2\alpha t)^2 + 1}} dt \ll \int_2^{(\log x)^2} \frac{(\log t)^2}{t} dt \ll (\log \log x)^3. $$

Collecting the inequalities above, we find the expected

$$ \mathcal{I}(x, m, \alpha) \ll \sqrt{x} \frac{m^{1/\log(1+m)^{1/4}}}{m_0} (\log \log x)^3. \qquad (4.12) $$

Now if $\alpha_0 \le \alpha < \alpha_1 \ll 1/\log x$, then $1 \le X_\alpha < 2$. We can then use (4.2) to deduce that

$$ \begin{aligned} \sum_{d \in \mathcal{D}_\alpha(x)} \chi_d(m) &= (\sqrt{x} - \sqrt{Y_1(1, \alpha)}) \frac{(-1)^{\omega(m_0)}}{m_0} \prod_{\substack{2 \le j \le r \\ e_j \text{ even}}} \left(1 - \frac{2}{p_j}\right) \frac{a(m)}{4} + \mathcal{O}(mx^\alpha \log x) \\ &= (\sqrt{x} - \sqrt{Y_1(1, \alpha)}) \mathbb{E}(\mathbb{X}_\infty(m)) + \mathcal{O}(m \log x). \end{aligned} $$

The second equality relies on Lemma 3.3. This proves the last part of our proposition. $\square$

# 5 Mean value of L(1, χ_d)²

We need a good approximation for $L(1, \chi_d)^2$, and the one given by Dahl-Lamzouri appears to be perfectly suitable.

**Proposition 5.1** (Proposition 3.3 of [2]): Let $d \in \mathcal{D}$ be large and let $0 < \varepsilon < 1/2$ be fixed. Let $y$ be a real number such that $\log d/\log_2 d \le \log y \le \log d$. Assume that $L(s, \chi_d)$ has no zeros
inside the rectangle {$s \in \mathbb{C} : 1 - \varepsilon < \Re(s) \le 1, |\Im(s)| \le 2(\log d)^{2/\varepsilon}|$}. Then for any complex $z$ such that $|z| \le \log y/(4 \log_2 d \log_3 d)$ we have that

$$L(1, \chi_d)^z = \sum_{n=1}^{\infty} \frac{d_z(n)\chi_d(n)}{n} e^{-n/y} + \mathcal{O}_{\varepsilon}\left(\exp\left(-\frac{\log y}{2\log_2 d}\right)\right).$$

Here, we recall that $d_z(n)$ are defined to be the coefficients of the Dirichlet series of $\zeta^z$.

We will use this estimate to prove our Theorem 1.4. First we shall mention the following standard bound (see Lemma 2.2 of [8]): if $\chi$ is a non-exceptional and non-principal Dirichlet character modulo $q$, then for all $t \in \mathbb{R}$

$$\log L(1 + it, \chi) \ll \log_2(q(|t| + 2)). \quad (5.1)$$

*Proof (of Theorem 1.4)*: Fix $\frac{4(\alpha+1)}{2\alpha+5} < \sigma_\alpha < 1$, say $\sigma_\alpha := 5/6 + \alpha/3$. Let $M$ be the number of positive fundamental discriminants $d \le x$ such that $L(s, \chi_d)$ has a zero in the rectangle

$$\mathcal{R}(x) := \{s \in \mathbb{C} : \sigma_{\alpha} < \Re(s) \le 1, |\Im(s)| \le 2(\log x)^{2/(1-\sigma_{\alpha})}\}.$$

Then, we use Heath-Brown's zero-density estimate (see [5]), which states that for any $\varepsilon > 0$ and $1/2 < \sigma < 1$, we have that

$$\sum_{|d| \le x} N(\sigma, T, \chi_d) \ll (xT)^\varepsilon x^{3(1-\sigma)/(2-\sigma)} T^{(3-2\sigma)/(2-\sigma)},$$

where $N(\sigma, T, \chi_d)$ is the number of zeros $\rho$ of $L(s, \chi_d)$ with $\Re(\rho) \ge \sigma$ and $|\Im(\rho)| \le T$, and $\sum_\beta$ indicates that the sum is over fundamental discriminants. Thus, for any small $\varepsilon > 0$ we have that

$$M \ll x^{3(1-\sigma_{\alpha})/(2-\sigma_{\alpha})+\varepsilon}. \quad (5.2)$$

Now we have to link this number $M$ to the number $N$ of $d \in \mathcal{D}_\alpha(x)$ for which $L(s, \chi_d)$ has a zero in $\mathcal{R}(x)$. We let $d_1, ..., d_M$ be the positive fundamental discriminants lower than $x$ for which $L(s, \chi_d)$ has a zero in $\mathcal{R}(x)$. We recall that for every $d \in \mathcal{D}$, there is a unique positive fundamental discriminant $\tilde{d}$ and some $\ell \in \mathbb{N}$ such that $d = \tilde{d}\ell^2$. In this case, it is easy to see that $L(s, \chi_d)$ and $L(s, \chi_{\tilde{d}})$ have the same zeros in the region $\Re(s) > 0$.

Consequently, if we fix $d \in \mathcal{D}_\alpha(x)$ such that $L(s, \chi_d)$ has a zero in $\mathcal{R}(x)$, we may write that for some $1 \le u \le X_\alpha$, $Y_2 \le t \le Y_3$, $j \in \{1, ..., M\}$, $\ell \in \mathbb{N}$, we have $\frac{t^2-4}{u^2} = d_j\ell^2$, i.e. $t^2 - (u^2d_j)\ell^2 = 4$. Therefore, by the theory of Pell's equation there exists $n \in \mathbb{N}$ such that

$$\frac{t + \ell \sqrt{d_j u}}{2} = \varepsilon_{d_j u^2}^n.$$

Thus, for any fixed $1 \le u \le X_\alpha$, the fact that $\varepsilon_{d_j u^2}^n \le t \le Y_3 \ll x$ yields

$$|\{(t, \ell) : Y_2 \le t \le Y_3, \ell \in \mathbb{N} : t^2 - 4 = u^2 \ell^2 d_j\}| \le |\{n \in \mathbb{N} : \varepsilon_{d_j u^2}^n \ll x\}| \ll \log x.$$

By (5.2) it follows that

$$N \ll M(\log x)X_\alpha \ll x^{3(1-\sigma_\alpha)/(2-\sigma_\alpha)+\alpha+\varepsilon}, \quad (5.3)$$
for any small $\varepsilon > 0$. Note that

$$3\frac{1 - \sigma_{\alpha}}{2 - \sigma_{\alpha}} + \alpha = \frac{1}{2} - \frac{(1 - 2\alpha)^2}{14 - 4\alpha} \quad (5.4)$$

We define $\delta_{\alpha} := (1 - 2\alpha)^2/15$ so that (5.3) and (5.4) imply that

$$N \ll x^{1/2 - \delta_{\alpha}}.$$

Let $\tilde{D}_{\alpha}(x)$ be the set of $d \in \mathcal{D}_{\alpha}(x)$ such that $d > \sqrt{x}$ and $L(s, \chi_d)$ has no zeros in $\mathbb{R}(x)$, then the last inequality yields

$$|\mathcal{D}_{\alpha}(x)| - |\tilde{D}_{\alpha}(x)| \ll x^{1/2 - \delta_{\alpha}}. \quad (5.5)$$

Thus, using (5.1), we may write

$$\sum_{d \in \mathcal{D}_{\alpha}(x)} L(1, \chi_d)^z - \sum_{d \in \tilde{\mathcal{D}}_{\alpha}(x)} L(1, \chi_d)^z \ll x^{1/2 - \delta_{\alpha}} \exp(\mathcal{O}(|z| \log_2 x)) \ll x^{1/2 - \delta_{\alpha}/2}.$$

Let $y := x^{\delta_{\alpha}}$ and $k := \lceil |z| \rceil$, so that Proposition 5.1 and (4.1) imply that

$$\begin{aligned} \sum_{d \in \mathcal{D}_{\alpha}(x)} L(1, \chi_d)^z &= \sum_{d \in \tilde{\mathcal{D}}_{\alpha}(x)} L(1, \chi_d)^z + \mathcal{O}(x^{1/2 - \delta_{\alpha}/2}) \\ &= \sum_{d \in \tilde{\mathcal{D}}_{\alpha}(x)} \sum_{m=1}^{\infty} \frac{d_z(m) \chi_d(m) e^{-m/y}}{m} + \mathcal{O}\left(\left|\tilde{D}_{\alpha}(x)\right| \exp\left(\frac{-\delta_{\alpha} \log x}{2 \log_2 x}\right)\right) + \mathcal{O}(x^{1/2 - \delta_{\alpha}/2}) \\ &= \sum_{d \in \tilde{\mathcal{D}}_{\alpha}(x)} \sum_{m=1}^{\infty} \frac{d_z(m) \chi_d(m) e^{-m/y}}{m} + \mathcal{O}\left(\sqrt{x} \exp\left(\frac{-\delta_{\alpha} \log x}{3 \log_2 x}\right)\right). \end{aligned} \quad (5.6)$$

We now extend the main term to a sum over all $d \in \mathcal{D}_{\alpha}(x)$. We may do so, for (3.3) and (5.5) imply that

$$\sum_{d \in \mathcal{D}_{\alpha}(x) \setminus \tilde{\mathcal{D}}_{\alpha}(x)} \sum_{m=1}^{\infty} \frac{d_z(m) \chi_d(m)}{m} e^{-m/y} \ll (|\mathcal{D}_{\alpha}(x)| - |\tilde{\mathcal{D}}_{\alpha}(x)|) \sum_{m=1}^{\infty} \frac{d_k(m) e^{-m/y}}{m} \ll x^{1/2 - \delta_{\alpha}/2}.$$

Combining this with (5.6), we get that

$$\sum_{d \in \mathcal{D}_{\alpha}(x)} L(1, \chi_d)^z = \sum_{m=1}^{\infty} \frac{d_z(m) e^{-m/y}}{m} \sum_{d \in \mathcal{D}_{\alpha}(x)} \chi_d(m) + \mathcal{O}\left(\sqrt{x} \exp\left(\frac{-\delta_{\alpha} \log x}{3 \log_2 x}\right)\right). \quad (5.7)$$

We first assume that $\alpha_1 \le \alpha \le \alpha'$. We may use Proposition 4.1, denoting its main term by

$$MT(m) := MT(x, m) := \sqrt{x} \left( \frac{\alpha^2}{2\zeta(2)} \mathbb{E}(\mathbb{X}(m)) \log^2 x + \alpha \left[ H'_m(1) + (2\gamma - 2\alpha) \frac{\mathbb{E}(\mathbb{X}(m))}{\zeta(2)} \right] (\log x - 2) + \tilde{\mathfrak{D}}_2 \right),$$
to write that

$$ \sum_{m=1}^{\infty} \frac{d_z(m)e^{-m/y}}{m} \sum_{d \in \mathcal{D}_{\alpha}(x)} \chi_d(m) = \sum_{m=1}^{\infty} \frac{d_z(m)e^{-m/y}}{m} MT(m) \\ + (1 - \sqrt{Y_1(1, \alpha)}) \sum_{m=1}^{\infty} \frac{d_z(m)e^{-m/y}}{m} \mathbb{E}(\mathbb{X}_{\infty}(m)) + \mathcal{O}\left(x^{\alpha} \log x \sum_{m=1}^{\infty} d_k(m)e^{-m/y}\right) \\ + \sum_{m=1}^{\infty} \frac{d_z(m)e^{-m/y}}{m} \left[ \mathcal{I}(x, m, \alpha) + \mathcal{O}\left(\frac{\log^2(m+1)}{m_0}\right) \right]. \quad (5.8) $$

The aim is now to get rid of the weigh $e^{-m/y}$ in the main term. By Lemma 3.3 and Lemma 3.4, we know that removing the said weigh introduces an error bounded by

$$ \sqrt{x} \log^2 x \sum_{m=1}^{\infty} \frac{d_k(m)(1 - e^{-m/y}) \log^2(m + 1)}{m_0 m}. $$

We know that $1 - e^{-t} \ll t^{\beta}$ for all $t > 0$ and $0 < \beta < 1$, and we choose $\beta = 1/\log_2 x$. By Lemma 3.6, if $|z| \le \frac{\delta_{\alpha}}{5 \log_2 x \log_3 x}$, we deduce that this error is bounded by

$$ \sqrt{x} y^{-\beta} \log^2 x \sum_{m=1}^{\infty} \frac{d_k(m) m^{\beta} \log^2(m+1)}{m_0 m} \ll \sqrt{x} x^{-\delta_{\alpha}/\log_2 x} \exp \left( \frac{\delta_{\alpha}}{2} \frac{\log x}{\log_2 x} \right) \\ \ll \sqrt{x} \exp \left( -\frac{\delta_{\alpha}}{2} \frac{\log x}{\log_2 x} \right). \quad (5.9) $$

Similarly since $\mathcal{I}(x, m, \alpha) \ll \sqrt{x} \frac{m^{1/\log_2(2+m)/4}}{m_0} (\log \log x)^3$ by Proposition 4.1 and since $\mathbb{E}(\mathbb{X}_{\infty}(m)) \ll 1/m_0$ by Lemma 3.3 the error introduced by removing the exponential weight in the second and fourth sums of (5.8) above is

$$ \ll \sqrt{x} \exp \left( -\frac{\delta_{\alpha}}{2} \frac{\log x}{\log_2 x} \right). \quad (5.10) $$

Now that the exponential weight is removed, Lemma 3.6 shows that the contribution of the $\log(1+m)^2/m_0$ term in (5.8) is

$$ \ll \exp\left(\mathcal{O}\left(\frac{\log x}{\log_2 x}\right)\right). \quad (5.11) $$

Since $Y_1(1, \alpha) \ll x$ and by Lemma 3.10, the contribution of the $\mathbb{E}(\mathbb{X}_{\infty}(m))$ term in (5.8) is

$$ (1 - \sqrt{Y_1(1, \alpha)}) \mathbb{E}(L(1, \mathbb{X}_{\infty})^z) \ll \sqrt{x} \mathbb{E}(L(1, \mathbb{X})^{\Re(z)}). $$

Finally, Lemma 3.5 ensures that the contribution of the error term of the third sum in (5.8) is

$$ \ll x^{\alpha} (\log x) y (\log(3y))^{k+2} \ll x^{\alpha+2\delta_{\alpha}} \ll x^{1/2-\delta_{\alpha}/2}. \quad (5.12) $$
Collecting all these estimates and using (5.7), we find that

$$
\begin{align}
\sum_{d \in \mathcal{D}_\alpha(x)} L(1, \chi_d)^z &= \sum_{m=1}^{\infty} \frac{d_z(m)}{m} MT(m) + \sum_{m=1}^{\infty} \frac{d_z(m)}{m} \mathcal{I}(x, m, \alpha) \nonumber \\
&\quad + (1 - \sqrt{Y_1(1, \alpha)}) \mathbb{E}(L(1, \mathbb{X}_\infty)^z) + \mathcal{O} \left( \exp \left( -\frac{\delta_\alpha \log x}{3 \log_2 x} \right) \right) \tag{5.13}
\end{align}
$$

$$
= \sum_{m=1}^{\infty} \frac{d_z(m)}{m} MT(m) + \sum_{m=1}^{\infty} \frac{d_z(m)}{m} \mathcal{I}(x, m, \alpha) + \mathcal{O}\left(\sqrt{x}\mathbb{E}(L(1, \mathbb{X})^{\mathcal{R}(z)})\right). \quad (5.14)
$$

Using Lemma 3.9, we find that the sum of $MT(m)$ is equal to

$$
\begin{align}
& \sum_{m=1}^{\infty} \frac{d_z(m)MT(m)}{m} \nonumber \\
&= \mathbb{E}(L(1, \mathbb{X})^z) \frac{\sqrt{x}}{\zeta(2)} \left( \alpha^2 \frac{\log^2 x}{2} + \alpha (\phi(z) - 2\alpha) (\log x - 2) \right) + \sqrt{x} \sum_{m=1}^{\infty} \frac{d_z(m)}{m} \mathfrak{D}_2(m) \nonumber \\
&= \mathbb{E}(L(1, \mathbb{X})^z) \frac{\sqrt{x}}{\zeta(2)} \left( \alpha^2 \frac{\log^2 x}{2} + \alpha (\phi(z) - 2\alpha) (\log x - 2) \right) + \mathcal{O}\left(\sqrt{x}\mathbb{E}(L(1, \mathbb{X})^{\mathcal{R}(z)})\right). \tag{5.15}
\end{align}
$$

The last equality relies on Corollary 3.11, and on the definition (4.6) of $\mathfrak{D}_2$.

It only remains to estimate the contribution of $\mathcal{I}(x, m, \alpha)$. Observe that, for $s = \sigma + i\tau \in \mathbb{C}$,
$3/2 < \sigma < 2$: $1/|\zeta(s)| < \zeta(\sigma)/\zeta(2\sigma) \ll 1$, and hence on the line $\Re(s) = -1/\log \log x$,
we have $\frac{1}{\zeta(2(s+1))} \ll 1$. Furthermore, as seen through the proof of Lemma 3.9, we have
$\sum_{m=1}^{\infty} \frac{d_z(m)}{m} H_m(s) = \frac{\psi(s)}{\zeta(2s)} \mathbb{E}(L(1, \mathbb{X}_s)^z)$, where $\psi(s) \ll 1$ on the line $\Re(s) = 1 - 1/\log \log x$.
By Lemma 3.10 and using the same computations that lead to (4.12), we deduce that

$$
\begin{align}
\sum_{m=1}^{\infty} \frac{d_z(m)}{m} \mathcal{I}(x, m, \alpha) &= \frac{X_{\alpha}^{1/(2\alpha)}}{2\pi i} \int_{-1/\log \log x - i\infty}^{-1/\log \log x + i\infty} \frac{\psi(1+s)\mathbb{E}(L(1, \mathbb{X}_{1+s})^z)\zeta^2(1+s)}{\zeta(2(s+1))s(2\alpha s + 1)} X_{\alpha}^s ds \nonumber \\
&\ll \sqrt{x} \mathbb{E}(L(1, \mathbb{X})^{\mathcal{R}(z)})(\log \log x)^3. \tag{5.16}
\end{align}
$$

Using the estimate above and (5.15) in (5.14), we have proved that if $\alpha_1 \le \alpha \le \alpha'$, then

$$
\sum_{d \in \mathcal{D}_\alpha(x)} L(1, \chi_d)^z = \mathbb{E}(L(1, \mathbb{X})^z) \frac{\sqrt{x}}{\zeta(2)} \left( \alpha^2 \frac{\log^2 x}{2} + \alpha (\phi(z) - 2\alpha) (\log x - 2) \right) \\
\qquad + \mathcal{O} \left( \sqrt{x} (\log \log x)^3 \mathbb{E}(L(1, \mathbb{X})^{\mathcal{R}(z)}) \right). \tag{5.17}
$$

Now we assume that $\alpha_0 \le \alpha < \alpha_1$. Then we can go back to (5.7) and use Proposition 4.1 to find that

$$
\begin{align}
\sum_{d \in \mathcal{D}_\alpha(x)} L(1, \chi_d)^z &= \sum_{m=1}^{\infty} \frac{d_z(m) e^{-m/y}}{m} \sum_{d \in \mathcal{D}_\alpha(x)} \chi_d(m) + \mathcal{O}\left(\sqrt{x} \exp\left(\frac{-\delta_\alpha \log x}{3 \log_2 x}\right)\right) \nonumber \\
&= (\sqrt{x} - \sqrt{Y_1(1, \alpha)}) \sum_{m=1}^{\infty} \frac{d_z(m)}{m} \mathbb{E}(\mathbb{X}_\infty(m)) + \mathcal{O}\left(\sum_{m=1}^{\infty} d_k(m) e^{-m/y} \log x\right) \nonumber \\
&\quad + \mathcal{O}\left(\sqrt{x} \exp\left(\frac{-\delta_\alpha \log x}{3 \log_2 x}\right)\right) \tag{5.18} \\
&= \mathcal{O}(\sqrt{x} \mathbb{E}(L(1, \mathbb{X})^{\mathcal{R}(z)})), \nonumber
\end{align}
$$
by Lemma 3.10. The exponential weight of the first term of the second line was removed as in (5.9). The contribution of the first error term of the second line was bounded as in (5.12).

Combining the two results above, our Remark 3.12 and the fact that $\alpha_1 \ll 1/\log x$ show that (5.17) holds if $0 < \alpha \le \alpha_1$, which concludes the proof. □

# 6 Proof of Theorem 1.2

We can now prove Theorem 1.2, simply by using partial summation and Stieltjes integration. The fact that we want uniformity in the moments makes this step of the proof much more subtle compared to that of Hooley's paper [7] (see (63) page 123). We will work with a fixed $0 < \alpha < 1/2$ and a large real number $x$. We recall that $X_\alpha = x^\alpha - x^{-1-\alpha}$ and that $\alpha_0$ (resp. $\alpha_1$) is such that $X_{\alpha_0} = 1$ (resp. $X_{\alpha_1} = 2$). We fix a complex number $z$ such that $\sigma := \Re(z) \ge -1$ and $|z| \le \frac{(1-2\alpha)^2}{75} \frac{\log x}{\log_2 x \log_3 x}$, and we define $f(t) := (\sqrt{t}/\log t)^z$. Observe that since $|f'(t)| \ll |z| \left(\frac{\sqrt{t}}{\log t}\right)^{\sigma-1} \frac{1}{\sqrt{t}\log t}$, we may deduce that if $\sigma > -1$:

$$ \int_2^x \sqrt{t} f'(t) \, dt \ll |z| \int_2^x \frac{(\sqrt{t})^{\sigma-1}}{(\log t)^\sigma} \, dt \ll \frac{|z|}{\sigma+1} \frac{x^{(\sigma+1)/2}}{(\log x)^\sigma}. \quad (6.1) $$

If $\sigma = -1$, then

$$ \int_2^x \sqrt{t} f'(t) \, dt \ll |z| \log^2 x. \quad (6.2) $$

*Proof (of Theorem 1.2)*: First, we want to estimate

$$ Q(x, u, z) := \sum_{d \in \mathcal{D}_u(x)} \left( \frac{\sqrt{d} L(1, \chi_d)}{\log d} \right)^z, $$

uniformly in $\alpha_0 \le u \le \alpha$. We first let $\alpha_0 \le u < \alpha_1$ and $2 \le t \le x$. Going back to (5.18), we let

$$ MT_1(t, u, z) := (\sqrt{t} - Y_1(1, u)) \mathbb{E}(L(1, \mathbb{X}_\infty)^z) $$

so that, proceeding as in (5.12) to bound the error term, we have

$$ \sum_{d \in \mathcal{D}_u(t)} L(1, \chi_d)^z = MT_1(t, u, z) + \text{Err}_1(t, u, z) $$

with $\text{Err}_1(t, u, z) \ll \sqrt{t} \exp(-\delta \log t / \log_2(t+1))$ for some $\delta > 0$. We also put $MT_1(y, u, z) = 0$ if $0 \le y < 2$.

By partial summation and Lemma 3.10, this leads to

$$ \begin{aligned} Q(x, u, z) &= \int_{2^{-x}}^{x} f(t) \frac{\partial}{\partial t} MT_1(t, u, z) \, dt + \text{Err}_1(x, u, z) f(x) - \int_{2^{-x}}^{x} \text{Err}_1(t, u, z) f'(t) \, dt \\ &= \mathbb{E}(L(1, \mathbb{X}_\infty)^z) \int_{2}^{x} \frac{f(t)}{2\sqrt{t}} \, dt + \text{Err}_{Q,1}(x, u, z). \end{aligned} \quad (6.3) $$

By (6.1) if $\sigma > -1$:

$$ \text{Err}_{Q,1}(x, u, z) \ll \left( \frac{|z|}{\sigma+1} + 1 \right) \frac{x^{(\sigma+1)/2}}{(\log x)^{\sigma+1}}, \quad (6.4) $$
and by (6.2), if $\sigma = -1$:

$$Err_{Q,1}(x, u, z) \ll |z|. \qquad (6.5)$$

Now we let $\alpha_1 \le u \le \alpha$ and $2 \le t \le x$. We can not use Theorem 1.4 directly, and we instead need to go back to (5.13) and use (5.15) to find that

$$\sum_{d \in \mathcal{D}_u(t)} L(1, \chi_d)^z = \mathbb{E}(L(1, \mathbb{X})^z) \frac{\sqrt{t}}{\zeta(2)} \left( u^2 \frac{\log^2 t}{2} + u(\phi(z) - 2u)(\log t - 2) \right) + \sqrt{t} \sum_{m=1}^{\infty} \frac{d_z(m)}{m} \partial_2(m) \\ + (1 - \sqrt{Y_1(1, u)}) \mathbb{E}(L(1, \mathbb{X}_{\infty})^z) + \sum_{m=1}^{\infty} \frac{d_z(m)}{m} \mathcal{I}(t, m, u) \\ + \mathcal{O} \left( \mathbb{E}(L(1, \mathbb{X})^\sigma) \sqrt{t} \exp \left( -\delta \frac{\log t}{\log_2(t+1)} \right) \right), \qquad (6.6)$$

for some $\delta > 0$ and where $\partial_2(m)$ and $\mathcal{I}(t, m, u)$ were defined in Proposition 4.1. The reason for which we need this lengthier expression instead of the easier Theorem 1.4 is that the error term above is much more precise than the one in Theorem 1.4. By keeping in the main term some expressions rather than putting them in the error term (as we did in Theorem 1.4), we will be able to handle them with a lot more precision in the following partial summations, leading to a better final error term in Theorem 1.2. However we can already show that some of the contribution of the term $\sum_{m=1}^{\infty} \frac{d_z(m)}{m} \mathcal{I}(t, m, u)$ goes in the error term of (6.6).

First, observe that

$$\frac{\partial}{\partial u} \frac{\partial}{\partial t} \left\{ (1 - \sqrt{Y_1(1, u)}) \mathbb{E}(L(1, \mathbb{X}_{\infty})^z) + \sqrt{t} \sum_{m=1}^{\infty} \frac{d_z(m)}{m} \partial_2(m) \right\} = 0, \qquad (6.7)$$

and we denote the term between curly brackets by $C(t, u, z)$. As proved at the very beginning of Lemma 3.9, we know that $\sum_{m=1}^{\infty} \frac{d_z(m)}{m} H_m(s) = \frac{\psi(s)}{\zeta(2s)} \mathbb{E}(L(1, \mathbb{X}_s)^z)$, where $\psi(s) \ll 1$ if $\Re(s)$ is close to 1. Therefore,

$$\sum_{m=1}^{\infty} \frac{d_z(m)}{m} \mathcal{I}(t, m, u) = \frac{(t^u - t^{-1-u})^{1/(2u)}}{2\pi i} \int_{(-c)} \frac{\psi(1+s) \mathbb{E}(L(1, \mathbb{X}_{1+s})^z) \zeta^2(1+s)}{\zeta(2(s+1))s(2us+1)} (t^u - t^{-1-u})^s \mathrm{d}s.$$

for any small enough $c > 0$, where $(-c)$ means that the integration path is the line $\Re(s) = -c$, and we choose $c = 1/\log \log x$. For commodity, we put $\Psi_z(s) := \frac{\psi(s)\mathbb{E}(L(1, \mathbb{X}_s)^z)}{2\pi i \zeta(2s)}$, and hence on the line $\Re(s) = -c$

$$\Psi_z(1+s) \ll \mathbb{E}(L(1, \mathbb{X})^z) \qquad (6.8)$$

by Lemma 3.10 and since $1/\zeta(2(s+1)) \ll 1$, as shown earlier, above (5.16).

Since $\alpha_1 \le u \le \alpha$, we may use (4.3) and bound the integral as we did in (5.16) to write that

$$\sum_{m=1}^{\infty} \frac{d_z(m)}{m} \mathcal{I}(t, m, u) = \sqrt{t} \int_{(-c)} \frac{\Psi_z(1+s)}{s(2su+1)} \zeta^2(1+s)(t^u-t^{-1-u})^s \mathrm{d}s + \mathcal{O} \left( \mathbb{E}(L(1, \mathbb{X})^\sigma) t^{-1/3} \log^3 x \right).$$

We fix $\varepsilon > 0$. Since $u \gg 1/\log x$, we have by (6.8) and the Phragmén-Lindelöf theorem (4.11)

$$\sqrt{t} \int_{|\Im(s)| > \log^3 x} \frac{\Psi_z(1+s)}{s(2su+1)} \zeta^2(1+s)(t^u - t^{-1-u})^s \mathrm{d}s \ll \sqrt{t} \mathbb{E}(L(1, \mathbb{X})^\sigma) \int_{\log^3 x}^{\infty} \frac{t^\varepsilon}{t^2 u} \mathrm{d}t \ll \sqrt{t} \frac{\mathbb{E}(L(1, \mathbb{X})^\sigma)}{\log x}.$$
By (4.9), for $s \in \mathbb{C}$ with $\Re(s) = -c$ and $|\Im(s)| \le \log^3 x$, we have $(t^u - t^{-1-u})^s = t^{us} + \mathcal{O}(1/\sqrt{t})$. Thus by using (6.8), the fact that $\zeta(1-c+iw) \ll \log w$ if $2 \le w \le \log x^3$ by (4.10) and the fact that $\zeta(1-c+it) \ll 1/c$ if $|t| \le 2$:

$$ \sum_{m=1}^{\infty} \frac{d_z(m)}{m} \mathcal{I}(t, m, u) = \sqrt{t} \int_{|\Im(s)| \le \log^3 x} \frac{\Psi_z(1+s)\zeta^2(1+s)}{s(2us+1)} t^{us} ds \\ + \mathcal{O}\left( \mathbb{E}(L(1, \mathbb{X})^\sigma) \left[ \frac{1}{c^3} + \int_{2 \le |\Im(s)| \le \log^3 x} \frac{\log^2 w}{w} dw + \frac{\sqrt{t}}{\log x} \right] \right) \\ = \sqrt{t} \int_{|\Im(s)| \le \log^3 x} \frac{\Psi_z(1+s)\zeta^2(1+s)}{s(2us+1)} t^{us} ds + \mathcal{O}\left( \mathbb{E}(L(1, \mathbb{X})^\sigma) \left[ \log \log^3 x + \frac{\sqrt{t}}{\log x} \right] \right). $$

Thus, going back to (6.6), we may define

$$ MT_2(t, u, z) := \mathbb{E}(L(1, \mathbb{X})^z) \frac{\sqrt{t}}{\zeta(2)} \left( u^2 \frac{\log^2 t}{2} + u(\phi(z) - 2u)(\log t - 2) \right) + C(t, u, z) \\ + \sqrt{t} \int_{|\Im(s)| \le \log^3 x} \frac{\Psi_z(1+s)\zeta^2(1+s)}{s(2us+1)} t^{us} ds $$

and $Err_2(t, u, z)$ by

$$ \sum_{d \in \mathcal{D}_u(t)} L(1, \chi_d)^z = MT_2(t, u, z) + Err_2(t, u, z), $$

so that the crude bound $\sqrt{t} \exp(-\delta \log t / \log \log(t+1)) \ll t / \log t$ leads to

$$ Err_2(t, u, z) \ll \mathbb{E}(L(1, \mathbb{X})^\sigma) \left( \frac{\sqrt{t}}{\log t} + \log \log^3 x \right). $$

Doing the partial summation as we did in (6.3), we find that

$$ \begin{aligned} Q(x, u, z) &= \frac{\mathbb{E}(L(1, \mathbb{X})^z)}{\zeta(2)} \int_2^x f(t) \left( \frac{u^2 \frac{\log^2 t}{2} + u(\phi(z) - 2u)(\log t - 2)}{2\sqrt{t}} + \frac{u^2 \log t + u(\phi(z) - 2u)}{\sqrt{t}} \right) dt \\ &\quad + \int_2^x f(t) \frac{\partial}{\partial t} C(t, u, z) dt + \int_2^x \frac{f(t)}{2\sqrt{t}} \int_{|\Im(s)| \le \log^3 x} \frac{\Psi_z(1+s)\zeta^2(1+s)}{s} t^{us} ds + Err_{Q,2}(x, u, z) \\ &= \frac{\mathbb{E}(L(1, \mathbb{X})^z)}{\zeta(2)} \int_2^x \frac{f(t)}{\sqrt{t}} \left\{ \frac{u^2}{4} \log^2 t + \frac{u}{2}\phi(z)\log t \right\} dt + \int_2^x f(t) \frac{\partial}{\partial t} C(t, u, z) dt \\ &\quad + \int_2^x \frac{f(t)}{2\sqrt{t}} \int_{|\Im(s)| \le \log^3 x} \frac{\Psi_z(1+s)\zeta^2(1+s)}{s} t^{us} ds + Err_{Q,2}(x, u, z), \end{aligned} \quad (6.9) $$

so that by (6.1)

$$ Err_{Q,2}(x, u, z) \ll \left( \frac{|z|}{\sigma+1} + 1 \right) \frac{x^{(1+\sigma)/2}}{(\log x)^{\sigma+1}} \mathbb{E}(L(1, \mathbb{X})^{\sigma}) \quad (6.10) $$
if $\sigma > -1$, and if $\sigma = -1$ (6.2) implies that

$$Err_{Q,2}(x, u, z) \ll |z| \log x \qquad (6.11)$$

We define $MT_{Q,i}(x, u, z) := Q(x, u, z) - Err_{Q,i}(x, u, z)$, $i = 1, 2$, and $MT_{Q,i}(x, v, z) = 0$ if $0 \le v < \alpha_0$, for convenience.

Thanks to Dirichlet's Class Number Formula, we may write that

$$ 
\begin{aligned}
S(x, \alpha, z) &:= \sum_{d \in \mathcal{D}_{\alpha}(x)} h(d)^z = \sum_{\substack{d \in \mathcal{D}(x) \\ \varepsilon_d \le d^{1/2+\alpha}}} \left( \frac{\sqrt{d} L(1, \chi_d)}{\log d} \right)^z \left( \frac{\log d}{\log \varepsilon_d} \right)^z \\
&= \int_0^\alpha (1/2 + u)^{-z} dQ(x, u, z).
\end{aligned}
$$

We first study the integral over $(0, \alpha_1)$. By integrating by parts and using (6.3) together with (6.4) and (6.5), we find that

$$ 
\begin{aligned}
\int_0^{\alpha_1^{-}} (1/2 + u)^{-z} dQ(x, u, z) &= (MT_{Q,1}(x, \alpha_1, z) + Err_{Q,1}(x, \alpha_1, z))(1/2 + \alpha_1)^{-z} \\
&\quad - \int_0^{\alpha_1^{-}} Q(x, u, z) \frac{\partial}{\partial u} (1/2 + u)^{-z} du \\
&= \int_0^{\alpha_1^{-}} (1/2 + u)^{-z} \frac{\partial}{\partial u} MT_{Q,1}(x, u, z) du + Err_{S,1}(x, \alpha, z) \\
&= Err_{S,1}(x, \alpha, z),
\end{aligned}
\qquad (6.12) $$

where

$$ 
\begin{aligned}
Err_{S,1}(x, \alpha, z) &= Err_{Q,1}(x, \alpha_1, z) (1/2 + \alpha_1)^{-z} - \int_0^{\alpha_1^{-}} Err_{Q,1}(x, u, z) \frac{\partial}{\partial u} (1/2 + u)^{-z} du \\
&\ll 2^{\sigma} \left( \frac{|z|}{\sigma + 1} + 1 \right)^2 \frac{x^{(\sigma+1)/2}}{(\log x)^{\sigma+1}}
\end{aligned}
$$

if $\sigma > -1$, and if $\sigma = -1$

$$Err_{S,1}(x, \alpha, z) \ll |z|^2.$$

Now we deal with the integral over $[\alpha_1, \alpha)$. By similar computations and using (6.7), (6.9)

$$ 
\begin{aligned}
\int_{\alpha_1^+}^{\alpha} (1/2 + u)^{-z} dQ(x, u, z) &= [Q(x, u, z)(1/2 + u)^{-z}]_{\alpha_1^+}^{\alpha} - \int_{\alpha_1^+}^{\alpha} Q(x, u, z) \frac{\partial}{\partial u} (1/2 + u)^{-z} du \\
&= \int_{\alpha_1}^{\alpha} (1/2 + u)^{-z} \frac{\partial}{\partial u} MT_Q(x, u, z) du + Err_{S,2}(x, \alpha, z) \\
&= \frac{\mathbb{E}(L(1, X)^z)}{2\zeta(2)} \int_2^x \frac{t^{\frac{z-1}{2}}}{(\log t)^z} \left\{ \left( \int_{\alpha_1}^{\alpha} u (1/2 + u)^{-z} du \right) \log^2 t + \left( \int_{\alpha_1}^{\alpha} (1/2 + u)^{-z} du \right) \phi(z) \log t \right\} dt \\
&\quad + \int_2^x \frac{f(t) \log t}{2\sqrt{t}} \int_{|\Im(s)| \le \log^3 x} \Psi_z(1+s) \zeta^2(1+s) \int_{\alpha_1}^{\alpha} (1/2 + u)^{-z} t^{us} du ds + Err_{S,2}(x, \alpha, z),
\end{aligned}
\qquad (6.13) $$
where

$$Err_{S,2}(x, \alpha, z) = [Err_{Q,2}(x, u, z) (1/2 + u)^{-z}]_{\alpha_1}^{\alpha} - \int_{0}^{\alpha} Err_{Q,2}(x, u, z) \frac{\partial}{\partial u} (1/2 + u)^{-z} du.$$

By (6.10), if $\sigma > -1$:

$$Err_{S,2}(x, \alpha, z) \ll 2^{\sigma} \mathbb{E}(L(1, \mathbb{X})^{\sigma}) \left( \frac{|z|}{\sigma + 1} + 1 \right)^2 \frac{x^{(\sigma+1)/2}}{(\log x)^{\sigma+1}},$$

and by (6.11), if $\sigma = -1$:

$$Err_{S,2}(x, \alpha, z) \ll |z|^2 \log x.$$

Now we want to extend the inner integrals to the whole interval $(0, \alpha)$, and we may do so for Remark 3.12 together with the fact that $\alpha_1 \ll 1/\log x$ imply that

$$\frac{\mathbb{E}(L(1, \mathbb{X})^z)}{2\zeta(2)} \int_2^x \frac{t^{\frac{z-1}{2}}}{(\log t)^z} \left\{ \left( \int_0^{\alpha_1} u (1/2 + u)^{-z} du \right) \log^2 t + \left( \int_0^{\alpha_1} (1/2 + u)^{-z} du \right) \phi(z) \log t \right\} dt \\ \ll 2^{\sigma} \mathbb{E}(L(1, \mathbb{X})^{\sigma}) \int_2^x \frac{t^{(\sigma-1)/2}}{(\log t)^{\sigma}} dt \ll \frac{2^{\sigma} \mathbb{E}(L(1, \mathbb{X})^{\sigma}) x^{(\sigma+1)/2}}{(\sigma+1) (\log x)^{\sigma}} \quad (6.14)$$

if $\sigma > -1$, and if $\sigma = -1$ the quantity above is

$$\ll (\log x)^2.$$

Observe that for $2 \le t \le x$ and $\Re(s) = -c$, $|\Im(s)| \le \log^3 x$, a summation by parts leads to:

$$\int_{\alpha_1}^{\alpha} (1/2 + u)^{-z} t^{us} du = \left[ \frac{(1/2 + u)^{-z} t^{us}}{s \log t} \right]_{\alpha_1}^{\alpha} + \frac{z}{s \log t} \int_{\alpha_1}^{\alpha} (1/2 + u)^{-z-1} t^{us} du \\ \ll \frac{2^{\sigma}}{|s| \log t} \left( 1 + \frac{|z|}{\sigma + 2} \right).$$

Thus, once again using (4.10), (6.8) and the fact that $\zeta(1 + s) \ll 1/|s|$ when $s \to 0$:

$$\int_2^x \frac{f(t) \log t}{2\sqrt{t}} \int_{|\Im(s)| \le \log^3 x} \Psi_z(1+s) \zeta^2(1+s) \int_{\alpha_1}^{\alpha} (1/2 + u)^{-z} t^{us} du ds dt \\ \ll 2^{\sigma} \mathbb{E}(L(1, \mathbb{X})^{\sigma}) \left(1 + \frac{|z|}{\sigma + 2}\right) \int_2^x \frac{\sqrt{t}^{\sigma-1}}{(\log t)^{\sigma}} \int_{|\Im(s)| \le \log^3 x} \frac{|\zeta^2(1+s)|}{|s|} ds dt \\ \ll 2^{\sigma} \mathbb{E}(L(1, \mathbb{X})^{\sigma}) \left(1 + \frac{|z|}{\sigma + 2}\right) \left( \int_2^x \frac{\sqrt{t}^{\sigma-1}}{(\log t)^{\sigma}} dt \right) \left( \frac{1}{c^3} + \int_{2 \le |\Im(s)| \le \log^3 x} \frac{|\zeta^2(1+s)|}{|s|} ds \right) \\ \ll \frac{2^{\sigma} \mathbb{E}(L(1, \mathbb{X})^{\sigma}) x^{(\sigma+1)/2}}{(\sigma+1) (\log x)^{\sigma}} \left(1 + \frac{|z|}{\sigma + 2}\right) \log \log^3 x$$

if $\sigma > -1$, while if $\sigma = -1$ this quantity is

$$\ll |z|(\log^2 x) \log \log^3 x.$$
We use the definition of $I_{z,j}(\alpha)$, $j = 0, 1$, given in Theorem 1.2 so that using the result above together with (6.12), (6.13) and (6.14), we find that

$$S(x, \alpha, z) = \frac{\mathbb{E}(L(1, \mathbb{X})^z)}{2\zeta(2)} \int_2^x \frac{t^{\frac{z-1}{2}}}{(\log t)^z} \left[ I_{z,1}(\alpha) \log^2 t + I_{z,0}(\alpha) \phi(z) \log t \right] dt + Err$$

where, if $\sigma > -1$:

$$Err \ll 2^{\sigma} \mathbb{E}(L(1, \mathbb{X})^{\sigma}) \frac{x^{(\sigma+1)/2}}{(\log x)^{\sigma}} \left( \frac{\left( \frac{|z|}{\sigma+1} + 1 \right)^2}{\log x} + \frac{\log \log^3 x}{\sigma+1} \left( 1 + \frac{|z|}{\sigma+2} \right) \right) \\ \ll 2^{\sigma} \mathbb{E}(L(1, \mathbb{X})^{\sigma}) \frac{x^{(\sigma+1)/2}}{(\log x)^{\sigma}} \left( \frac{|z|^2}{(\sigma+1)^2 \log x} + \frac{\log \log^3 x}{\sigma+1} \left( 1 + \frac{|z|}{\sigma+2} \right) \right)$$

and if $\sigma = -1$:

$$Err \ll |z|(\log^2 x) \log \log^3 x.$$

□

*Proof (of Corollary 1.3):* We fix $z$ a complex number with a large real part $\Re(z) = \sigma$, and we fix $0 < \alpha < 1/2$. By Remark 3.12, we know that

$$\mathbb{E}(L(1, \mathbb{X})^z)\phi(z) \ll \mathbb{E}(L(1, \mathbb{X})^\sigma). \qquad (6.15)$$

Furthermore, if we assume that $\Im(z) \ll \sigma$ and $\sigma \to \infty$, then:

$$\begin{aligned} \frac{I_{z,0}(\alpha)}{I_{z,1}(\alpha)} &= \frac{2}{\frac{1-z}{2-z} \frac{(2\alpha+1)^{2-z-1}}{(2\alpha+1)^{1-z-1}} - 1} = \frac{2}{\frac{z-1}{z-2} \left( 2\alpha + 1 + \frac{2\alpha}{(2\alpha+1)^{1-z-1}} \right) - 1} \\ &= \frac{2}{\frac{z-1}{z-2} \left( 2\alpha + 1 - 2\alpha + \mathcal{O}((2\alpha+1)^{-\sigma}) \right) - 1} \\ &= \frac{2}{\frac{1}{z-2} + \mathcal{O}((2\alpha+1)^{-\sigma})} \ll \sigma \ll \log x/(\log_2 x \log_3 x). \end{aligned}$$

Using Theorem 1.2 with (6.15), this proves the first part of the Corollary:

$$\sum_{d \in \mathcal{D}_{\alpha}(x)} h(d)^z = \frac{1}{\zeta(2)} \frac{x^{\frac{z+1}{2}}}{z+1} I_{z,1}(\alpha) \log(x)^{-z+2} \left( \mathbb{E}(L(1, \mathbb{X})^z) + \mathcal{O}\left( \frac{\mathbb{E}(L(1, \mathbb{X})^\sigma)}{\log_2 x \log_3 x} \right) \right) + Err$$

Now if $z$ is large and real and satisfies $z \le \frac{(1-2\alpha)^2}{75} \frac{\log x}{(\log_2 x)^2}$, we have that $I_{z,1}(\alpha) \sim 2^z/(4z^2)$ which implies that

$$\sum_{d \in \mathcal{D}_{\alpha}(x)} h(d)^z = \frac{1}{\zeta(2)} \frac{\mathbb{E}(L(1, \mathbb{X})^z)}{z+1} I_{z,1}(\alpha) x^{\frac{z+1}{2}} \log(x)^{-z+2} \left( 1 + \mathcal{O}\left( \frac{1}{\log_2 x \log_3 x} \right) \right) + Err \\ = \frac{1}{\zeta(2)} \frac{\mathbb{E}(L(1, \mathbb{X})^z)}{z+1} I_{z,1}(\alpha) x^{\frac{z+1}{2}} \log(x)^{-z+2} \left( 1 + \mathcal{O}\left( \frac{1}{\log_2 x \log_3 x} \right) + \mathcal{O}\left( \frac{z^2}{\log^2 x} (\log \log x)^3 \right) \right),$$

which proves the result.

□
# 7 Distribution of class numbers over $\mathcal{D}_\alpha(x)$.

To prove Theorem 1.6, we will require an estimate of $\mathbb{E}(L(1, X)^r)$ when $r$ is a large real number.

**Proposition 7.1** (Proposition 4.2 of [2]): For any real number $r \ge 4$, we have that

$$ \log \mathbb{E}(L(1, X)^r) = r \left( \log_2 r + \gamma + \frac{C_0 - 1}{\log r} + \mathcal{O} \left( \frac{1}{(\log r)^2} \right) \right). $$

Once again, the proof found in [2] remains true for our random model, since $a_p, b_p = 1/2+\mathcal{O}(1/p)$ and $a_p - b_p, c_p \ll 1/p$. We are now ready to prove Theorem 1.6.

*Proof (of Theorem 1.6)*: For brevity, let $\mathcal{N}_{x,\alpha}(\tau)$ be the proportion of $d \in \mathcal{D}_\alpha(x)$ for which $h(d) \ge \frac{2e^\gamma \sqrt{x}}{\log x} \tau$. Then, for any $k > 1$, we have that

$$ \begin{aligned} k \int_0^\infty t^{k-1} \mathcal{N}_{x,\alpha}(t) \, dt &= \frac{1}{|\mathcal{D}_\alpha(x)|} \sum_{d \in \mathcal{D}_\alpha(x)} \int_0^{e^{-\gamma} h(d) \log x / (2\sqrt{x})} kt^{k-1} \, dt \\ &= \left( \frac{2e^\gamma \sqrt{x}}{\log x} \right)^{-k} \frac{1}{|\mathcal{D}_\alpha(x)|} \sum_{d \in \mathcal{D}_\alpha(x)} h(d)^k. \end{aligned} $$

Therefore, for large $k \le \frac{(1-2\alpha)^2}{75} \log x / (\log_2 x)^2$, combining the fact that $I_{k,1}(\alpha) \sim 2^k / (4k^2)$, our Corollary 1.3, and (4.1), one finds that

$$ \int_0^\infty t^{k-1} \mathcal{N}_{x,\alpha}(t) \, dt = (\log k)^k \exp \left( \frac{k}{\log k} \left( C_0 - 1 + \mathcal{O} \left( \frac{1}{\log k} \right) \right) \right). $$

Thus, the proof of Theorem 1.5 of [9] shows that uniformly in the range $B \le \tau \le \log_2 x - 2\log_3 x + 2\log(1 - 2\alpha) - \log(75)$ for some constant $B > 0$:

$$ \mathcal{N}_{x,\alpha}(\tau) = \exp \left( - \frac{e^{\tau - C_0}}{\tau} \left( 1 + \mathcal{O} \left( \frac{1}{\sqrt{\tau}} \right) \right) \right). $$

□

# 8 The number of Hooley's quadratic fields with a bounded class number

Recall that $\mathcal{F}_\alpha(h)$ is the number of discriminants in $\mathcal{D}_\alpha$ with class number $h$. The first step to study $\sum_{h \le H} \mathcal{F}_\alpha(h)$, for a large integer $H$, is to show that we can restrict our attention to "small" discriminants. More precisely, we will show that the main contribution to this sum comes from discriminants $d \le X := H^2(\log H)^2(\log \log H)^4$.

Thanks to Tatuzawa refinement of Siegel's inequality [13], we know that $L(1, \chi_d) \ge 1/(\log d)$ with at most one exception. Therefore for $d \in \mathcal{D}_\alpha$, the class number formula implies that $h(d) \ge \sqrt{d} / (\log d)^2$, with at most one exception. Thus for $d \in \mathcal{D}_\alpha$, we have that if $h(d) \le H$ then $d \le H^3$, with at most one exception. This yields

$$ \sum_{h \le H} \mathcal{F}_\alpha(h) = \sum_{\substack{d \in \mathcal{D}_\alpha(H^3) \\ h(d) \le H}} 1 + \mathcal{O}(1). \qquad (8.1) $$
Now that we only have to study discriminants $\le H^3$, we want to refine our lower bound on $L(1, \chi_d)$, discarding a negligible set of discriminants. We will use Granville and Soundararajan's [4] result on $L(1, \chi)$, which they proved using zero-density estimates together with the large sieve.

**Proposition 8.1 (Proposition 2.2 of [4]):** Let $A > 2$ be fixed. Then, for all but at most $Q^{2/A+o(1)}$ primitive characters $\chi(\text{mod } q)$ with $q \le Q$ we have

$$L(1, \chi) = \prod_{p \le (\log Q)^A} \left(1 - \frac{\chi(p)}{p}\right)^{-1} \left(1 + \mathcal{O}\left(\frac{1}{\log \log Q}\right)\right).$$

We choose $A = 7$, so that Proposition 8.1 yields that for all but at most $H$ discriminants $d \le H^3$, we have

$$L(1, \chi_d) = \prod_{p \le (3 \log H)^7} \left(1 - \frac{\chi_d(p)}{p}\right)^{-1} (1 + o(1)) \ge \frac{C}{\log \log H},$$

for some $C > 0$. The Class Number Formula implies that for all but at most $H$ discriminants $d \in \mathcal{D}_\alpha(H^3)$, $h(d) \ge C\sqrt{d}/(\log_2 H \log d)$. Therefore for all but at most $H$ discriminants $d \in \mathcal{D}_\alpha(H^3)$, $h(d) \le H$ implies that $d \le X$. This yields, putting this back in (8.1):

$$\sum_{h \le H} \mathcal{F}_{\alpha}(h) = \sum_{\substack{d \in \mathcal{D}_{\alpha}(X) \\ h(d) \le H}} 1 + \mathcal{O}(H). \qquad (8.2)$$

We are now ready to prove our theorem, following Dahl-Lamzouri's [2] and Soundararajan's [12] papers.

*Proof (of Theorem 1.8):* We introduce the smoothing function

$$I_{c,\lambda,N}(y) := \frac{1}{2\pi i} \int_{c-i\infty}^{c+i\infty} y^s \left(\frac{e^{\lambda s} - 1}{\lambda s}\right)^N \frac{ds}{s},$$

where $c = 1/\log H$, $N$ is a positive integer, and $0 < \lambda \le 1$ is a real number. By Perron's formula, we know that (see (4.19) of [2])

$$I_{c,\lambda,N}(y) = \begin{cases} = 1 & \text{if } y \ge 1, \\ \in [0,1] & \text{if } e^{-\lambda N} \le y < 1, \\ = 0 & \text{if } 0 < y < e^{-\lambda N}. \end{cases} \qquad (8.3)$$

According to (8.2) and (8.3), we have that

$$\sum_{h \le H} \mathcal{F}_{\alpha}(h) \le \frac{1}{2\pi i} \int_{c-i\infty}^{c+i\infty} \sum_{d \in \mathcal{D}_{\alpha}(X)} \frac{H^s}{h(d)^s} \left(\frac{e^{\lambda s} - 1}{\lambda s}\right)^N \frac{ds}{s} + \mathcal{O}(H) \le \sum_{h \le e^{\lambda N} H} \mathcal{F}_{\alpha}(h). \qquad (8.4)$$

Thanks to Theorem 1.2 we know that uniformly in $|s| \le T := (\log X)^{1/3-\epsilon}$, $\epsilon > 0$ small,

$$\sum_{d \in \mathcal{D}_{\alpha}(X)} h(d)^{-s} = \mathfrak{I}_1 + \mathfrak{I}_2 + \mathcal{O}(\sqrt{X}(\log \log X)^3 T),$$
where

$$ \mathfrak{I}_1 = \mathfrak{I}_1(s) := \frac{1}{2\zeta(2)} \int_2^X \frac{t^{\frac{-s-1}{2}}}{\log(t)^{-s}} \mathbb{E}(L(1, \mathbb{X})^{-s}) I_{-s,1}(\alpha) \log^2(t) \, dt, $$

and

$$ \mathfrak{I}_2 = \mathfrak{I}_2(s) := \frac{1}{2\zeta(2)} \int_2^X \frac{t^{\frac{-s-1}{2}}}{\log(t)^{-s}} \mathbb{E}(L(1, \mathbb{X})^{-s}) \phi(-s) I_{-s,0}(\alpha) \log(t) \, dt. $$

Since $h(d) \ge 1$, $|e^{\lambda s} - 1| \le 3$ for large $H$ and $|\mathcal{D}_\alpha(X)| \ll \sqrt{X} \log^2 X$ by (4.1), the contribution of $s$ such that $\Re(s) = c$ and $|s| > T$ in the integral of (8.4) is

$$ \ll |\mathcal{D}_\alpha(X)| \left(\frac{3}{\lambda}\right)^N \int_{|s|>T} \frac{|ds|}{|s|^{N+1}} \ll \frac{X^{1/2} \log^2 X}{N} \left(\frac{3}{\lambda T}\right)^N. $$

For large $H$ we also have that $|(e^{\lambda s} - 1)/(\lambda s)| \le 4$, which is easily seen by separating the cases $|\lambda s| > 1$ and $|\lambda s| \le 1$. Thus, the integral term of (8.4) is equal to

$$ \frac{1}{2\pi i} \int_{|s|=T} H^s (\mathfrak{I}_1 + \mathfrak{I}_2) \left( \frac{e^{\lambda s} - 1}{\lambda s} \right)^N \frac{ds}{s} + R, \quad (8.5) $$

where

$$ R \ll \frac{X^{1/2} \log^2 X}{N} \left(\frac{3}{\lambda T}\right)^N + \frac{4^N T^2}{c} X^{1/2} (\log \log X)^3. $$

Let $\lambda = 3e^{1/\epsilon}/T$ and $N = \lfloor \epsilon \log_2 H \rfloor$, so that

$$ R \ll_{\epsilon} H (\log H)^{8/3}. $$

Note that on the line $\Re(s) = c$, $I_{-s,1}(\alpha)$, $I_{-s,0}(\alpha)$, $\mathbb{E}(L(1, \mathbb{X})^{-s})$, $\mathbb{E}(L(1, \mathbb{X})^{-s})\phi(-s) \ll 1$ (by Remark 3.12). Therefore we may extend the segment of integration to the whole line $\Re(s) = c$ in (8.5), the introduced error being

$$ \ll \left(\frac{3}{\lambda}\right)^N \int_{|s|>T} \int_2^X t^{-\frac{1}{2}} \log^2 t \, dt \frac{|ds|}{|s|^{N+1}} \ll \frac{X^{1/2} \log^2 X}{N} \left(\frac{3}{\lambda T}\right)^N \ll_{\epsilon} H (\log H)^{8/3}. $$

Thus, the middle term of (8.4) is equal to

$$ \frac{1}{2\pi i} \int_{\mathfrak{R}(s)=c} H^s (\mathfrak{I}_1 + \mathfrak{I}_2) \left( \frac{e^{\lambda s} - 1}{\lambda s} \right)^N \frac{ds}{s} + \mathcal{O}_{\epsilon} (H (\log H)^{8/3}). $$

Now we split the integral in two, and study each term separately. By switching the integrals, one shows that

$$ \frac{1}{2\pi i} \int_{\mathfrak{R}(s)=c} H^s \mathfrak{I}_1 \left( \frac{e^{\lambda s} - 1}{\lambda s} \right)^N \frac{ds}{s} = \frac{1}{\zeta(2)} \int_{1/2}^{1/2+\alpha} \mathbb{E} \left[ \int_2^X \frac{\log^2 t}{2\sqrt{t}} I_{c,\lambda,N} \left( \frac{H u \log t}{L(1, \mathbb{X})\sqrt{t}} \right) dt \right] \left( u - \frac{1}{2} \right) du. \quad (8.6) $$
Put $Y := H/L(1, \mathbb{X})$ and note that $f: t \mapsto \frac{\sqrt{t}}{\log t}$ is strictly increasing (thus invertible) on $(10, \infty)$: we denote its inverse by $g$. With these notations, if $1/2 \le u \le \alpha + 1/2$, we may use (8.3) to find that

$$ I_{c,\lambda,N} \left( \frac{Hu \log t}{\sqrt{t} L(1, \mathbb{X})} \right) = \begin{cases} = 1 & \text{if } uY \ge f(t), \\ = 0 & \text{if } uY e^{\lambda N} < f(t), \\ \in [0, 1] & \text{otherwise.} \end{cases} $$

Thus, if we let $\mathfrak{F}(t) = \sqrt{t}((\log t)^2 + \mathcal{O}(\log t))$ be a primitive of $t \mapsto (\log t)^2/(2\sqrt{t})$, we get that

$$ \int_2^X \frac{\log^2 t}{2\sqrt{t}} I_{c,\lambda,N} \left( \frac{Hu \log t}{\sqrt{t} L(1, \mathbb{X})} \right) dt = \min(\mathfrak{F}(X), \mathfrak{F}(g(uY))) + \mathcal{O} \left( \mathfrak{F}(g(uYe^{\lambda N})) - \mathfrak{F}(g(uY)) + 1 \right). \quad (8.7) $$

Note that $g(t) = 4t^2(\log t + \mathcal{O}(\log \log t))^2$, for $t$ large enough, so that $\mathfrak{F}(g(t)) = 8t \log^3(t) + \mathcal{O}(t \log^2(t) \log_2(t))$. Furthermore for $1/2 \le u \le 1$, if $g(uY) > X$, then $uY > \sqrt{X}/\log X$ and hence $L(1, \mathbb{X}) \ll (\log H)^{-2}$. By Theorem 1.7, this happens with probability $\ll \exp(-H)$. Thus the Cauchy-Schwarz inequality yields

$$ \begin{aligned} \mathbb{E}[\min(\mathfrak{F}(g(uY)), \mathfrak{F}(X))] &= \mathbb{E}(\mathfrak{F}(g(uY))) + \mathbb{E}[(\mathfrak{F}(X) - \mathfrak{F}(g(uY)))1_{X<g(uY)}] \\ &= \mathbb{E}(\mathfrak{F}(g(uY))) + \mathcal{O}(\mathbb{E}[\mathfrak{F}(g(uY))1_{X<g(uY)}]) \\ &= \mathbb{E}(\mathfrak{F}(g(uY))) + \mathcal{O}(\sqrt{\mathbb{E}[\mathfrak{F}(g(uY))^2]}\mathbb{P}(X < g(uY))) \\ &= 8u\mathbb{E}(L(1, \mathbb{X})^{-1})H \log^3 H + \mathcal{O}(1). \end{aligned} $$

Moreover

$$ \begin{aligned} \mathbb{E}[\mathfrak{F}(g(uYe^{\lambda N})) - \mathfrak{F}(g(uY))] &\ll (e^{\lambda N} - 1)H \log^3 H + H \log^2 H \log_2 H \\ &\ll_{\varepsilon} H(\log H)^{8/3+2\varepsilon}. \end{aligned} $$

Putting these back in (8.7) and (8.6), we get that

$$ \begin{aligned} & \frac{1}{2\pi i} \int_{\mathfrak{R}(s)=c} H^s \mathfrak{J}_1 \left( \frac{e^{\lambda s} - 1}{\lambda s} \right)^N \frac{ds}{s} \\ &= \frac{8}{\zeta(2)} \mathbb{E}(L(1, \mathbb{X})^{-1}) \int_{1/2}^{\alpha+1/2} u \left( u - \frac{1}{2} \right) du \times H \log^3 H + \mathcal{O}_{\varepsilon}(H(\log H)^{8/3+2\varepsilon}). \end{aligned} \quad (8.8) $$

Now we need to show that the contribution of $\mathfrak{J}_2$ goes into the error term. By definition,

$$ \mathbb{E}(L(1, \mathbb{X})^{-s})\phi(-s) = \sum_p \prod_{q \ne p} \mathbb{E} \left( 1 - \frac{\mathbb{X}(p)}{p} \right)^s \left[ c_1(p) \left( 1 - \frac{1}{p} \right)^s + c_2(p) \left( 1 + \frac{1}{p} \right)^s + c_3(p) \right], $$

for some coefficients $c_i(p) \ll \log p/p^2$. We introduce the random variables $\mathbb{Y}_p(q)$, $p, q$ primes, defined by the following law: $\mathbb{Y}_p(q)$ and $\mathbb{X}(q)$ have the same law if $p \ne q$ and $\mathbb{P}(\mathbb{Y}_p(p) = 0) = 1$. We then put, for $n \ge 2$: $\mathbb{Y}_p(n) := \prod_{q \ne n} \mathbb{Y}_p(q)^e$ and $\mathbb{Y}_p(1) = 1$. With this formalism, we have

$$ \prod_{q \ne p} \mathbb{E} \left( 1 - \frac{\mathbb{X}(p)}{p} \right)^s = \mathbb{E}(L(1, \mathbb{Y}_p)^{-s}). $$
Then,

$$ \frac{1}{2\pi i} \int_{\mathbb{R}(s)=c} H^s \mathfrak{I}_2 \left( \frac{e^{\lambda s} - 1}{\lambda s} \right)^N \frac{ds}{s} = \\ \frac{1}{\zeta(2)} \sum_p \left\{ \begin{aligned} & c_1(p) \int_{1/2}^{1/2+\alpha} \mathbb{E} \left[ \int_2^X \frac{\log t}{2\sqrt{t}} I_{c,\lambda,N} \left( \frac{Hu \log t}{L(1, \mathbb{Y}_p)\sqrt{t}} \left( 1 - \frac{1}{p} \right) \right) dt \right] du \\ & + c_2(p) \int_{1/2}^{1/2+\alpha} \mathbb{E} \left[ \int_2^X \frac{\log t}{2\sqrt{t}} I_{c,\lambda,N} \left( \frac{Hu \log t}{L(1, \mathbb{Y}_p)\sqrt{t}} \left( 1 + \frac{1}{p} \right) \right) dt \right] du \\ & + c_3(p) \int_{1/2}^{1/2+\alpha} \mathbb{E} \left[ \int_2^X \frac{\log t}{2\sqrt{t}} I_{c,\lambda,N} \left( \frac{Hu \log t}{L(1, \mathbb{Y}_p)\sqrt{t}} \right) dt \right] du \end{aligned} \right\} $$

We now deal with each of these integrals in a similar way to that of the contribution of $\mathfrak{I}_1$. We only have to consider $\tilde{\mathfrak{F}}(t) = \sqrt{t}(\log t + \mathcal{O}(1))$, a primitive of $t \mapsto \log t/(2\sqrt{t})$, instead of $\mathfrak{F}$. As a result, we find that each of the three integrals in $u$ between curly brackets above is $\ll H \log^2 H$, and hence

$$ \frac{1}{2\pi i} \int_{\mathbb{R}(s)=c} H^s \mathfrak{I}_2 \left( \frac{e^{\lambda s} - 1}{\lambda s} \right)^N \frac{ds}{s} \ll \sum_p (c_1(p) + c_2(p) + c_3(p)) H \log^2 H \ll H \log^2 H $$

since $c_i(p) \ll \log p/p^2$.

All in one, putting this with (8.8) in (8.5), we find that the middle term of (8.4) is equal to

$$ \frac{8}{\zeta(2)} \mathbb{E}(L(1, \mathbb{X})^{-1}) \int_{1/2}^{\alpha+1/2} u \left( u - \frac{1}{2} \right) du \times H \log^3 H + \mathcal{O}_\varepsilon (H(\log H)^{8/3+2\varepsilon}). $$

Since $\mathbb{E}(L(1, \mathbb{X})^{-1}) = \prod_p \left(1 + \frac{p-1}{p^2(p+1)}\right)$ the previous expression becomes

$$ 2 \frac{\alpha^2(4\alpha + 3)}{3} \prod_p \left(1 - \frac{2p-1}{p^4}\right) H \log^3 H + \mathcal{O}_\varepsilon (H(\log H)^{8/3+2\varepsilon}). $$

This concludes the proof, changing $e^{\lambda N} H$ by $H$ in the right hand side of (8.4). $\square$

## References

[1] A. Dahl. On Moments of Class Numbers of Real Quadratic Fields. Master's thesis, University of Toronto, 2010.

[2] A. Dahl and Y. Lamzouri. The distribution of class numbers in a special family of real quadratic fields. *Transactions of the American Mathematical Society*, 370(9):6331–6356, 2018.

[3] H. Davenport. *Multiplicative Number Theory*, volume 74 of *Graduate Texts in Mathematics*. Springer, 1980.

[4] A. Granville and K. Soundararajan. The distribution of values of $L(1, \chi_d)$. *Geometric and Functional Analysis*, 13(5):992–1028, 2003.

[5] R. Heath-Brown. A mean value estimate for real character sums. *Acta Arithmetica*, 72(3):235–275, 1995.
[6] H. Heilbronn. On the class-number in imaginary quadratic fields. *The Quarterly Journal of Mathematics*, 5(1):150–160, 1934.

[7] C. Hooley. On the Pellian equation and the class number of indefinite binary quadratic forms. *Journal für die reine und angewandte Mathematik*, 353:98–131, 1984.

[8] Y. Lamzouri. Extreme values of $\arg L(1, \chi)$. *Acta Arithmetica*, 146(4):335–354, 2011.

[9] Y. Lamzouri. Large moments and extreme values of class numbers of indefinite binary quadratic forms. *Mathematika*, 63(2):564–586, 2017.

[10] P. Sarnak. Class numbers of indefinite binary quadratic forms. *Journal of Number Theory*, 15(2):229–247, 1982.

[11] C. L. Siegel. The average measure of quadratic forms with given determinant and signature. *Annals of Mathematics*, 45(4):667–685, 1944.

[12] K. Soundararajan. The number of imaginary quadratic fields with a given class number. *Hardy-Ramanujan Journal*, 30:13–18, 2007.

[13] T. Tatuzawa. On a theorem of Siegel. *Japanese journal of mathematics*, 21:163–178, 1951.

[14] G. Tenenbaum. *Introduction to analytic and probabilistic number theory*. American Math. Society, 2015.

JÉRÉMY DOUSSELIN : UNIVERSITÉ DE LORRAINE, CNRS, IECL, F-54000 NANCY, FRANCE
E-mail address : jeremy.dousselin@univ-lorraine.fr