# An explicit upper bound for $L(1, \chi)$ when $\chi$ is quadratic

D R Johnston, Olivier Ramaré, T. Trudgian

► To cite this version:

D R Johnston, Olivier Ramaré, T. Trudgian. An explicit upper bound for $L(1, \chi)$ when $\chi$ is quadratic.
Research in Number Theory, 2023, 9 (4), pp.72. 10.1007/s40993-023-00476-4. http://dx.doi.org/10.1007/s40993-023-00476-4

HAL Id: hal-04238675

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

Submitted on 12 Oct 2023

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 CC BY 4.0 - Attribution - International License
# An explicit upper bound for $L(1, \chi)$ when $\chi$ is quadratic

D. R. Johnston<fnref n="1" />, O. Ramaré² and T. Trudgian<fnref n="1" />*

**Abstract**

We consider Dirichlet $L$-functions $L(s, \chi)$ where $\chi$ is a non-principal quadratic character to the modulus $q$. We make explicit a result due to Pintz and Stephens by showing that $|L(1, \chi)| \le \frac{1}{2} \log q$ for all $q \ge 2 \cdot 10^{23}$ and $|L(1, \chi)| \le \frac{9}{20} \log q$ for all $q \ge 5 \cdot 10^{50}$.

**Keywords:** $L(1, \chi)$, Character sums

**Mathematics Subject Classification:** 11M20

## 1 Introduction and results

A central problem in number theory concerns estimates on $L(1, \chi)$, where $\chi$ is a non-principal Dirichlet character to the modulus $q$, and where $L(s, \chi)$ is its associated Dirichlet $L$-function. Bounding sums of $\chi(n)$ trivially leads to the bound $|L(1, \chi)| \le \log q + O(1)$. The Pólya–Vinogradov inequality allows one to improve this to $(1/2) \log q + O(1)$. An interesting history of these developments is given by Pintz [28].

Explicit versions of the above results date back to Hua [10]. See also work by Louboutin [22] and the second author [32,33] for finding small pairs $c, q_0$ such that $|L(1, \chi)| \le (1/2) \log q + c$ for all $q \ge q_0$. It appears difficult to improve on these bounds for generic $q$.

When $q$ is prime, the best result is due to Stephens [37], namely that $|L(1, \chi)| \le \frac{1}{2}(1 - e^{-1/2} + o(1)) \log q$, where $\frac{1}{2}(1 - e^{-1/2}) = 0.1967...$. This result has been extended to arbitrary moduli by Pintz in [28,29]. In this paper we focus on quadratic characters $\chi$ for which it is known (see, e.g., §6 in [7]) that $L(1, \chi) > 0$. We aim at making the Pintz–Stephens result partially explicit in the following theorems.

**Theorem 1** Let $\chi$ be a quadratic odd primitive Dirichlet character modulo $q \ge 2 \cdot 10^{23}$. We have $L(1, \chi) \le (\log q)/2$.

For all even characters (not just quadratic ones) it is known that $|L(1, \chi)| \le (\log q)/2$, for all $q \ge 2$. This is proved in [32] after several papers by Louboutin, the last of which is [22]. Bounds relying on additional constraints on the characters at the small primes have been investigated by Louboutin in [23], by the second author in [33], by Saad Eddin in [36] and by Platt and Saad Eddin in [30]. On taking $q$ to be larger, we can improve on the factor $1/2$ in Theorem 1.

<footnote>*Correspondence:</footnote>

<footnote>t.trudgian@adfa.edu.au</footnote>

<footnote n="1">¹School of Science, UNSW
Canberra at ADFA, Campbell,
ACT, Australia</footnote>

<footnote>Full list of author information is
available at the end of the article</footnote>
**Theorem 2** Let $\chi$ be a quadratic primitive Dirichlet character modulo $q$. The inequality $L(1, \chi) \le (9/20) \log q$ holds true when $\chi$ is even and $q \ge 2 \cdot 10^{49}$ or $\chi$ is odd and $q \ge 5 \cdot 10^{50}$.

We note that, on the Generalized Riemann hypothesis much more is known. Littlewood [21] showed that $L(1, \chi) \ll \log \log q$. This has been made explicit for large $q$ in [15] by Lamzouri, Li and Soundararajan, and then for all $q$ in [17] by Languasco and the third author. Finally, although we do not consider lower bounds on $L(1, \chi)$, we direct the reader to a survey of explicit and inexplicit bounds of Mossinghoff, Starichkova and the third author in [25], and to the recent work [16].

The outline of this paper is follows. In § 2 we assemble some bounds on prime counting functions and on related inequalities. In § 3 we collect the necessary explicit results on character sums. In § 4 we prepare the technical preliminaries to Stephens' approach, and analyse these in § 5. Our § 6 is purely centred on the optimization in (an improved version of) Stephens' method, and contains no number-theoretic input. Finally, in § 7 we prove Theorems 1 and 2.

We use the notation $f(x) = O^*(g(x))$ to mean that $|f(x)| \le g(x)$ for the range of $x$ considered. Note that this differs from the usual big-O notation, as it takes the implied constant to be 1. We also let

$$ \Lambda(n) = \begin{cases} \log p, & \text{if } n = p^k \text{ for some prime } p \text{ and integer } k \ge 1, \\ 0, & \text{otherwise} \end{cases} $$

be the usual von Mangoldt function. Throughout this paper we shall let $H > 1$ be a parameter, which ultimately we shall optimise. With that in mind, we define

$$ h(\chi, y) = \sum_{n \le H^y} \frac{\chi(n) \Lambda(n)}{n}, \quad h(1, y) = \sum_{n \le H^y} \frac{\Lambda(n)}{n}. \qquad (1) $$

In addition, for $x \ge 0$ define

$$ f(x) = H^{-x} \sum_{n \le H^x} \chi(n), \quad F(x) = \int_0^x f(t) dt = \sum_{n \le H^x} \frac{\chi(n)}{n \log H} - \frac{f(x)}{\log H}. \qquad (2) $$

We note that the second inequality in (2) follows from the first and partial summation. Namely,

$$ \begin{aligned} \sum_{n \le H^x} \frac{\chi(n)}{n} &= \frac{\sum_{n \le H^x} \chi(n)}{H^x} + \int_0^{H^x} \frac{1}{H^{2t}} \sum_{n \le H^t} \chi(n) d(H^t) \\ &= \frac{\sum_{n \le H^x} \chi(n)}{H^x} + \int_0^x \frac{\log H}{H^t} \sum_{n \le H^t} \chi(n) dt \\ &= \frac{\sum_{n \le H^x} \chi(n)}{H^x} + \log H \int_0^x f(t) dt, \end{aligned} $$

which rearranges to the desired result.

Our aim is to majorize $F(1)$. Define

$$ \ell(y) = H^{-y} \sum_{n \le H^y} \chi(n) \log n. \qquad (3) $$

It is also convenient to introduce the points

$$ x_m = 1 - \frac{\log m}{\log H}. \qquad (4) $$
## 2 Preliminary results

We now list a trivial result that follows immediately from partial summation.

**Lemma 3** When $x \ge 0$, we have $\sum_{n \le x} 1/\sqrt{n} \le 2\sqrt{x}$.

The following result is slightly more subtle.

**Lemma 4** When $x \ge y \ge 1$, we have $S(x, y) := \sum_{y \le n \le x} 1/n \le 1 + \log(x/y)$.

*Proof* First note that we only need to prove the result for $y$ an integer. If $y \notin \mathbb{Z}$, then

$$S(x, y) = S(x, [y] + 1) \le 1 + \log \left( \frac{x}{[y] + 1} \right) < 1 + \log \left( \frac{x}{y} \right).$$

Similarly it suffices to prove the result for integral $x$. Assume, therefore, that $y \ge x \ge 1$ where both $x, y \in \mathbb{Z}$. We therefore have

$$S(x, y) = \frac{1}{y} + \sum_{n=y+1}^{x} \frac{1}{n} \le 1 + \int_{x}^{y} \frac{dt}{t} = 1 + \log \left( \frac{x}{y} \right),$$

as required.

□

We now list some bounds related to the prime number theorem. In particular, we give a range of bounds for the Chebyshev function

$$\psi(x) = \sum_{p^k \le x} \log p.$$

The first is a classical result from Rosser and Schoenfeld, see [35, Thm 12].

**Lemma 5** When $x \ge 0$, we have $\psi(x) \le 1.04x$.

We note that the result of Rosser and Schoenfeld gives 1.03883 in Lemma 5, which is an approximation to $\psi(113)/113$. To improve the bound in Lemma 5 it would be necessary to take $x \ge x_0 > 113$, which, while possible, would complicate greatly the ensuing analysis for only a marginal improvement.

The second is an explicit bound of the form $\psi(x) - x = o(x)$ coming from [3, Table 15] by Broadbent, Kadiri, Lumley, Ng, and Wilk.

**Lemma 6** When $x \ge 10^5$, we have $|\psi(x) - x| \le 0.64673 x/(\log x)^2$.

On the Riemann hypothesis we have $\psi(x) - x = O(x^{1/2+\epsilon})$ for every $\epsilon > 0$. The following result, from [5, Thm 2] of Büthe, gives an explicit version of an even sharper bound for a finite range.

**Lemma 7** When $11 < x \le 10^{19}$, we have $|\psi(x) - x| \le 0.94\sqrt{x}$.

We remark that slightly weaker versions of Lemma 7, but ones that hold in a longer range of $x$ have been provided by the first author in [12]. We require the following result to be used in tandem with Lemma 7.

**Lemma 8** When $e^{40} \le x$, we have $|\psi(x) - x| \le 1.994 \cdot 10^{-8} x$.

This is obtained directly from [3, Table 8]. The key feature here is that $e^{40} < 10^{19}$ so that Lemma 7 and Lemma 8 between them cover all values of $x > 11$. Better results are
available when $x$ is very large, say $\log x \ge 1000$ — see [31] by Platt and Trudgian, and [13] by the first author and Yang — but Lemmas 7 and 8 suffice for our needs.

We now turn to estimates on

$$ \tilde{\psi}(u) := \sum_{n \le u} \frac{\Lambda(n)}{n} \qquad (5) $$

to aid in the evaluation of $h(\chi, y)$ and $h(1, y)$ in (1). To obtain such estimates we correct a result of the second author in [34].

**Lemma 9** For $x \ge 71$ we have

$$ \sum_{n \le x} \frac{\Lambda(n)}{n} = \log x - \gamma + \frac{\psi(x) - x}{x} + \frac{0.047}{\sqrt{x}} + \frac{\log(2\pi) + 10^{-4}}{x} + E(x), $$

where $\gamma$ is the Euler–Mascheroni constant, and where

$$ E(x) = \begin{cases} 1.75 \cdot 10^{-12}, & 1 \le x < 2R \log^2 T_0 \\ \frac{1+2\sqrt{(\log x)/R}}{2\pi} \exp(-2\sqrt{(\log x)/R}), & x \ge 2R \log^2 T_0, \end{cases} $$

with<fnref n="1" /> $R = 5.69693$ and $T_0 = 2.44 \cdot 10^{12}$.

**Proof** As discussed by Chirre, Hagen, and Simonič in [6], by fixing a couple of small typos, Lemma 2.2 in [34] can be replaced by

$$ \sum_{n \le x} \frac{\Lambda(n)}{n} = \log x - \gamma + \frac{\psi(x) - x}{x} - \sum_{\rho} \frac{x^{\rho-1}}{\rho(\rho-1)} + \int_x^\infty \frac{\log 2\pi + \frac{1}{2}\log(1-u^{-2})}{u^2} du, $$

where $\rho$ runs over the non-trivial zeros of the Riemann zeta-function, counting multiplic- ity. Following [34, §5], we have

$$ \left| \sum_{\rho} \frac{x^{\rho-1}}{\rho(\rho-1)} \right| \le \frac{0.047}{\sqrt{x}} + E(x). $$

Finally, since $x \ge 71$,

$$ \left| \int_x^\infty \frac{\log 2\pi + \frac{1}{2}\log(1-u^{-2})}{u^2} du \right| \le \frac{\log(2\pi)}{x} + \frac{|\log(1-71^{-2})|}{2x} \\ \le \frac{\log(2\pi) + 10^{-4}}{x}. $$

□

<footnote n="1">¹The value of $R$ comes from work by Kadiri [14] on the classical zero-free region for the zeta-function. This can be lowered using more recent results [26] and [27], respectively by Mossinghoff and Trudgian and by Mossinghoff, Trudgian and Yang, but it is inconsequential for our purposes.</footnote>
**Lemma 10** We have

$$ \sum_{n \le x} \frac{\Lambda(n)}{n} = \log x - \gamma + \mathcal{O}^*(1.3 / \log^2 x), \quad x > 1, \qquad (6) $$

$$ \sum_{n \le x} \frac{\Lambda(n)}{n} = \log x - \gamma + \mathcal{O}^*(1/\sqrt{x}), \quad 1 \le x \le 10^{19}. \qquad (7) $$

*Proof* Using Lemma 9 with the bounds from Lemmas 6 and 7, we obtain that,

$$ \sum_{n \le x} \frac{\Lambda(n)}{n} = \log x - \gamma + \mathcal{O}^* \left( \frac{0.67}{\log^2 x} \right) $$

for $x \ge 10^5$, and

$$ \sum_{n \le x} \frac{\Lambda(n)}{n} = \log x - \gamma + \mathcal{O}^* \left( \frac{1}{\sqrt{x}} \right) $$

for $10^5 \le x \le 10^{19}$. We then extend these estimates to smaller values of $x$ by direct computation, giving (6) and (7). □

An immediate consequence of this result is as follows.

**Lemma 11** We have

$$ \sum_{n \le x} \frac{\Lambda(n)}{n} \le \log x - 0.545, \quad x \ge 10^3, $$

$$ \sum_{n \le x} \frac{\Lambda(n)}{n} \ge \log x - 0.576, \quad x \ge 10^6. $$

We now examine the weighted average of $\sum_{n \le u} \Lambda(n)/n$.

**Lemma 12** We have

$$ \int_1^\infty \left| \sum_{n \le u} \frac{\Lambda(n)}{n} - \log u + \gamma \right| \frac{du}{u} \le 0.411. $$

This integral may be of interest in its own right. While the true value of this integral seems close to 0.41, we have no idea of the conjectured limiting value of the integral. To this end, see a similar problem discussed in [2].

*Proof* We define $\Delta(u) = \sum_{n \le u} \Lambda(n)/n - \log u + \gamma$. When the variable $u$ is small, we compute directly by using the fact that $\tilde{\psi}(u)$ is constant on $[n, n + 1)$ and that, with $\tau = \tilde{\psi}(n) + \gamma$, the integral $\int_n^{n+1} |\Delta(u)| du/u$ is equal to

$$ \left\{ \begin{array}{ll} \frac{\log^2(n+1) - \log^2 n}{2} - \tau \log \frac{n+1}{n} & \text{when } \tau \le \log n, \\ \frac{\log^2(n+1) + \log^2 n - 2\tau^2}{2} + \tau(2\tau - \log(n^2 + n)) & \text{when } \log n < \tau < \log(n+1), \\ -\frac{\log^2(n+1) - \log^2 n}{2} + \tau \log \frac{n+1}{n} & \text{when } \tau \ge \log(n+1). \end{array} \right. $$

The second case is treated by splitting the integral at $u = e^\tau$. We compute in this manner that

$$ \int_1^{10^6} |\Delta(u)| \frac{du}{u} \le 0.408. $$
We use Lemma 10 to infer that

$$ \int_{10^6}^{10^{19}} |\Delta(u)| \frac{du}{u} \le \int_{10^6}^{10^{19}} \frac{1}{u^{3/2}} du \le \frac{2}{\sqrt{10^6}} = \frac{2}{1000} = 0.002. $$

We now use Lemma 8 and Lemma 9 to show that, for some $x_1 \ge 10^{19}$,

$$ \int_{10^{19}}^{x_1} |\Delta(u)| \frac{du}{u} \le \int_{10^{19}}^{x_1} \left( \frac{2 \cdot 10^{-8}}{u} + \frac{0.05}{u^{3/2}} \right) du \\ = 2 \cdot 10^{-8}(\log x_1 - 19 \log 10) + \frac{0.2}{\sqrt{10^{19}}} - \frac{0.2}{\sqrt{x_1}}. $$

To handle the integration beyond $x_1$ we use (6) in Lemma 10, whence the total integral is

$$ 0.408 + 0.002 + 2 \cdot 10^{-8}(\log x_1 - 19 \log 10) + \frac{0.2}{\sqrt{10^{19}}} - \frac{0.2}{\sqrt{x_1}} + \frac{1.3}{\log x_1}. $$

Choosing $x_1 = \exp(500)$ gives the result. □

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

We remark that we could further divide the range to use more entries in the tables in [3], but the above result is sufficient for our purposes.

### 3 Character sum estimates

The work of Stephens and Pintz relied on the Burgess bound from [4]. Explicit versions of this are known but are still numerically rather weak. When the modulus is prime, such bounds have been provided by Francis [8] improving on work by Treviño [38] and McGown [24]. If we restrict our attention here to quadratic characters to prime modulus congruent to 1 modulo 4, we may rely on the slightly stronger bounds of Booker in [1]. Recently, Jain-Sharma, Khale and Liu have produced in [11] an explicit version of the Burgess inequality for a composite modulus, but only for $q$ primitive and $q \ge \exp(\exp(9.6))$.

Instead of the Burgess bound we shall rely on versions of the Pólya–Vinogradov inequality. We first require an explicit version of the Pólya–Vinogradov inequality.

The following is from [18, 19] by Lapkova, which makes a small improvement on the earlier result from [9, Theorem 2] by Frolenkov and Soundararajan.

**Lemma 13** When $q > 1$ and $\chi$ is a primitive Dirichlet character modulo $q$, we have

$$ \left| \sum_{A \le n \le B} \chi(n) \right| \le V(\chi) = \begin{cases} \frac{2}{\pi^2} \sqrt{q} \log q + 0.9467 \sqrt{q} + 1.668, & \text{when } \chi(-1) = 1, \\ \frac{1}{2\pi} \sqrt{q} \log q + 0.8204 \sqrt{q} + 1.0286, & \text{when } \chi(-1) = -1. \end{cases} $$

When $A = 0$ and $\chi$ is even, we may divide this bound by 2.

In what follows, we write $V = V(\chi)$ for brevity, and apply the appropriate bound from Lemma 13 according to the parity of the character $\chi$.

Here is a smoothed version of the Pólya–Vinogradov inequality that we take from Levin, Pomerance and Soundararajan in [20].

**Lemma 14** Let $\chi$ be a primitive Dirichlet character modulo $q > 1$. Let $M$ and $N$ be real numbers with $0 < N \le q$. With $W(t) = \max(0, 1 - |t - 1|)$, we have

$$ \left| \sum_{M \le n \le M+2N} \chi(n) W\left(\frac{n-M}{N}\right) \right| \le \sqrt{q} - \frac{N}{\sqrt{q}}. $$
**Lemma 15** Let $\chi$ be a primitive Dirichlet character modulo $q > 1$. Let $M$ and $N$ be real numbers with $0 < N \le q$. When $\chi$ is odd, we have

$$ \left| \sum_{M < n \le M + N} \chi(n) \right| \le \sqrt{2N} q^{1/4} + \sqrt{q}. $$

When $\chi$ is even, we have

$$ \left| \sum_{n \le N} \chi(n) \right| \le \sqrt{N} q^{1/4} + \frac{1}{2} \sqrt{q}. $$

*Proof* We may assume that $M$ is an integer. Notice first that the lemma is trivial when $N \le \sqrt{q}$, so we may assume $N > \sqrt{q}$. Let $K \ge 1$ be an integer and let $A = N/K$. Keeping the notation of Lemma 14, we first notice that

$$ W\left(\frac{t - (M - A/2)}{A}\right) + W\left(\frac{t - (M + A/2)}{A}\right) + \dots + W\left(\frac{t - (M + (K - 1/2)A)}{A}\right) \\ = \begin{cases} W\left(\frac{t - (M - A/2)}{A}\right) & \text{when } M - A/2 \le t \le M + A/2, \\ 1 & \text{when } M + A/2 \le t \le M + (K + 1/2)A, \\ W\left(\frac{t - (M + (K - 1/2)A)}{A}\right) & \text{when } M + (K - 1/2)A \le t \le M + (K + 1/2)A. \end{cases} $$

Therefore

$$ \left| \sum_{M < n \le M + N} \chi(n) - \sum_{1 \le k \le K} \sum_{n} \chi(n) W\left(\frac{t - (M + (k - 1/2)A)}{A}\right) \right| \le \frac{4}{A} \sum_{1 \le a \le A/2} a $$

which is readily seen to be of size at most $A/2 + 1$. On using Lemma 14, we get

$$ \left| \sum_{M < n \le M + N} \chi(n) \right| \le K \sqrt{q} - \frac{KA}{\sqrt{q}} + \frac{A}{2} + 1 \le K \sqrt{q} - \frac{N}{\sqrt{q}} + \frac{N}{2K} + 1. $$

We let $K = 1 + [q^{-1/4}\sqrt{N/2}]$ and write $K = c + q^{-1/4}\sqrt{N/2}$ with $c \in (0, 1]$. We find that

$$ K \sqrt{q} + \frac{N}{2K} = \sqrt{\frac{N \sqrt{q}}{2}} + c \sqrt{q} + \frac{N}{2c + q^{-1/4} \sqrt{2N}}. $$

By computing the derivative with respect to $c$, we check that this quantity is maximised at $c = 1$. The lemma follows readily. □

Before introducing the next lemma, we recall the functions $F, f$ defined in (2).

**Lemma 16** We have $L(1, \chi) = F(1) \log H + O*(VH^{-1})$, where $V$ is defined in Lemma 13.

*Proof* By summation by parts, we find that

$$ \sum_{n>H} \frac{\chi(n)}{n} = \int_H^\infty \sum_{H \le n \le t} \chi(n) \frac{dt}{t^2}, $$
hence

$$
\begin{align*}
L(1, \chi) &= F(1) \log H + f(1) + \int_H^\infty \sum_{H \le n \le t} \chi(n) \frac{dt}{t^2} \\
&= F(1) \log H + \sum_{n \le H} \int_H^\infty \frac{dt}{t^2} + \int_H^\infty \sum_{H \le n \le t} \chi(n) \frac{dt}{t^2} \\
&= F(1) \log H + \int_H^\infty \sum_{n \le t} \chi(n) \frac{dt}{t^2} = F(1) \log H + \mathcal{O}^*(V/H).
\end{align*}
$$

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

4 Preliminaries to Stephens’ approach

Using the definition of $f(x)$ from (2) in § 1, we have

$$
\begin{align*}
\sum_{m \le H^x} \frac{\chi(m) \Lambda(m)}{m} f\left(x - \frac{\log m}{\log H}\right) &= \frac{1}{H^x} \sum_{m \le H^x} \chi(m) \Lambda(m) \sum_{n \le H^x/m} \chi(n) \\
&= \frac{1}{H^x} \sum_{m \le H^x} \Lambda(m) \sum_{mn \le H^x} \chi(mn).
\end{align*}
$$

Now, $\Lambda(m)$ is only non-zero when $m$ is a prime power, so

$$
\frac{1}{H^x} \sum_{m \le H^x} \Lambda(m) \sum_{mn \le H^x} \chi(mn) = \frac{1}{H^x} \sum_{p^k \le H^x} \log p \sum_{p^k n \le H^x} \chi(p^k n). \quad (8)
$$

We now write $s = \prod_i p_i \alpha^i$ as the prime decomposition for each $s \le H^x$, so that (8)
becomes

$$
\frac{1}{H^x} \sum_{s \le H^x} \chi(s) \sum_i \alpha_i \log(p_i) = \frac{1}{H^x} \sum_{s \le H^x} \chi(s) \log s = \ell(x),
$$

using the definition of $\ell(x)$ from (3). We therefore have

$$
\ell(x) = \sum_{m \le H^x} \frac{\chi(m) \Lambda(m)}{m} f\left(x - \frac{\log m}{\log H}\right). \qquad (9)
$$

We now recast this for greater ease of use in what follows.

**Lemma 17** We have, for $x \ge 0$,

$$
\frac{\ell(x)}{\log H} = xf(x) - H^{-x} \int_{0}^{x} f(u)H^{u}du.
$$

If $H \ge V > 1$ we also have $\int_0^1 f(u)H^u du/H = \mathcal{O}^*(1/\log H)$ and

$$
\sum_{m \le H} \frac{\chi(m) \Lambda(m)}{m \log H} f(x_m) = f(1) + \mathcal{O}^* \left( \frac{R_{\chi}(H, V, q)}{\log H} \right), \quad (10)
$$

where

$$
R_{\chi}(H, V, q) = \begin{cases} (3.66 + \log(V^2/q)) \frac{\sqrt{q}}{H} + \log(4e^2 \sqrt{q}H/V^2) \frac{V}{2H} & \text{when } \chi(-1) = 1, \\ (7.2 + \log(V^2/q)) \frac{\sqrt{q}}{H} + \log(2e^2 \sqrt{q}H/V^2) \frac{V}{H} & \text{when } \chi(-1) = -1. \end{cases} \tag{11}
$$
We note that the proofs of Theorems 1 and 2 only require the upper bound in the $O^*$ error term in (10): see (17) for where this is used. Nevertheless, it is easy enough to prove (10) as it is written.

**Proof** We find that

$$ 
\begin{aligned}
\sum_{k \le H^x} \chi(k) \log k &= \sum_{k \le H^x} \chi(k) \log(H^x) - \sum_{k \le H^x} \chi(k) \int_k^{H^x} \frac{dt}{t} \\
&= H^x x f(x) \log H - \int_1^{H^x} f\left(\frac{\log t}{\log H}\right) t \frac{dt}{t} \\
&= H^x x f(x) \log H - \int_0^x f(u)(\log H) H^u du
\end{aligned}
$$

and the first part of the lemma follows readily. Concerning the upper bound for $|\int_0^1 f(u)H^u du|/H$, we proceed as follows.

**Case of even characters**

By Lemma 13 and 15, we have three upper bounds for $|f(u)|$: either $1, q^{1/4}H^{-u/2} + \frac{1}{2}q^{1/2}H^{-u}$ or $V/(2H^u)$. We have $q^{1/4}H^{-u/2} + \frac{1}{2}q^{1/2}H^{-u} \le 1$ when $H^u/\sqrt{q} \ge 1 + \sqrt{3}$. We momentarily set $\tilde{V} = V/2$. We define

$$ u_0 = \frac{\log(1 + \sqrt{3}) + \frac{1}{2} \log q}{\log H}. $$

Define the real parameter $a$ by $\frac{1}{2}(1-a)\log H = \log(\sqrt{qH}/\tilde{V})$. We get

$$ 
\begin{aligned}
\int_0^1 |f(u)|H^u du &\le \int_0^{u_0} H^u du + \int_{u_0}^a (q^{1/4}H^{u/2} + \frac{1}{2}q^{1/2})du + \int_a^1 \tilde{V} du \\
&\le \frac{H^{u_0} - 1}{\log H} + \frac{2q^{1/4}(H^{a/2} - H^{u_0/2})}{\log H} + \frac{a - u_0}{2}q^{1/2} + (1-a)\tilde{V} \\
&\le \frac{\sqrt{q}}{\log H}(1 + \sqrt{3} + 2\sqrt{1 + \sqrt{3}}) + \frac{2q^{1/4}\sqrt{H}}{\log H}\frac{\tilde{V}}{\sqrt{qH}} \\
&\quad + \frac{\log \frac{\tilde{V}^2}{q(1+\sqrt{3})}}{\log H}\sqrt{q} + \frac{\log(\sqrt{qH}/\tilde{V}^2)}{\log H}\tilde{V} \\
&\le \frac{\sqrt{q}}{\log H}\left(1 + \sqrt{3} + 2\sqrt{1 + \sqrt{3}} + \log \frac{\tilde{V}^2}{q(1+\sqrt{3})}\right) \\
&\quad + \frac{2\tilde{V}}{\log H} + \frac{\log(\sqrt{qH}/\tilde{V}^2)}{\log H}\tilde{V}.
\end{aligned}
$$

**Case of odd characters**

Again by Lemma 13 and 15, we have three upper bounds for $|f(u)|$: either $1, q^{1/4}\sqrt{2}H^{-u/2} + q^{1/2}H^{-u}$ or $V/H^u$. We have $q^{1/4}\sqrt{2}H^{-u/2} + q^{1/2}H^{-u} \le 1$ when $H^u/\sqrt{q} \ge 2 + \sqrt{3}$. We define

$$ u_0 = \frac{\log(2 + \sqrt{3}) + \frac{1}{2} \log q}{\log H}. $$
Define the real parameter $a$ by $\frac{1}{2}(1-a)\log H = \log(\sqrt{2\sqrt{qH}}/V)$. We get

$$ 
\begin{aligned}
\int_0^1 |f(u)|H^u du &\le \int_0^{u_0} H^u du + \int_{u_0}^a (q^{1/4}\sqrt{2}H^{u/2} + q^{1/2})du + \int_a^1 Vdu \\
&\le \frac{H^{u_0}-1}{\log H} + \frac{2\sqrt{2}q^{1/4}(H^{a/2} - H^{u_0/2})}{\log H} + (a-u_0)q^{1/2} + (1-a)V \\
&\le \frac{\sqrt{q}}{\log H}(2+\sqrt{3}+2\sqrt{2}\sqrt{2+\sqrt{3}}) + \frac{2\sqrt{2}q^{1/4}\sqrt{H}}{\log H} \frac{V}{\sqrt{2\sqrt{qH}}} \\
&\quad + \frac{\log \frac{V^2}{2q(2+\sqrt{3})}}{\log H} \sqrt{q} + \frac{\log(2\sqrt{qH}/V^2)}{\log H} V \\
&\le \frac{\sqrt{q}}{\log H}(2+\sqrt{3}+2\sqrt{2}\sqrt{2+\sqrt{3}}+\log \frac{V^2}{2q(2+\sqrt{3})}) \\
&\quad + \frac{2V}{\log H} + \frac{\log(2\sqrt{qH}/V^2)}{\log H} V.
\end{aligned}
$$

### Resuming the proof

Inequality (10) follows: indeed, by (9), the left-hand side is $\ell(1)/\log H$ which we compute with the first formula of the present lemma. We complete the proof by using the bound above for $\int_0^1 |f(u)|H^u du$. $\square$

**Lemma 18** We have, for $x \ge 0$,

$$ 
\begin{aligned}
\left(x - \frac{1}{\log H}\right) F(x) &= \int_0^x F(x-y)dy \\
&\quad + \sum_{m \le H^x} \frac{\chi(m)\Lambda(m)}{m \log H} F\left(x - \frac{\log m}{\log H}\right) + \mathcal{O}^*(1/\log^2 H).
\end{aligned}
$$

*Proof* On joining (9) and Lemma 17, we get

$$ x f(x) - H^{-x} \int_{0}^{x} f(u) H^{u} du = \sum_{m \le H^x} \frac{\chi(m) \Lambda(m)}{m \log H} f\left(x - \frac{\log m}{\log H}\right). $$

This is the equivalent of [37, (55)] by Stephens. The next step is to integrate the above relation:

$$ 
\begin{aligned}
\int_0^x yf(y)dy - \int_0^x \int_0^y f(u)H^{u-y}dudy &= \int_0^x \sum_{m \le H^y} \frac{\chi(m)\Lambda(m)}{m \log H} f\left(y - \frac{\log m}{\log H}\right)dy \\
&= \sum_{m \le H^x} \frac{\chi(m)\Lambda(m)}{m \log H} \int_{\frac{\log m}{\log H}}^x f\left(y - \frac{\log m}{\log H}\right)dy \\
&= \sum_{m \le H^x} \frac{\chi(m)\Lambda(m)}{m \log H} F\left(x - \frac{\log m}{\log H}\right).
\end{aligned}
$$

As for the left-hand side, we first check that

$$ \int_0^x yf(y)dy = xF(x) - \int_0^x F(x-y)dy. $$
And finally

$$
\begin{align*}
\int_0^x \int_0^y f(u) H^{u-y} du dy &= \int_0^x f(u) H^u \int_u^x H^{-y} dy du \\
&= \int_0^x f(u) H^u \frac{H^{-u} - H^{-x}}{\log H} du = \frac{F(x)}{\log H} + \mathcal{O}^* \left( \frac{1}{\log^2 H} \right)
\end{align*}
$$

by bounding $|f(u)|$ by 1.

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

**Lemma 19** We have, when $x \ge 0$

$$
\int_0^x F(x - y) dy = \sum_{m \le H^x} \frac{\Lambda(m)}{m \log H} F\left(x - \frac{\log m}{\log H}\right) - F(x) \frac{\gamma}{\log H} + \mathcal{O}^*\left(\frac{0.411}{\log^2 H}\right).
$$

*Proof* We start from the right-hand side:

$$
\begin{align*}
\sum_{m \le H^x} \frac{\Lambda(m)}{m \log H} F\left(x - \frac{\log m}{\log H}\right) &= \sum_{m \le H^x} \frac{\Lambda(m)}{m \log H} \int_0^{x - \frac{\log m}{\log H}} f(t) dt \\
&= \int_0^x f(t) \sum_{m \le H^{x-t}} \frac{\Lambda(m)}{m \log H} dt.
\end{align*}
$$

Recall $\tilde{\psi}$ from (5). We approximate $\tilde{\psi}(H^{x-t})$ by $(x-t)\log H - \gamma$, getting the main term and this is $\int_0^x F(t)dt - F(x)\frac{\gamma}{\log H}$ and treat the error term by bounding $|f(t)|$ by 1:

$$
\begin{align*}
\left| \int_0^x f(t) \left( \frac{\tilde{\psi}(H^{x-t})}{\log H} - \left(x - t - \frac{\gamma}{\log H}\right) \right) \right| dt &\le \int_0^x \left| \frac{\tilde{\psi}(H^{x-t})}{\log H} - \left(x - t - \frac{\gamma}{\log H}\right) \right| dt \\
&\le \int_0^x \left| \frac{\tilde{\psi}(H^t)}{\log H} - t + \frac{\gamma}{\log H} \right| dt \\
&\le \int_1^{H^x} \left| \tilde{\psi}(u) - \log u + \gamma \right| \frac{du}{u \log^2 H}.
\end{align*}
$$

We then majorize this last term by Lemma 12. If follows from the definition of F in (2)
that this last term is not more than 0.411 / log² H.
□

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

**Lemma 20** We have, when $x \ge 0$,

$$
xF(x) = \sum_{m \le H^x} \frac{\Lambda(m)(1 + \chi(m))}{m \log H} F\left(x - \frac{\log m}{\log H}\right) + F(x) \frac{1 - \gamma}{\log H} + \mathcal{O}^*\left(\frac{1.411}{\log^2 H}\right).
$$

*Proof* This follows by combining Lemmas 18 and 19.

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

**5 A comparison and the main inequality**

This section is devoted to the comparison between

$$
\sum_{m \le H} \frac{\Lambda(m)}{m \log H} f(x_m) \qquad (12)
$$

and F(1), where $x_m$ is defined in (4). The important observation, essentially due to
Stephens, is that since f has tame variations, both should be about equal. In § 7, where we
prove Theorems 1 and 2, we need only to bound (12) from below by F(1) plus some error
term.
We first connect $F(1)$ with the bounds on character sums, that is, with the $V$ from Lemma 13.

**Lemma 21** We have, for any $D \ge 1$,

$$F(1) = \sum_{n \le H/D} \frac{\chi(n)}{n \log H} - \frac{f(1)}{\log H} + O^*\left(\frac{(D-1)V/H}{\log H}\right).$$

*Proof* We have

$$\sum_{H/D<n \le H} \frac{\chi(n)}{n} = \sum_{H/D<n \le H} \chi(n) \left( \int_{n}^{H} \frac{dt}{t^2} + \frac{1}{H} \right) = \int_{H/D}^{H} \sum_{H/D<n \le t} \chi(n) \frac{dt}{t^2} + \frac{1}{H} \sum_{H/D<n \le H} \chi(n).$$

Using that $|\sum_{A \le n \le B} \chi(n)| \le V$ yields the desired result. □

**Lemma 22** Let $D_0 \ge 1$, and $A_2$ be such that

$$|\psi(x) - x| \le A_2 \sqrt{x}, \quad D_0 \le x \le 10^{19}. \qquad (13)$$

We then have, for any $D \ge D_0$,

$$\sum_{mn \le H} \chi(n) \Lambda(m) = H(F(x_D) \log H + f(x_D)) + O^*(1.6 \cdot 10^{-5}H + 2A_2HD^{-1/2} + 1.04DV).$$

Please notice that we would need only the lower estimate in the last bound.

*Proof* We write

$$\sum_{mn \le H} \chi(n) \Lambda(m) = \sum_{n \le H/2} \chi(n) \sum_{m \le H/n} \Lambda(m) = \sum_{n \le H/D} \chi(n) \sum_{m \le H/n} \chi(m) + \sum_{m \le D} \Lambda(m) \sum_{H/D < n \le H/m} \chi(n). \quad (14)$$

By Lemma 3, the last sum over $n$ is bounded in absolute value by $V$. It then follows by Lemma 5 that the second summand of (14) satisfies

$$\sum_{m \le D} \Lambda(m) \sum_{H/D < n \le H/m} \chi(n) \le 1.04DV.$$

Concerning the first summand of (14), we use three steps. For the first step, we restrict to the range $H/10^{19} < n \le H/D$ and use (13). Note that Lemma 7 tells us that we can take $A_2 = 0.94$ provided $D_0 > 11$. A quick calculation also shows that $A_2 = \sqrt{2}$ works
for $D_0 \ge 1$, or $A_2 = 0.956$ works for $D_0 \ge 7$. Now,

$$
\begin{align*}
& \sum_{H/10^{19} < n \le H/D} \chi(n) \sum_{m \le H/n} \Lambda(m) \\
&= \sum_{H/10^{19} < n \le H/D} \chi(n) \sum_{m \le H/n} \Lambda(m) \\
&= H \sum_{H/10^{19} < n \le H/D} \frac{\chi(n)}{n} + \mathcal{O}^* \left( \sum_{H/10^{19} < n \le H/D} A_2 \sqrt{\frac{H}{n}} \right) \\
&= H \sum_{H/10^{19} < n \le H/D} \frac{\chi(n)}{n} + \mathcal{O}^* (2A_2HD^{-1/2}),
\end{align*}
$$

where for the second equality we used Lemma 3.

For the second step, we use Lemma 8 and consider the range $H/A < n \le H/10^{19}$, where $A \ge \exp(40)$ is to be chosen later. That is,

$$
\begin{align}
& \sum_{H/A < n \le H/10^{19}} \chi(n) \sum_{m \le H/n} \Lambda(m) \nonumber \\
&= H \sum_{H/A < n \le H/10^{19}} \frac{\chi(n)}{n} + \mathcal{O}^* \left( 1.93378 \cdot 10^{-8} \sum_{H/A < n \le H/10^{19}} \frac{H}{n} \right) \nonumber \\
&= H \sum_{H/A < n \le H/10^{19}} \frac{\chi(n)}{n} + \mathcal{O}^* (1.93378 \cdot 10^{-8} (1 + \log(A/10^{19}))H), \tag{15}
\end{align}
$$

where for the second equality we used Lemma 4.

For the third step we consider the sum over $n \le H/A$. First, if $H < A$ then there is nothing to add. On the other hand, if $H \ge A$ we use Lemma 6 to get

$$
\sum_{n \le H/A} \chi(n) \sum_{m \le H/n} \Lambda(m) = H \sum_{n \le H/A} \frac{\chi(n)}{n} + \mathcal{O}^* \left( \sum_{n \le H/A} \frac{1.83H}{n \log^2(H/n)} \right). \quad (16)
$$

Since $n \log^2(H/n)$ is increasing when $n \le H/e^2$, we have that

$$
\begin{align*}
\sum_{n \le H/A} \frac{1.83H}{n \log^2(H/n)} &\le \frac{1.83H}{\log^2 H} + H \int_1^{H/A} \frac{1.83dt}{t \log^2(H/t)} \\
&\le \frac{1.83H}{\log^2 H} + 1.83H \left( \frac{1}{\log A} - \frac{1}{\log H} \right) \\
&= 1.83H \left( \frac{1}{\log^2 H} + \frac{1}{\log A} - \frac{1}{\log H} \right).
\end{align*}
$$

Since the above is decreasing in $H$, and $H \ge A$, we can set $A = \exp(574)$ to bound the $\mathcal{O}^*$ terms in (15) and (16) by $1.6 \cdot 10^{-5}H$. $\square$

**Lemma 23** For any $D \ge D_0 \ge 1$

$$
\left| \sum_{m \le H} \frac{\Lambda(m)}{m \log H} f(x_m) - F(1) - \frac{f(1)}{\log H} \right| \le \frac{1.6 \cdot 10^{-5} + 2A_2 D^{-1/2} + (2.04D - 1) V H^{-1}}{\log H},
$$

where $A_2$ is as in Lemma 22.
*Proof* By using the definition of $f$, we get

$$ \sum_{m \le H} \frac{\Lambda(m)}{m \log H} f(x_m) = \sum_{mn \le H} \frac{\chi(n) \Lambda(m)}{H \log H} $$

and we appeal to Lemma 22. This leads to

$$ \sum_{m \le H} \frac{\Lambda(m)}{m \log H} f(x_m) = \sum_{n \le H/D} \frac{\chi(n)}{n \log H} + \mathcal{O}^* \left( \frac{1.6 \cdot 10^{-5} + 2A_2 D^{-1/2} + 1.04 D V H^{-1}}{\log H} \right). $$

Note further that, by Lemma 21 (we need only the upper estimate), we have

$$ F(1) = \sum_{n \le H/D} \frac{\chi(n)}{n \log H} - \frac{f(1)}{\log H} + \mathcal{O}^* \left( \frac{(D-1)V}{H \log H} \right). $$

□

We are now in a position to prove the following crucial lemma. Recall the definitions of $h(1, x)$ and $h(\chi, x)$ from (1), and of $R_\chi(H, V, q)$ from (11).

**Lemma 24** Let $H \ge 10^6$ and $x \ge 1/2$. Then we have

$$ 0 \le \frac{h(1, x) + h(\chi, x)}{\log H} \le 2x. $$

Also, if $H$ also satisfies $H \ge V$,

$$ \frac{h(1, x) + h(\chi, x)}{\log H} \le 2 - F(1) + f(1) - \frac{f(1)}{\log H} + \frac{-1.15 + 3.81 A_2^{2/3} (V/H)^{1/3} - V H^{-1} + R_\chi(H, V, q)}{\log H}, $$

where $A_2$ is as in Lemma 22 when $D$ is taken to be $(\frac{A_2 H}{2.04 V})^{2/3}$ (see (19)).

This is the equivalent of [37, Lemma 2] by Stephens.

*Proof* The first inequality follows by Lemma 11. Concerning the second one, we proceed as follows. Define

$$ S = \sum_{m \le H} \frac{\Lambda(m)}{m \log H} (1 - f(x_m)) - \sum_{m \le H} \frac{\chi(m) \Lambda(m)}{m \log H} (1 - f(x_m)). \quad (17) $$

Since $|\chi(m)|, |f(x_m)| \le 1$, we have $S \ge 0$. Furthermore, on expanding and using the second part of Lemma 17, we find that

$$ S = \sum_{m \le H} \frac{\Lambda(m)}{m \log H} - \sum_{m \le H} \frac{\Lambda(m)}{m \log H} f(x_m) - \frac{h(\chi, 1)}{\log H} + f(1) + \mathcal{O}^* \left( \frac{R_\chi(H, V, q)}{\log H} \right). $$

Now we use Lemma 23. Since $S \ge 0$, this leads to the inequality

$$ \frac{h(\chi, 1)}{\log H} \le \frac{h(1, 1)}{\log H} - F(1) - \frac{f(1)}{\log H} + f(1) + \frac{1.6 \cdot 10^{-5} + 2A_2 D^{-1/2} + (2.04D - 1)VH^{-1} + R_\chi(H, V, q)}{\log H}. \quad (18) $$
We select

$$D = \left( \frac{A_2}{2.04} \frac{H}{V} \right)^{2/3} \qquad (19)$$

so that the expression in (18) involving D is minimised. This then gives

$$\frac{h(\chi, 1)}{\log H} \le \frac{h(1, 1)}{\log H} - F(1) - \frac{f(1)}{\log H} + f(1) + \frac{1.6 \cdot 10^{-5} + 3.81 A_2^{2/3} (V/H)^{1/3} - VH^{-1} + R_{\chi}(H, V, q)}{\log H}$$

Let us extend this inequality to $h(\chi, x)$. We simply write

$$h(\chi, x) = h(\chi, 1) - \sum_{H^x < m \le H} \frac{\chi(m)\Lambda(m)}{m} \\ \le h(\chi, 1) + h(1, 1) - h(1, x),$$

hence the result, since $2h(1, 1)/\log H \le 2 - 2 \times 0.576/\log H$ by Lemma 11 and $1.6 \cdot 10^{-5} - 2 \times 0.576 \le -1.15$. □

## 6 A result in optimization

This section contains a refined version of a result by Stephens: see Theorem 4 in [37]. No further arithmetical material is being introduced. We start with a technical lemma.

**Lemma 25** We have, for $\theta$ fixed and $\theta \in (0, x)$,

$$-4 \int_{\theta}^{x} (x-u) \log u \, du + 2 \int_{x-\theta}^{\theta} u \, du + \int_{\theta}^{x} 2\theta \, du \\ = 2x(x - x \log x - \theta) + (2x - \theta)\theta(1 + 2 \log \theta).$$

*Proof* Notice that $2 \int u \log u \, du = u^2 \log u - (u^2/2)$ and thus

$$4 \int_{\theta}^{x} (x-u) \log u \, du = 4x(x \log x - x - \theta \log \theta + \theta) - 2x^2 \log x + x^2 + 2\theta^2 \log \theta - \theta^2 \\ = 4x(-\theta \log \theta + \theta) + 2x^2 \log x - 3x^2 + 2\theta^2 \log \theta - \theta^2.$$

Next,

$$2 \int_{x-\theta}^{\theta} u \, du + \int_{\theta}^{x} 2\theta \, du = \theta^2 - (x-\theta)^2 + 2\theta(x-\theta) = -x^2 + 4x\theta - 2\theta^2,$$

and thus

$$-4 \int_{\theta}^{x} (x-u) \log u \, du + 2 \int_{x-\theta}^{\theta} u \, du + \int_{\theta}^{x} 2\theta \, du \\ = 4x(\theta \log \theta - \theta) - 2x^2 \log x + 3x^2 - 2\theta^2 \log \theta + \theta^2 - x^2 + 4x\theta - 2\theta^2,$$

whence the lemma follows after some simple algebraic rearrangement. □

**Lemma 26** Let $H > 1$ be a real parameter. Suppose we are given a sequence of non-negative real numbers $(u_m)_{1 \le m \le H}$ and a continuous function $G$ over $[0, 1]$. Assume we have, for every $x \in [0, 1]$, that

$$G(x) \le x, \qquad (H_0)$$
that for some parameters a and $\varepsilon_2$, we have, when $x \ge 1/2$,

$$ (x + a)G(x) \le \sum_{m \le H^x} \frac{u_m}{\log H} G\left(x - \frac{\log m}{\log H}\right) + \varepsilon_2, \qquad (H_1) $$

that

$$ 0 \le \sum_{m \le H^x} \frac{u_m}{\log H} \le 2x \qquad (H_2) $$

and that, for some parameter $\varepsilon_1$ we have, when $x \ge 1/2$,

$$ \sum_{m \le H^x} \frac{u_m}{\log H} \le 2 - G(1) + \varepsilon_1. \qquad (H_3) $$

Then either $G(1) \le 2(1 - 1/\sqrt{e})$ or

$$ 2a\theta \log \theta - 2\theta(1/\sqrt{e} - \theta)(2 + \log \theta) + \varepsilon_1 + \varepsilon_2 \ge 0, $$

where $\theta = 1 - G(1)/2$ belongs to $[1/2, 1/\sqrt{e}]$.

**Proof Set**

$$ \theta = 1 - G(1)/2, \quad \varphi(y) = 2(y - y \log y - \theta). $$

The function $\varphi$ is increasing (its derivative is $-2 \log y$) on $(0, 1]$ and takes the positive value $-2\theta \log \theta$ at $y = \theta$. Note that $\theta \ge 1/2$ since $G(1) \le 1$, and that when $\theta \ge 1/\sqrt{e}$, our result is immediate. Let us assume that $\theta < 1/\sqrt{e}$ so that $\theta + 2\theta \log \theta < 0$. Assume that, when $\theta \le y \le Z$, we have $G(y) \le \varphi(y)$. This latter inequality translates into

$$ G(1) - G(y) \ge 2(1 - y + y \log y). $$

Our initial remark is that $\theta$ is such a number.

**Proof** Indeed, if it where not, we would have

$$ G(1) = G(\theta) + G(1) - G(\theta) \le \theta + 2(1 - \theta + \theta \log \theta) $$

since $G(x) \le x$. We notice next that $G(1) = 2 - 2\theta$, so that the above inequality can be rewritten as $G(1) \le G(1) + \theta + 2\theta \log \theta < G(1)$ by the inequality assumed for $\theta$, leading to a contradiction. □

We define for this proof

$$ g(y) = \sum_{m \le H^y} \frac{u_m}{\log H}. \qquad (20) $$

We find that, for $Z \ge x \ge \theta$,

$$ \sum_{m \le H^x} \frac{u_m}{\log H} G\left(x - \frac{\log m}{\log H}\right) \le \sum_{m \le H^{x-\theta}} \frac{u_m}{\log H} \varphi\left(x - \frac{\log m}{\log H}\right) \\ + \sum_{H^{x-\theta} < m \le H^x} \frac{u_m}{\log H} \left(x - \frac{\log m}{\log H}\right) $$
by bounding above $G(y)$ by $y$ by $(H_0)$ when $y \le \theta$. We study separately the two right-hand side sums, say $S_1$ and $S_2$. First we note that, on recalling the definition (20) of $g$:

$$ 
\begin{aligned}
S_1 &= \sum_{m \le H^{x-\theta}} \frac{u_m}{\log H} \int_{\theta}^{x-\frac{\log m}{\log H}} \varphi'(u) du + g(x-\theta)\varphi(\theta) \\
&= g(x-\theta)\varphi(\theta) - 2 \int_{\theta}^{x} g(x-u) \log u \, du
\end{aligned}
$$

while

$$ S_2 = \sum_{H^{x-\theta} < m \le H^x} \frac{u_m}{\log H} \int_{\log \frac{m}{\log H}}^{x} du = \int_{x-\theta}^{x} (g(u) - g(x-\theta)) du $$

and this amounts to

$$ S_1 + S_2 = g(x - \theta)(\varphi(\theta) - \theta) - 2 \int_{\theta}^{x} g(x - u) \log u \, du + \int_{x-\theta}^{x} g(u) \, du. $$

In the first integral, we bound above $g(x-u)$ by $2(x-u)$ by $(H_2)$. We split the second integral at $u = \theta$; between $x-\theta$ and $\theta$, we bound above $g(u)$ again by $2u$ while in the later range, we bound above $g(u)$ by $2\theta + \varepsilon_1$ by $(H-3)$ (valid since $u \ge \theta \ge 1/2$). We infer in this manner that

$$ 
\begin{aligned}
S_1 + S_2 \le & g(x - \theta)(\varphi(\theta) - \theta) \\
& -4 \int_{\theta}^{x} (x - u) \log u \, du + 2 \int_{x-\theta}^{\theta} u \, du + \int_{\theta}^{x} (2\theta + \varepsilon_1) \, du.
\end{aligned}
$$

By Lemma 25 and noticing that $\varphi(\theta) - \theta = -\theta(1+2\log\theta)$, we get (again bounding above $g(x-u)$ by $2(x-u)$ by $(H_2)$)

$$ 
\begin{aligned}
S_1 + S_2 \le & x\varphi(x) + (g(x - \theta) + \theta - 2x)(\varphi(\theta) - \theta) + \varepsilon_1 \\
& \le x\varphi(x) + \theta^2(1 + 2\log\theta) + \varepsilon_1.
\end{aligned}
$$

By $(H_1)$ and the above, we infer that

$$ (x + a)G(x) \le x\varphi(x) + \theta^2(1 + 2\log\theta) + \varepsilon_1 + \varepsilon_2. $$

We also find that, when $\theta \le 1/\sqrt{e}$, we have

$$ 0 - \theta^2(1 + 2\log\theta) = \int_{\theta}^{1/\sqrt{e}} 2u(2 + \log u) \, du \ge 2\theta(1/\sqrt{e} - \theta)(2 + \log\theta). $$

Hence, we get

$$ (x + a)G(x) \le (x + a)\varphi(x) - a\varphi(x) - 2\theta(1/\sqrt{e} - \theta)(2 + \log\theta) + \varepsilon_1 + \varepsilon_2. $$

We can now use $\varphi(x) \ge \varphi(\theta) = -\theta \log \theta$, getting

$$ (x + a)G(x) \le (x + a)\varphi(x) + 2a\theta \log \theta - 2\theta(1/\sqrt{e} - \theta)(2 + \log \theta) + \varepsilon_1 + \varepsilon_2. $$

When $2a\theta \log \theta - 2\theta(1/\sqrt{e} - \theta)(2 + \log \theta) + \varepsilon_1 + \varepsilon_2 < 0$, we would have $G(x) < \varphi(x)$. However the function $G$ is continuous and $G(1) = \varphi(1)$, there exists an $x_0$ between $\theta$ and 1 for which $G(x_0) = \varphi(x_0)$ and $G(x) \le \varphi(x)$ for $x$ between $\theta$ and $x_0$. The above inequality then leads to a contradiction. Hence we have

$$ 2a\theta \log \theta - 2\theta(1/\sqrt{e} - \theta)(2 + \log \theta) + \varepsilon_1 + \varepsilon_2 \ge 0. $$
## 7 Proof of Theorems 1 and 2

We use Lemma 26 with $G(x) = F(x)$ and $u_m = (1 + \chi(m))\Lambda(m)/m$.

### Initial upper bound

Lemma 16 gives us

$$L(1, \chi) \le F(1) \log H + \frac{V}{H}.$$

### Hypotheses (H₀), (H₁), (H₂) and (H₃)

Hypothesis (H₀) is granted by the bound $|f(u)| \le 1$. By Lemma 20 we can then set

$$a \le \frac{\gamma - 1}{\log H'}, \quad \varepsilon_2 \le \frac{1.411}{\log^2 H'}$$

and this gives us Hypothesis (H₁).

Lemma 10 is enough to grant Hypothesis (H₂). Finally, by Lemma 24 and provided that $H \ge \max(V, 10^6)$, Hypothesis (H₃) is satisfied with

$$\varepsilon_1 \le f(1) - \frac{f(1)}{\log H} + \frac{-1.15 + 3.81A_2^{2/3}(V/H)^{1/3} - VH^{-1} + R_\chi(H, V, q)}{\log H}.$$

We will further majorize $f(1)$ by $V/2$ when $\chi$ is even and by $V/H$ when $\chi$ is odd.

### Using Lemma 26

So we infer that

$$L(1, \chi) \le 2(1 - \theta) \log H + \frac{V}{H} \quad (21)$$

where $\theta \in [1/2, 1/\sqrt{e}]$ satisfies

$$2a\theta \log \theta - 2\theta(1/\sqrt{e} - \theta)(2 + \log \theta) + \varepsilon_1 + \varepsilon_2 \ge 0.$$

Since $a < 0$, if this inequality is satisfied for some $H_0 > 1$ then it remains true for $H \ge H_0$.

We select $H = BV$, for some parameter $B$, and bound $|f(1)|$ by $V/H$. Therefore, if $q \ge q_0$, for some $q_0 > 1$ which we shall specify later, we have that

$$D \ge \left( \frac{A_2 B}{2.04} \right)^{2/3} = D_0.$$

So, here are possible choices:

$$B \ge \sqrt{2}/2.04 \rightarrow A_2 = \sqrt{2},$$

$$B \ge 39.6 \rightarrow A_2 = 0.956,$$

$$B \ge 79.5 \rightarrow A_2 = 0.94.$$

### Setting the numerics

We can now prove Theorems 1 and 2. We use the expression for $V$ given in Lemma 13.

We take $H = BV$ which we assume to be $\ge 10^6$, we also assume that $q \ge q_0$ so that $V \ge V_0$. Given a choice of $B$, we select

$$a = \frac{\gamma - 1}{\log(BV_0)},$$

$$\varepsilon_2 = \frac{1.411}{\log(BV_0)^2},$$

$$\varepsilon_1 = \frac{\delta(\chi)}{B} - \frac{\delta(\chi)}{B \log(BV_0)} + \frac{-1.15 + 3.81A_2^{2/3}B^{-1/3} - B^{-1} + R_\chi(BV_0, V_0, q_0)}{\log(BV_0)}.$$
where $\delta(\chi) = (3 - \chi(-1))/4$. We then compute the smallest solution $\theta^*$ to (21) and infer that

$$ \frac{L(1, \chi)}{\log q} \le 2(1 - \theta^*) \frac{\log B + \log V_0}{\log q_0} + \frac{1}{B \log q_0}. $$

**Result for $\chi$ even and primitive:** We select $B = 51$, and infer that $L(1, \chi) < \frac{1}{2} \log q$ when $q \ge 7 \cdot 10^{22}$. But this is already known for all $q$'s by [32]. Even more is true if we combine the theorem of Saad Eddin in [36] together with [33, Corollary 1].

We select $B = 80$, and infer that $L(1, \chi) < \frac{9}{20} \log q$ when $q \ge 2 \cdot 10^{49}$.

**Result for $\chi$ odd and primitive:** We select $B = 90$, and infer that $L(1, \chi) < \frac{1}{2} \log q$ when $q \ge 2 \cdot 10^{23}$.

We select $B = 145$, and infer that $L(1, \chi) < \frac{9}{20} \log q$ when $q \ge 5 \cdot 10^{50}$.

## Acknowledgements

We are grateful to Enrique Treviño for some preliminary insights on this topic. We thank Tanmay Khale for discussions on [11] and Stéphane Louboutin for his suggestions leading to our Lemma 4. Finally, we are very grateful to the referees for thoroughly reading our manuscript and for many useful suggestions for improvements.

**Funding** Open Access funding enabled and organized by CAUL and its Member Institutions.

**Data availability** The computational code for all calculations done in this paper is available upon request to the authors.

## Author details

¹School of Science, UNSW Canberra at ADFA, Campbell, ACT, Australia, ²CNRS, Aix Marseille Université, I2M, Marseille, France.

Received: 24 March 2023 Accepted: 5 September 2023

Published online: 03 October 2023

## References

1. Booker, A.R.: Quadratic class numbers and character sums. Math. Comput. **75**(255), 1481–1492 (2006)

2. Brent, R.P., Platt, D.J., Trudgian, T.S.: The mean square of the error term in the prime number theorem. J. Number Theory **238**, 740–762 (2022)

3. Broadbent, S., Kadiri, H., Lumley, A., Ng, N., Wilk, K.: sharper bounds for the Chebyshev function $\theta(x)$. Math. Comput. **90**(331), 2281–2315 (2021)

4. Burgess, D.A.: On character sums and L-series. Proc. Lond. Math. Soc. **3**(12), 193–206 (1962)

5. Bûthe, J.: An analytic method for bounding $\psi(x)$. Math. Comput. **87**(312), 1991–2009 (2018)

6. Chirre, A., Hagen, M.V., Simonič, A.: Conditional estimates for the logarithmic derivative of Dirichlet L-functions. Preprint available at arXiv:2206.00819. https://doi.org/10.1016/j.indag.2023.07.005

7. Davenport, H.: Multiplicative Number Theory. Graduate Texts in Mathematics, Springer, New York (2000)

8. Francis, F.J.: An investigation into explicit versions of Burgess' bound. J. Number Theory **228**, 87–107 (2021)

9. Frolenkov, D.A., Soundararajan, K.: A generalization of the Pólya–Vinogradov inequality. Ramanujan J. **31**(3), 271–279 (2013)

10. Hua, L-K.: On the least solution of Pell's equation. Bull. Am. Math. Soc. **48**, 731–735 (1942)

11. Jain-Sharma, N., Khale, T., Liu, M.: Explicit Burgess bound for composite moduli. Int. J. Number Theory **17**(10), 2207–2219 (2021)

12. Johnston, D.R.: Improving bounds on prime counting functions by partial verification of the Riemann hypothesis. Ramanujan J. **59**(4), 1307–1321 (2022)

13. Johnston, D.R., Yang, A.: Some explicit estimates for the error term in the prime number theorem. Preprint available at arXiv:2204.01980

14. Kadiri, H.: Une région explicite sans zéros pour la fonction $\zeta$ de Riemann. Acta Arith. **117**(4), 303–339 (2005)

15. Lamzouri, Y., Li, X., Soundararajan, K.: Conditional bounds for the least quadratic non-residue and related problems. Math. Comput. **84**(295), 2391–2412 (2015)

16. Languasco, A.: Numerical estimates on the Landau-Siegel zero and other related quantities. J. Number Theory **251**, 185–209 (2023)

17. Languasco, A., Trudgian, T.S.: Uniform effective estimates for $|L(1, \chi)|$. J. Number Theory **236**, 245–260 (2022)

18. Lapkova, K.: Explicit upper bound for an average number of divisors of quadratic polynomials. Arch. Math. (Basel) **106**(3), 247–256 (2016)

19. Lapkova, K.: Correction to: explicit upper bound for the average number of divisors of irreducible quadratic polynomials [MR3829216]. Monatsh. Math. **186**(4), 675–678 (2018)

20. Levin, M., Pomerance, C., Soundararajan, K.: Fixed points for discrete logarithms. In Algorithmic Number Theory, volume 6197 of Lecture Notes in Comput. Sci., pp. 6–15. Springer, Berlin (2010)

21. Littlewood, J.E.: On the class-number of the corpus $P(\sqrt{k})$. Proc. Lond. Math. Soc. **27**(5), 358–372 (1928)

22. Louboutin, S.: Majorations explicites de $|L(1, \chi)|$. Ill. C. R. Acad. Sci. Paris Sér. I Math **332**(2), 95–98 (2001)
23. Louboutin, S.: Explicit upper bounds for $|L(1, \chi)|$ for primitive even Dirichlet characters. Acta Arith. **101**(1), 1–18 (2002)

24. McGown, K.J.: Norm-Euclidean cyclic fields of prime degree. Int. J. Number Theory **8**(1), 227–254 (2012)

25. Mossinghoff, M.J., Starichkova, V.V., Trudgian, T.S.: Explicit lower bounds on $|L(1, \chi)|$. J. Number Theory **240**, 641–655 (2022)

26. Mossinghoff, M.J., Trudgian, T.S.: Nonnegative trigonometric polynomials and a zero-free region for the Riemann zeta-function. J. Number Theory **157**, 329–349 (2015)

27. Mossinghoff, M.J., Trudgian, T.S., Yang, A.: Explicit zero-free regions for the Riemann zeta-function. Preprint available at arXiv:2212.06867

28. Pintz, J.: Corrigendum: "Elementary methods in the theory of $L$-functions, VII. Upper bound for $L(1, \chi)$". Acta Arith. **33**(3), 293–295 (1977)

29. Pintz, J.: Elementary methods in the theory of $L$-functions, VIII. Real zeros of real $L$-functions. Acta Arith **33**(1), 89–98 (1977)

30. Platt, D.J., Saad Eddin, S.: Explicit upper bounds for $|L(1, \chi)|$ when $\chi(3) = 0$. Colloq. Math. **133**(1), 23–34 (2013)

31. Platt, D.J., Trudgian, T.S.: The error term in the prime number theorem. Math. Comput. **90**(328), 871–881 (2021)

32. Ramaré, O.: Approximate formulae for $L(1, \chi)$. Acta Arith. **100**, 245–266 (2001)

33. Ramaré, O.: Approximate formulae for $L(1, \chi)$. II. Acta Arith. **112**, 141–149 (2004)

34. Ramaré, O.: Explicit estimates for the summatory function of $\Lambda(n)/n$ from the one of $\Lambda(n)$. Acta Arith. **159**(2), 113–122 (2013)

35. Rosser, J.B., Schoenfeld, L.: Approximate formulas for some functions of prime numbers. III. J. Math. **6**, 64–94 (1962)

36. Saad Eddin, S.: An explicit upper bound for $|L(1, \chi)|$ when $\chi(2) = 1$ and $\chi$ is even. Int. J. Number Theory **12**(8), 2299–2315 (2016)

37. Stephens, P.J.: Optimizing the size of $L(1, \chi)$. Proc. Lond. Math. Soc. III. Ser **24**, 1–14 (1972)

38. Treviño, E.: The Burgess inequality and the least $k$th power non-residue. Int. J. Number Theory **11**(5), 1653–1678 (2015)

**Publisher's Note**

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.