# Legendre-signed partition numbers

Taylor Daniels  Dept. of Mathematics, Purdue Univ., 150 N University St, W
Lafayette, IN 47907

###### Abstract.

Let $f:\mathbb{N}\to\\{0,\pm 1\\}$, for $n\in\mathbb{N}$ let $\Pi[n]$ be the
set of partitions of $n$, and for all partitions
$\pi=(a_{1},a_{2},\ldots,a_{k})\in\Pi[n]$ let

$f(\pi):=f(a_{1})f(a_{2})\cdots f(a_{k}).$

With this we define the $f$-_signed partition numbers_

$\mathfrak{p}(n,f)=\sum_{\pi\in\Pi[n]}f(\pi).$

In this paper, for odd primes $p$ we derive asymptotic formulae for
$\mathfrak{p}(n,\chi_{p})$ as $n\to\infty$, where $\chi_{p}(n)$ is the
Legendre symbol $(\frac{n}{p})$ associated $p$. A similar asymptotic formula
for $\mathfrak{p}(n,\chi_{2})$ is also established, where $\chi_{2}(n)$ is the
Kronecker symbol $(\frac{n}{2})$. Special attention is paid to the sequence
$(\mathfrak{p}(n,\chi_{5}))_{\mathbb{N}}$, and a formula for
$\mathfrak{p}(n,\chi_{5})$ supporting the recent discovery that
$\mathfrak{p}(10j+2,\chi_{5})=0$ for all $j\geq 0$ is discussed. Our main
results imply, as a corollary, that the periodic vanishing displayed by
$(\mathfrak{p}(n,\chi_{5}))_{\mathbb{N}}$ does not occur in any sequence
$(\mathfrak{p}(n,\chi_{p}))_{\mathbb{N}}$ for odd primes $p\neq 5$ such that
$p\not\equiv 1\,\,(\mathrm{mod}\,8)$.

In addition, work of Montgomery and Vaughan on exponential sums with
multiplicative coefficients is applied to establish an upper bound on certain
doubly infinite series involving multiplicative functions $f$ with $|f|\leq
1$.

###### 2020 Mathematics Subject Classification:

Primary: 11P82, 11P55.
_Keywords and phrases_ : partitions, Legendre symbol, multiplicative
functions.

##  1\. Introduction

Let $f:\mathbb{N}\to\\{0,\pm 1\\}$, and for $n\in\mathbb{N}$ and any partition
$\pi=(a_{1},a_{2},\ldots,a_{k})$ of $n$ let

$f(\pi):=f(a_{1})f(a_{2})\cdots f(a_{k}).$

With this we define the $f$-_signed partition numbers_

$\mathfrak{p}(n,f)=\sum_{\pi\in\Pi[n]}f(\pi),$

where $\Pi[n]$ is the set of (ordinary) partitions of $n$. The integers
$\mathfrak{p}(n,f)$ generalize several classical partition number quantities:
With the constant function $1$ the quantities $\mathfrak{p}(n,1)$ are the
_ordinary partition numbers_ , and with $f=\mathbf{1}_{A}$ for some
$A\subset\mathbb{N}$ the quantities $\mathfrak{p}(n,\mathbf{1}_{A})$ are the
$A$-_restricted partition numbers_. The sequences
$(\mathfrak{p}(n,f))_{\mathbb{N}}$ using the Möbius-$\mu$ and
Liouville-$\lambda$ functions for $f$ are examined in [daniels2023mobius,
daniels2023biasymp].

For odd primes $p$ let $\chi=\chi_{p}$ denote the Legendre symbol
$(\frac{n}{p})$ for $p$, i.e., let

$\chi_{p}(n)=\begin{cases}+1&\text{$n$ is a quadratic residue (mod $p$),}\\\
-1&\text{$n$ is a quadratic nonresidue (mod $p$),}\\\ 0&p\mid n.\end{cases}$

In addition let $\chi_{2}(n)$ be the Kronecker symbol $(\tfrac{n}{2})$, i.e.,
let

$\chi_{2}(n)=\begin{cases}+1&n\equiv\pm 1\,\,(\mathrm{mod}\,\,8),\\\
-1&n\equiv\pm 3\,\,(\mathrm{mod}\,\,8),\\\ 0&\text{otherwise}.\end{cases}$
(1.1)

We note that in what follows, the letter $p$ is reserved for odd primes, and
$\chi=\chi_{p}$ and $\chi_{2}$ always indicate the Legendre and Kronecker
symbols, respectively.

To serve as a benchmark for our formulae, we recall Hardy and Ramanujan’s
famous result [hardy1918asymptotic] stating that

$\mathfrak{p}(n,1)=(4\sqrt{3})^{-1}n^{-1}\exp(\kappa\sqrt{n})\mathopen{}\mathclose{{}\left[1+O(n^{-1/5})}\right],$

where, for the remainder of this section, we let

$\kappa:=\pi\sqrt{2/3}.$

This immediately implies the corollary relation

$\log\mathfrak{p}(n,1)\sim\kappa\sqrt{n},$

where $a_{n}\sim b_{n}$ indicates that $\lim_{n\to\infty}a_{n}/b_{n}=1$. To
avoid technicalities due to small values of $n$ for which
$\mathfrak{p}(n,\chi_{p})=0$, in our statements below we let

$\log_{0}x:=\max\\{0,\log x\\}.$

######  Theorem 1.1.

Suppose that $p\neq 5$ and $p\not\equiv 1\,\,(\mathrm{mod}\,\,8)$. As
$n\to\infty$ one has

$\log_{0}{\mathfrak{p}(n,\chi_{p})}\sim\tfrac{1}{2}\kappa\sqrt{(1-\tfrac{1}{p})n}.$
(1.2)

The sequences $(\mathfrak{p}(n,\chi_{p}))_{\mathbb{N}}$ associated to primes
$p\equiv 1\,\,(\mathrm{mod}\,\,8)$ do exhibit stable behavior like the one
shown in relation (1.2) for even $n$, but when $n$ is odd there may be large
cancellations in the main asymptotic terms of $\mathfrak{p}(n,\chi_{p})$. As
such, we presently only demonstrate a crude bound for
$\mathfrak{p}(2m+1,\chi_{p})$ as seen in the following theorem.

######  Theorem 1.2.

If $p\equiv 1\,\,(\mathrm{mod}\,\,8)$, then for even $n=2m$ one has

$\log_{0}{\mathfrak{p}(2m,\chi_{p})}\sim\tfrac{1}{2}\kappa\sqrt{(1-\tfrac{1}{p})(2m)},$

and for odd $n=2m+1$ one has

$\mathfrak{p}(2m+1,\chi_{p})=O\Big{(}m^{-19/20}\exp\mathopen{}\mathclose{{}\left(\tfrac{1}{2}\kappa\sqrt{(1-\tfrac{1}{p})(2m+1)}\,}\right)\\!\Big{)}.$

Theorems 1.1 and 1.2 are corollaries of our main results which we now discuss.
Ultimately, the two most salient properties of the prime $p$ that determine
the asymptotic behavior of $\mathfrak{p}(n,\chi_{p})$ are: i) the residue of
$p$ modulo $4$; and ii) whether or not $2$ is a quadratic residue modulo $p$,
i.e., the value of $\chi_{p}(2)$. Thus, we separate odd primes by their
residues modulo $8$.

In stating our formulae it is convenient to let

$L_{1}(\chi_{p})=L(1,\chi_{p})\qquad\text{and}\qquad
L_{1}^{\prime}(\chi_{p})=L^{\prime}(1,\chi_{p}),$

where $L(s,\chi_{p})$ is Dirichlet $L$-function for $\chi_{p}$. Many of our
formulae involve complicated constants, and hence we wish to convey to the
reader that the “structures” of the formulae are more important than the exact
values of the corresponding constants therein.

######  Theorem 1.3.

Let $p\neq 5$ and suppose that $p\equiv 1\,\,(\mathrm{mod}\,\,4)$. As
$n\to\infty$ one has

$\mathfrak{p}(n,\chi_{p})=\mathfrak{a}_{p}n^{-3/4}\exp\mathopen{}\mathclose{{}\left(\tfrac{1}{2}\kappa\sqrt{(1-\tfrac{1}{p})n}\,}\right)\mathopen{}\mathclose{{}\left[1+(-1)^{n}\mathfrak{b}_{p}+O(n^{-1/5})}\right],$

where

$\kappa=\pi\sqrt{2/3},\qquad\mathfrak{a}_{p}=2^{-7/4}3^{-1/4}(p^{-1}-p^{-2})^{1/4}\exp(\tfrac{1}{4}\sqrt{p}L_{1}(\chi_{p}))$

and

$\mathfrak{b}_{p}=\begin{cases}1&p\equiv 1\,\,(\mathrm{mod}\,\,8),\\\
\exp(-\sqrt{p}L_{1}(\chi_{p}))&\text{$p\equiv 5\,\,(\mathrm{mod}\,\,8)$ and
$p\neq 5$.}\end{cases}$

As detailed in the appendix, one has $L_{1}(\chi_{p})>0$ for all $p$ (and even
$L_{1}(\chi_{2})>0$). We therefore have the following corollary which provides
a “middle ground” of complexity between Theorems 1.1 and 1.3. We recall that
the relation $a_{n}\asymp b_{n}$ holds if

$a_{n}=O(b_{n})\quad\text{and}\quad b_{n}=O(a_{n})\quad\text{as
$n\to\infty$.}$

######  Corollary 1.4.

Suppose that $p\equiv 5\,\,(\mathrm{mod}\,\,8)$ and $p\neq 5$. As
$n\to\infty$, one has

$\mathfrak{p}(n,\chi_{p})\asymp
n^{-3/4}\exp\mathopen{}\mathclose{{}\left(\tfrac{1}{2}\kappa\sqrt{(1-\tfrac{1}{p})n}\,}\right).$

Although the asymptotic formulae for $\mathfrak{p}(n,\chi_{p})$ with $p\equiv
3\,\,(\mathrm{mod}\,\,4)$ have the same overall structure as those for
$p\equiv 1\,\,(\mathrm{mod}\,\,4)$, in these cases that the constants
$\mathfrak{a}_{p}$ and $\mathfrak{b}_{p}$ have significantly more complicated
formulae.

######  Theorem 1.5.

Suppose that $p\equiv 3\,\,(\mathrm{mod}\,\,4)$, let $\kappa=\pi\sqrt{2/3}$,
let $\chi=\chi_{p}$, and let

$\mathfrak{a}_{p}=2^{-7/4}3^{-1/4}(p^{-1}-p^{-2})^{1/4}\exp\\!\bigg{(}\frac{\sqrt{p}L_{1}(\chi)}{2\pi}\bigg{(}\gamma+\log\\!\bigg{(}\frac{8\sqrt{6}}{\sqrt{p-1}}\bigg{)}-\frac{L_{1}^{\prime}(\chi)}{L_{1}(\chi)}\bigg{)}\\!\bigg{)},$
(1.3)

where $\gamma$ is the Euler-Mascheroni constant. If $p\equiv
3\,\,(\mathrm{mod}\,\,8)$, then as $n\to\infty$ one has

$\mathfrak{p}(n,\chi_{p})=\mathfrak{a}_{p}n^{\sqrt{p}L_{1}(\chi)/(4\pi)-3/4}\exp\mathopen{}\mathclose{{}\left(\tfrac{1}{2}\kappa\sqrt{(1-\tfrac{1}{p})n}\,}\right)\mathopen{}\mathclose{{}\left[1+(-1)^{n}\mathfrak{b}_{p}n^{-\sqrt{p}L_{1}(\chi)/\pi}+O(n^{-1/5})}\right],$

where

$\mathfrak{b}_{p}=\exp\mathopen{}\mathclose{{}\left[\frac{\sqrt{p}L_{1}(\chi)}{\pi}\mathopen{}\mathclose{{}\left(2\frac{L_{1}^{\prime}(\chi)}{L_{1}(\chi_{p})}+\log\mathopen{}\mathclose{{}\left(\frac{p(p-1)}{192}}\right)-2\gamma}\right)}\right].$

If $p\equiv 7\,\,(\mathrm{mod}\,\,8)$, then as $n\to\infty$ one has

$\mathfrak{p}(n,\chi_{p})=\mathfrak{a}_{p}n^{\sqrt{p}L_{1}(\chi)/(4\pi)-3/4}\exp\mathopen{}\mathclose{{}\left(\tfrac{1}{2}\kappa\sqrt{(1-\tfrac{1}{p})n}\,}\right)\mathopen{}\mathclose{{}\left[1+(-1)^{n}\mathfrak{b}_{p}+O(n^{-1/5})}\right],$

where

$\mathfrak{b}_{p}=2^{-\sqrt{p}L_{1}(\chi)/\pi}.$

Again because $L_{1}(\chi_{p})>0$ for all $p$ we have the following analogue
of Corollary 1.4.

######  Corollary 1.6.

If $p\equiv 7\,\,(\mathrm{mod}\,\,8)$, then as $n\to\infty$ one has

$\mathfrak{p}(n,\chi_{p})\asymp
n^{\sqrt{p}L_{1}(\chi)/(4\pi)-3/4}\exp\mathopen{}\mathclose{{}\left(\tfrac{1}{2}\kappa\sqrt{(1-\tfrac{1}{p})n}\,}\right).$

If $p\equiv 3\,\,(\mathrm{mod}\,\,8)$, then as $n\to\infty$ one has the
stronger relation

$\mathfrak{p}(n,\chi_{p})\sim\mathfrak{a}_{p}n^{\sqrt{p}L_{1}(\chi)/(4\pi)-3/4}\exp\mathopen{}\mathclose{{}\left(\tfrac{1}{2}\kappa\sqrt{(1-\tfrac{1}{p})n}\,}\right),$

where $\mathfrak{a}_{p}$ is again given by (1.3).

Given the appearance of the term $\sqrt{p}L_{1}(\chi)/(4\pi)-3/4$ in the
exponents of $n$ in Theorem 1.5, we pause to consider the potential size of
this term. Siegel’s theorem (see, e.g., [montgomery2007multiplicative]*Thm.
11.14) states that: For each $\varepsilon>0$ there exists a constant
$C(\varepsilon)>0$ such that if $\psi$ is a quadratic character modulo $q$,
then

$L_{1}(\psi)>C(\varepsilon)q^{-\varepsilon}.$

Although it is well-known that the constant $C(\varepsilon)$ above is
ineffective, Siegel’s theorem implies that for any $\varepsilon>0$ we have

$\sqrt{p}L_{1}(\chi_{p})/(4\pi)-3/4\asymp
p^{1/2-\varepsilon}\qquad(p\to\infty).$

As such, the terms $n^{\sqrt{p}L_{1}(\chi_{p})/(4\pi)-3/4}$ in Theorem 1.5 and
Corollary 1.6 may have arbitrarily large exponents as the prime $p$ increases.

###  1.1. The special cases of $\mathfrak{p}(n,\chi_{5})$ and
$\mathfrak{p}(n,\chi_{2})$

Examining Theorems 1.3 and 1.5, one sees that the formulae for
$\mathfrak{p}(n,\chi_{p})$ therein all contain a factor of the form

$1+(-1)^{n}\mathfrak{b}_{p}n^{-\delta}+O(n^{-1/5})\qquad(\delta\geq 0).$ (1.4)

In essence, the sequence $(\mathfrak{p}(n,\chi_{5}))_{\mathbb{N}}$ behaves so
differently than the other $(\mathfrak{p}(n,\chi_{p}))_{\mathbb{N}}$ because
the factor in the formula for $\mathfrak{p}(n,\chi_{5})$ which corresponds to
(1.4) includes an extra cosine term. We remark that since $p$ is now
explicitly set to be $5$, the constants $\mathfrak{a}_{p}$ and
$\mathfrak{b}_{p}$ (now $\mathfrak{a}_{5}$ and $\mathfrak{b}_{5}$) of Theorem
1.3 may be explicitly computed.

######  Theorem 1.7.

As $n\to\infty$ one has

$\mathfrak{p}(n,\chi_{5})=\mathfrak{a}_{5}n^{-3/4}\exp\\!\Big{(}\tfrac{1}{2}\kappa\sqrt{\tfrac{4}{5}n}\,\Big{)}\mathopen{}\mathclose{{}\left[1+(-1)^{n}\mathfrak{b}_{5}+\mathfrak{d}_{5}\cos\mathopen{}\mathclose{{}\left(\tfrac{2\pi}{5}n-\tfrac{\pi}{10}}\right)+O(n^{-1/5})}\right],$
(1.5)

where

$\kappa=\pi\sqrt{\tfrac{2}{3}},\quad\mathfrak{a}_{5}=\bigg{(}\frac{3+\sqrt{5}}{960}\bigg{)}^{1/4},\quad\mathfrak{b}_{5}=\frac{3-\sqrt{5}}{2},\quad\text{and}\quad\mathfrak{d}_{5}=\sqrt{2(5-\sqrt{5})}.$

Ignoring the error term $O(n^{-1/5})$ in formula (1.5), we see that the
behavior of $\mathfrak{p}(n,\chi_{5})$ is essentially dictated by two core
parts, namely the exponential term

$\mathfrak{a}_{5}n^{-3/4}\exp\\!\Big{(}\tfrac{1}{2}\kappa\sqrt{\tfrac{4}{5}n}\,\Big{)}$

and the $10$-periodic “signed” term

$\mathfrak{S}(n):=1+(-1)^{n}\bigg{(}\frac{3-\sqrt{5}}{2}\bigg{)}+\sqrt{2(5-\sqrt{5})}\,\cos\mathopen{}\mathclose{{}\left(\tfrac{2\pi}{5}n-\tfrac{\pi}{10}}\right).$

Computing the values of $\mathfrak{S}(n)$ for $1\leq n\leq 10$, it is
surprising to find that

$\mathfrak{S}(2)=0\qquad\text{and}\qquad\mathfrak{S}(n)\neq 0\quad\text{for
$1\leq n\leq 10$ with $n\neq 2$}.$

Indeed, since

$\cos\mathopen{}\mathclose{{}\left(\frac{7\pi}{10}}\right)=-\frac{1}{2}\sqrt{\frac{5-\sqrt{5}}{2}},$

when $n=2$ we have

$\mathfrak{S}(2)=\frac{5-\sqrt{5}}{2}-\frac{\sqrt{(5-\sqrt{5})^{2}}}{2}=0.$

Although formula (1.5) is not an exact formula for $\mathfrak{p}(n,\chi_{5})$,
the fact that $\mathfrak{S}(10j+2)=0$ for $j\geq 0$ provides a heuristic
explanation for the following surprising result.

######  Theorem 1.8 ([daniels2024vanishing]*Thm. 1.1).

One has $\mathfrak{p}(10j+2,\chi_{5})=0$ for all $j\geq 0$.

We now consider $\mathfrak{p}(n,\chi_{2})$, recalling that

$\chi_{2}(n)=\begin{cases}1&n\equiv\pm 1\,\,(\mathrm{mod}\,\,8),\\\
-1&n\equiv\pm 3\,\,(\mathrm{mod}\,\,8),\\\ 0&\text{otherwise}.\end{cases}$

Like our formula for $\mathfrak{p}(n,\chi_{5})$, our formula
$\mathfrak{p}(n,\chi_{2})$ is unique among those for other
$\mathfrak{p}(n,\chi_{p})$. Specifically, the dominant asymptotic term for
$\mathfrak{p}(n,\chi_{2})$ is a single 8-periodic cosine term rather than the
common terms such as $1+(-1)^{n}\mathfrak{b}_{p}$ (or similar quantities).

######  Theorem 1.9.

As $n\to\infty$, one has

$\mathfrak{p}(n,\chi_{2})=\mathfrak{a}_{8}n^{-3/4}\exp\\!\Big{(}\tfrac{1}{2}\kappa\sqrt{\tfrac{11}{16}n}\,\Big{)}\mathfrak{S}_{2}(n),$

where

$\mathfrak{S}_{2}(n)=\cos\mathopen{}\mathclose{{}\left(\frac{2\pi
n}{8}-\frac{3\pi}{16}}\right)+\mathfrak{b}_{8}\exp\\!\Big{(}\\!\\!-\\!\tfrac{1}{2}\kappa\sqrt{\tfrac{1}{2}n}\Big{(}\sqrt{\tfrac{11}{8}}-1\Big{)}\\!\Big{)}\mathopen{}\mathclose{{}\left[1+\frac{(-1)^{n}}{1+\sqrt{2}}}\right],$
(1.6)

and

$\kappa=\pi\sqrt{\tfrac{2}{3}},\quad\mathfrak{a}_{2}=\mathopen{}\mathclose{{}\left(\frac{11}{2^{7}3}}\right)^{1/4},\quad\text{and}\quad\mathfrak{b}_{2}=\sqrt{\frac{1+\sqrt{2}}{2\sqrt{11}}}.$

Motivated by Theorem 1.8, we say that a sequence $(a_{n})_{\mathbb{N}}$
_vanishes on some arithmetic progression_ if $a_{mj+r}=0$ for some
$m\in\mathbb{N}$, some $0\leq r<m$, and all $j\geq 0$; in such a case we may
say that $a_{n}$ “vanishes for all $n\equiv r\,\,(\mathrm{mod}\,\,m)$”. Thus
$\mathfrak{p}(n,\chi_{5})$ vanishes for all $n\equiv
2\,\,(\mathrm{mod}\,\,10)$.

As $n$ runs from $1$ to $8$, the quantity
$\cos(\frac{2\pi}{8}n-\frac{3\pi}{16})$ never vanishes. Consequently, the
signed term $\mathfrak{S}_{2}(n)$ in (1.6) never vanishes either, and it
follows that $(\mathfrak{p}(n,\chi_{2}))_{\mathbb{N}}$ does not vanish on any
arithmetic progression. Through this lens of vanishing on arithmetic
progressions, the results of Corollaries 1.4 and 1.6 and Theorem 1.9 combine
to yield the following interesting result.

######  Theorem 1.10.

If $p$ is an odd prime such that $p\neq 5$ and $p\not\equiv
1\,\,(\mathrm{mod}\,\,8)$, then the sequence
$(\mathfrak{p}(n,\chi_{p}))_{\mathbb{N}}$ does not vanish on any arithmetic
progression. Similarly, the sequence $(\mathfrak{p}(n,\chi_{2}))_{\mathbb{N}}$
does not vanish on any arithmetic progression.

Although outside the scope of our discussions, we mention another example of a
signed partition sequence that vanishes on arithmetic progressions.

######  Theorem 1.11 ([daniels2024vanishing]*Thm. 1.1).

For all partitions $\pi=(a_{1},a_{2},\ldots,a_{k})$ of $n\in\mathbb{N}$, let

$\chi_{5}^{\dagger}(\pi):=(-1)^{k}\chi_{5}(a_{1})\cdots\chi_{5}(a_{k}).$

Then $\mathfrak{p}(n,\chi_{5}^{\dagger})=0$ vanishes for all $n\equiv
6\,\,(\mathrm{mod}\,\,10)$.

###  1.2. A result on exponential sums

For $f:\mathbb{N}\to\mathbb{C}$ with $|f|\leq 1$, the generating function
$\Phi(z)=\Phi(z,f)$ for the sequence $(\mathfrak{p}(n,f))_{\mathbb{N}}$ is
defined via

$\Phi(z)=\prod_{n=1}^{\infty}\mathopen{}\mathclose{{}\left(\frac{1}{1-f(n)z^{n}}}\right)=1+\sum_{n=1}^{\infty}\mathfrak{p}(n,f)z^{n}\qquad(|z|<1).$

With this, by Cauchy’s theorem we have

$\mathfrak{p}(n,f)=\frac{1}{2\pi
i}\int_{|z|=\rho}\Phi(z)z^{-n-1}\,dz=\rho^{-n}\int_{0}^{1}\Phi(\rho
e(\alpha))e(-n\alpha)\,d\alpha$ (1.7)

for all $0<\rho<1$, where $e(\alpha):=\exp(2\pi i\alpha)$. In practice, one
often analyzes the integrand in (1.7) by examining a logarithm of $\Phi(z)$
rather than $\Phi(z)$ itself. Explicitly, the majority of our analyses
consider the series $\Psi(z)=\Psi(z,f)$ defined via

$\Psi(z)=\sum_{k=1}^{\infty}\sum_{n=1}^{\infty}\frac{f^{k}(n)}{k}z^{nk}\qquad(|z|<1),$
(1.8)

so that

$\Phi(z)=\exp(\Psi(z)).$

As outlined above, our primary focus is on sequences
$(\mathfrak{p}(n,\chi_{p}))_{\mathbb{N}}$ and on functions $\Psi(\rho
e(\alpha),\chi_{p})$. However, because it may be of independent interest, in
section 3 we establish the following general result using work of Montgomery
and Vaughan [montgomery1977exponential].

######  Theorem 1.12.

Suppose $f:\mathbb{N}\to\mathbb{C}$ is multiplicative and $|f|\leq 1$, let $X$
be a large positive parameter, and let $\alpha$ have the property that: if
$|\alpha-a/q|\leq 1/(qX^{2/3})$ for coprime $q\in\mathbb{N}$ and
$a\in\mathbb{Z}$, then $q>X^{1/3}$. Then, writing $\rho=\exp(-1/X)$, as
$X\to\infty$ one has

$\Psi(\rho e(\alpha),f)=O(X/\log{X}).$

### Acknowledgements

The author would like to thank Trevor Wooley for suggesting this problem, for
numerous helpful conversations, and for financial support during part of this
research. Thanks are additionally extended to David McReynolds and Alexandru
Zaharescu for invaluable conversations and advice in preparing this paper.

##  2\. Notation and preliminaries

The letter $p$ is reserved for odd primes, the notation $\chi=\chi_{p}$ is
reserved for the Legendre symbol $(\frac{n}{p})$, and $\chi_{2}$ is reserved
for the Kronecker symbol $(\frac{n}{2})$. The notation $\chi_{0}$ is reserved
for principal Dirichlet characters, where the associated modulus is specified
in context. To avoid confusion, we emphasize the following convention: Except
in statements such as “the Legendre symbol $(\frac{n}{p})$,” fractional
expressions $(\frac{a}{b})$ are never used to indicate a Legendre or Kronecker
symbol; rather, these functions are always indicated by $\chi_{p}$ (or simply
$\chi$) and $\chi_{2}$, respectively.

Expressions $O(g(x))$ with $g(x)>0$ denote quantities bounded by some constant
multiple of $g(x)$, and $f(x)\ll g(x)$ holds if $f(x)=O(g(x))$ as
$x\to\infty$. The relation $f(x)\asymp g(x)$ holds when $f(x)\ll g(x)$ and
$g(x)\ll f(x)$. Expressions $X_{0}(A)$ indicate some constant $X_{0}>0$
depending on $A$. Statements involving $\varepsilon$ are understood to hold
for all sufficiently small $\varepsilon>0$ unless noted otherwise, and
constants’ dependencies on $\varepsilon$ are generally suppressed.

For real $\alpha$ let $e(\alpha)=\exp(2\pi i\alpha)$, let
$\|\alpha\|=\min_{n\in\mathbb{Z}}|\alpha-n|$, and let
$\\{\alpha\\}=\alpha-\lfloor\alpha\rfloor$, and for
$f:\mathbb{N}\to\mathbb{C}$ let

$S_{f}(t,\alpha)=\sum_{n\leq t}f(n)e(n\alpha).$

Expressions $n\equiv a$ (mod $q$) are often abbreviated as $n\equiv a\,(q)$ in
subscripts, and sums the form $\sum_{n\equiv a\,(q)}$ or $\sum_{2|k}$ indicate
sums over positive $n$ and $k$ satisfying the conditions $n\equiv
a\,\,(\mathrm{mod}\,\,q)$ and $2\mid k$, respectively.

Let $1\leq Q\leq X$. For $q\in\mathbb{N}$ and $0\leq a\leq q$ with $(a,q)=1$
we define

$\mathfrak{M}(a/q)=\mathopen{}\mathclose{{}\left\\{\alpha\in[0,1):|\alpha-a/q|\leq
Q/(qX)}\right\\}.$

The _major arcs_ are those $\mathfrak{M}(a/q)$ with $q\leq Q$, and
$\mathfrak{M}(X,Q)$ denotes the union of all major arcs. The connected
components of $[0,1)\setminus\mathfrak{M}(X,Q)$ are the _minor arcs_ , and
their union is denoted $\mathfrak{m}(X,Q)$. In many cases, only $\alpha$ lying
in small subsets of the arcs $\mathfrak{M}(\tfrac{0}{1})$,
$\mathfrak{M}(\tfrac{1}{2})$, and $\mathfrak{M}(\tfrac{1}{1})$ significantly
contribute to the integral (1.7), with all other $\alpha$ contributing to an
error term. Anticipating this, for $X,X_{*}>1$ we define

$\displaystyle\mathfrak{P}$ $\displaystyle=\\{\alpha\in[0,1):\|\alpha\|\leq
3/(8\pi X)\\},$ $\displaystyle\mathfrak{P}_{*}$
$\displaystyle=\\{\alpha\in[0,1):|\alpha-\tfrac{1}{2}|\leq 3/(8\pi X_{*})\\},$

and, following Gafni [gafni2021partitions], we term the sets $\mathfrak{P}$
and $\mathfrak{P}_{*}$ the _principal arcs_.

For $\rho,\rho_{*}\in(0,1)$ it is convenient to write

$X=\frac{1}{\log(1/\rho)}\qquad\text{and}\qquad
X_{*}=\frac{1}{\log(1/\rho_{*})}$

so that

$\rho=e^{-1/X}\qquad\text{and}\qquad\rho_{*}=e^{-1/X_{*}},$

and this convention is maintained throughout this paper.

By comparison with the series $\Psi(z,1)$, for $|f|\leq 1$ the series
$\Psi(z,f)$ in (1.8) converges absolutely for $|z|<1$. Thus, we exchange the
sums in equation (1.8) and define

$F_{k}(z)=\sum_{n=1}^{\infty}f^{k}(n)z^{n}$

for $k>0$, so that

$\Psi(z)=\sum_{k=1}^{\infty}\sum_{n=1}^{\infty}\frac{f^{k}(n)}{k}z^{nk}=\sum_{k=1}^{\infty}\frac{1}{k}F_{k}(z^{k}).$
(2.1)

Often we analyze the sum (2.1) by considering the sum of terms with $k\leq K$
for some parameter $K$ and treating the remaining sum over $k>K$ as an error
term. For this purpose we record the following lemma bounding these tail sums.

######  Lemma 2.1.

Let $f:\mathbb{N}\to\mathbb{C}$ with $|f|\leq 1$. For real $\alpha$ and large
$X$ and $K$, one has

$\sum_{k>K}\frac{1}{k}F_{k}(\rho^{k}e(k\alpha))\ll\frac{X}{K}.$

###### Proof.

For fixed $k$ we see that

$F_{k}(\rho^{k}e(k\alpha))=\sum_{n=1}^{\infty}f^{k}(n)\rho^{nk}e(nk\alpha)\ll\sum_{n=1}^{\infty}\rho^{nk}=\frac{\rho^{k}}{1-\rho^{k}}.$

Using the relation $\rho=e^{-1/X}$ it follows that

$\sum_{k>K}\frac{1}{k}F_{k}(\rho^{k}e(k\alpha))\ll\sum_{k>K}\frac{1}{k}\,\frac{e^{-k/X}}{1-e^{-k/X}}=\sum_{k>K}\frac{1/k}{e^{k/X}-1}\ll\sum_{k>K}\frac{X}{k^{2}},$

and the result follows. ∎

### Structure

The majority of this paper focuses $\mathfrak{p}(n,\chi_{p})$ for odd primes
$p$, after which the special case of $\mathfrak{p}(n,\chi_{2})$ is treated in
section 13. In section 3 we analyze $\Psi(\rho e(\alpha),f)$ for $\alpha$ in
the minor arcs $\mathfrak{m}(X,Q)$, where $f$ is multiplicative and $|f|\leq
1$, ultimately establishing Theorem 1.12. After this, in sections 4 and 5 we
restrict our attention back to $\Psi(z,\chi_{p})$ for odd $p$, and therein
derive asymptotic formulae for $\Psi(\rho e(\alpha),\chi_{p})$ as $\rho\to
1^{-}$ for $\alpha$ in the major arcs and principal arcs.

In section 6 we consider how the parameters $X$ and $X_{*}$ (and thus $\rho$
and $\rho_{*}$) should depend on $n$. Because the “optimal” radii of
integration $\rho$ and $\rho_{*}$ may be unequal, in section 7 we recall the
“arc transference” of [daniels2023mobius]*sec. 9 and modify the contour of
integration in (1.7). Although the contents of sections 3–7 are applicable to
the analysis of $\mathfrak{p}(n,\chi_{5})$, in sections 8–11 we must exclude
the case of $\mathfrak{p}(n,\chi_{5})$ until its specific treatment in section
12.

Thus, focusing on $\mathfrak{p}(n,\chi_{p})$ for odd $p\neq 5$, in section 8
we use the results of the previous sections to establish that the integral for
$\mathfrak{p}(n,\chi_{p})$ is indeed dominated by those $\alpha$ near to $0$,
$\tfrac{1}{2}$, and $1$, i.e., those $\alpha$ in the principal arcs
$\mathfrak{P}$ and $\mathfrak{P}_{*}$. Following this, in section 9 we derive
asymptotic formulae for these integrals over $\mathfrak{P}$ and
$\mathfrak{P}_{*}$, which yields a “crude” asymptotic formula for
$\mathfrak{p}(n,\chi_{p})$ (again only for odd $p\neq 5$). In sections 10 and
11 this formula is refined by considering the possible residues of $p$ modulo
$8$, and the formulae of Theorems 1.3 and 1.5 are established.

In sections 12 and 13 we treat the special cases of $\mathfrak{p}(n,\chi_{5})$
and $\mathfrak{p}(n,\chi_{2})$, respectively, and therein establish Theorems
1.7 and 1.9, respectively. The first part of the appendix contains a number of
elementary but tedious computations used to establish Proposition 4.1.
Finally, the second part of the appendix both sketches a proof that
$L_{1}(\psi)>0$ for nonprincipal quadratic characters $\psi$ and includes some
useful formulae for explicitly computing $L_{1}(\chi_{p})$ related quantities.

### A comment on the scope of this paper

As discussed in the introduction, our primary focus in this paper is on
asymptotic formulae for the Legendre-signed partition numbers
$\mathfrak{p}(n,\chi_{p})$ for odd primes as well as a similar formula for
$\mathfrak{p}(n,\chi_{2})$. However, the majority of the techniques and
derivations in this paper may be easily generalized and applied to, say,
partition numbers $\mathfrak{p}(n,\psi)$ signed by general Dirichlet
characters $\psi$.

We restrict our focus to $\mathfrak{p}(n,\chi_{p})$ and
$\mathfrak{p}(n,\chi_{2})$ here for the relative ease of the associated
analyses and derivations. As the reader is likely to observe in section 1,
even in these simple cases the formulae for $\mathfrak{p}(n,f)$ can involve
unwieldy constants and expressions. In addition, in sections 12 and 13, where
$\mathfrak{p}(n,\chi_{5})$ and $\mathfrak{p}(n,\chi_{2})$ are treated,
respectively, one sees that the applications of the Hardy-Littlewood method to
the analyses of $\mathfrak{p}(n,f)$ can noticeably vary even among cases where
$f$ is a primitive quadratic character. As such, it is only natural that our
attention be restricted here.

##  3\. The minor arcs

The goal of this section is the proof of Theorem 1.12, which, by the
definitions of $\mathfrak{M}(X,Q)$ and $\mathfrak{m}(X,Q)$, concerns
$\Psi(\rho e(\alpha))=\Psi(\rho e(\alpha),f)$ for
$\alpha\in\mathfrak{m}(X,X^{1/3})$. Although the statement of Theorem 1.12
indicates that ultimately $Q:=X^{1/3}$, we begin with an undetermined $Q$ to
better illustrate our derivations.

Since $\Psi(\rho e(\alpha))=\sum_{k=1}^{\infty}k^{-1}F_{k}(\rho e(\alpha))$ as
seen in equation (2.1), our plan is to use summation by parts to write

$F_{k}(\rho
e(\alpha))=\sum_{n=1}^{\infty}f^{k}(n)\rho^{k}e(k\alpha)=\frac{k}{X}\int_{0}^{\infty}e^{-xk/X}S_{f}(x,k\alpha)\,dx$

and then estimate these $F_{k}$ by employing suitable bounds on
$S_{f}(x,k\alpha)$. The key to these bounds is the following result due to
Montgomery and Vaughan [montgomery1977exponential]*Cor. 1.

######  Lemma 3.1.

Suppose that $\mathopen{}\mathclose{{}\left|\alpha-a/q}\right|\leq q^{-2}$,
$(a,q)=1$, and $2\leq R\leq q\leq x/R$. Then

$S_{f}(x,\alpha)\ll\frac{x}{\log x}+\frac{x\log^{3/2}R}{R^{1/2}}$ (3.1)

uniformly for all multiplicative $f$ with $|f|\leq 1$. In addition, the
implicit constant in inequality (3.1) does not depend on $q$ or $a$.

Prior to applying Lemma 3.1, we must address a subtle issue concerning the
quantities $S_{f}(x,k\alpha)$. Namely, as $k$ ranges from $1$ to infinity the
quantities $k\alpha$ may fall outside our minor arcs $\mathfrak{m}(X,Q)$,
critically weakening our “savings” from said lemma. To work around this issue,
we reuse a couple technical lemmata from [daniels2023mobius]*sec. 4.

First we suppose that there exist quantities $K$, $\mathcal{X}$, and
$\mathcal{Q}$ such that $k\alpha\in\mathfrak{m}(\mathcal{X},\mathcal{Q})$ for
$\alpha\in\mathfrak{m}(X,Q)$ and $k\leq K$. Next, we observe that the
definitions of the sets $\mathfrak{M}(\mathcal{X},\mathcal{Q})$ and
$\mathfrak{m}(\mathcal{X},\mathcal{Q})$ imply that if $x\geq\mathcal{X}$, then
$\mathfrak{m}(\mathcal{X},\mathcal{Q})\subset\mathfrak{m}(x,\mathcal{Q})$.
Using these two ideas together, we deduce that for all $x\geq\mathcal{X}$, we
have

$\sup_{\begin{subarray}{c}\alpha\in\mathfrak{m}(X,Q)\\\ k\leq
K\end{subarray}}\mathopen{}\mathclose{{}\left|S_{f}(x,k\alpha)}\right|\leq\sup_{\theta\in\mathfrak{m}(\mathcal{X},\mathcal{Q})}\mathopen{}\mathclose{{}\left|S_{f}(x,\theta)}\right|\leq\sup_{\theta\in\mathfrak{m}(x,\mathcal{Q})}|S_{f}(x,\theta)|.$
(3.2)

We now consider how $K$, $\mathcal{X}$, and $\mathcal{Q}$ ought to be
selected. As motivated in [daniels2023mobius]*sec. 4, we prioritize decreasing
$\mathcal{X}$ at the cost of increasing $\mathcal{Q}$, demonstrating the
mechanism of this “exchange” in the following lemma.

######  Lemma 3.2.

Fix $\kappa\in(0,1)$, let $1\leq Q\leq X$, let $\alpha\in\mathfrak{m}(X,Q)$,
and let $1\leq k\leq Q^{\kappa}$. If $(a_{k},q_{k})=1$ and

$\mathopen{}\mathclose{{}\left|k\alpha-\frac{a_{k}}{q_{k}}}\right|\leq\frac{Q^{1-\kappa}}{q_{k}X},$

then $q_{k}>Q^{1-\kappa}$; in particular
$\\{k\alpha\\}\in\mathfrak{m}(X,Q^{1-\kappa})$. Finally, if $0<\nu<1-\kappa$
then

$\mathfrak{m}(X,Q^{1-\kappa})\subset\mathfrak{m}(XQ^{-\nu},Q^{1-\kappa-\nu}).$

###### Proof.

We begin by observing that $\mathfrak{m}(X,Q)$ consists of those
$\beta\in[0,1)$ such that: if $r\in\mathbb{N}$ and $b\in\mathbb{Z}$ are such
that $(b,r)=1$ and $|r\beta-b|\leq Q/X$, then it holds that $r>Q$.

By Dirichlet’s approximation theorem there exist $q_{k}\in\mathbb{N}$ and
$a_{k}\in\mathbb{Z}$ with $q_{k}\leq X/Q$, $(a_{k},q_{k})=1$, and
$|q_{k}k\alpha-a_{k}|\leq Q/X$. By writing
$a_{k}/(kq_{k})=a_{k}^{\prime}/(k^{\prime}q_{k})$ with
$(a_{k}^{\prime},k^{\prime}q_{k})=1$ and $k^{\prime}\leq k$, we deduce that

$\mathopen{}\mathclose{{}\left|\alpha-\frac{a_{k}^{\prime}}{k^{\prime}q_{k}}}\right|=\mathopen{}\mathclose{{}\left|\alpha-\frac{a_{k}}{kq_{k}}}\right|\leq\frac{Q}{kq_{k}X}\leq\frac{Q}{k^{\prime}q_{k}X}.$

As $(a_{k}^{\prime},k^{\prime}q_{k})=1$ and $\alpha\in\mathfrak{m}(X,Q)$, we
thus have that $k^{\prime}q_{k}>Q$ and $q_{k}>Q/k^{\prime}\geq Q^{1-\kappa}$.
Again using Dirichlet’s approximation theorem, there exist
$r_{k}\in\mathbb{N}$ and $b_{k}\in\mathbb{Z}$ with $(b_{k},r_{k})=1$ and
$|r_{k}\\{k\alpha\\}-b_{k}|\leq Q/X$. Setting $a_{k}:=b_{k}+r_{k}\lfloor
k\alpha\rfloor$, we have $(a_{k},r_{k})=1$ and $|r_{k}k\alpha-a_{k}|\leq Q/X$,
whereby $r_{k}>Q^{1-\kappa}$ and
$\\{k\alpha\\}\in\mathfrak{m}(X,Q^{1-\kappa})$.

Now let $0<\nu<1-\kappa$ and $\beta\in\mathfrak{m}(X,Q^{1-\kappa})$, and
suppose that $(b,r)=1$ and

$\mathopen{}\mathclose{{}\left|\beta-\frac{b}{r}}\right|\leq\frac{Q^{1-\kappa-\nu}}{rXQ^{-\nu}}.$

Of course $|r\beta-b|\leq Q^{1-\kappa}/X$ then, whereby $r>Q^{1-\kappa}\geq
Q^{1-\kappa-\nu}$, yielding the result. ∎

We now return to Lemma 3.1. For convenience we provide a proof of the lemma
using the proof outlined in [montgomery1977exponential], in which Lemma 3.1 is
demonstrated as a corollary of the following theorem.

######  Lemma 3.3 ([montgomery1977exponential]*Thm. 1).

Suppose that $(a,q)=1$ and $q\leq x$. One has

$S_{f}(x,a/q)\ll\frac{x}{\log
2x}+\frac{x}{\phi(q)^{1/2}}+\frac{x\log^{3/2}(2x/q)}{(x/q)^{1/2}}$

uniformly for all multiplicative $f$ with $|f|\leq 1$, where $\phi(q)$ is the
Euler totient function.

###### Proof of Lemma 3.1.

If $q=2$ or $R=2$ then (3.1) is trivial, so assume that $q\geq 3$, that $R\geq
3$, and that $x\geq 9$. For $r\in\mathbb{N}$ with $r\leq x$ let

$\mathcal{R}(x,r):=\frac{x}{\log
2x}+\frac{x}{\phi(r)^{1/2}}+\frac{x\log^{3/2}(2x/r)}{(x/r)^{1/2}}.$

Writing $e(\alpha n)=e(\beta n)e((\alpha-\beta)n)$ and summing by parts, one
sees that

$S_{f}(x,\alpha)=S_{f}(x,\beta)e((\alpha-\beta)x)-2\pi
i(\alpha-\beta)\int_{1}^{x}S_{f}(u,\beta)e((\alpha-\beta)u)\,du.$

Suppose that $\beta=b/r$ with $(b,r)=1$ and $r\leq x$. Trivially bounding
$S_{f}(u,\beta)\ll u$ when $u\leq r$ and using Lemma 3.3 when $r<u\leq x$, one
finds that

$2\pi
i(\alpha-\beta)\int_{1}^{x}S_{f}(u,\beta)e((\alpha-\beta)u)\,du\ll|\alpha-b/r|(r^{2}+x\mathcal{R}(x,r)),$

whereby

$S_{f}(x,\alpha)\ll\mathcal{R}(x,r)+|\alpha-b/r|(r^{2}+x\mathcal{R}(x,r)).$

If $q>x^{1/2}$, then setting $b=a$ and $r=q$ it follows that

$S_{f}(x,\alpha)\ll\mathcal{R}(x,r)+r^{-2}(r^{2}+x\mathcal{R}(x,r))\ll\mathcal{R}(x,r).$
(3.3)

Now suppose that $q\leq x^{1/2}$. By Dirichlet’s approximation theorem there
exist coprime $b$ and $r$, with $r\leq 2x/q$, such that $|\alpha-b/r|\leq
q/(2xr)$. If $r=q$ then $|\alpha-b/r|\leq 1/(2x)$ and we again recover (3.3).
If $r\neq q$ then

$1\leq|ar-
bq|=qr\mathopen{}\mathclose{{}\left|\frac{b}{r}-\frac{a}{q}}\right|\leq\frac{q^{2}}{2x}+\frac{r}{q}\leq\frac{1}{2}+\frac{r}{q},$

whereby $r\geq q/2$ and $|\alpha-b/r|\leq 1/x$, and it follows that
$S_{f}(x,\alpha)\ll\mathcal{R}(x,r)+x/q^{2}$.

In each of the three scenarios for $x$, $q$, and $r$ described, we have
$r\geq\tfrac{1}{2}q$ and

$S_{f}(x,\alpha)\ll\mathcal{R}(x,r)+x/q^{2}.$

Since $r\geq\frac{q}{2}\geq\frac{R}{2}\geq\tfrac{3}{2}$ (so that $r\geq 2$),
we use the bound $\phi(n)\gg\frac{n}{|\log\log{n}|}$ for $n\geq 2$ (see, e.g.,
[hardy2008introduction]*Thm. 328) to deduce that

$\phi(r)\gg\frac{r}{|\log\log r|}\gg\frac{R}{\log\log R},$

and because $2\leq R\leq q\leq 2x/r$ it follows that

$\mathcal{R}(x,r)\ll\frac{x}{\log x}+\frac{x\log^{1/2}(\log
R)}{R^{1/2}}+\frac{x\log^{3/2}(2x/r)}{(2x/r)^{1/2}}\ll\frac{x}{\log
x}+\frac{x\log^{3/2}R}{R^{1/2}},$

establishing Lemma 3.1. ∎

As mentioned previously, ultimately we set $Q=X^{1/3}$, for now we let
$Q=X^{\delta}$ for some $\delta\in(0,1/2)$ to illustrate the role that $Q$
plays in our arguments. We note that the upper bound of $1/2$ for $\delta$
ensures that distinct major arcs $\mathfrak{M}(a/q)$ do not overlap once $X$
is sufficiently large.

######  Lemma 3.4.

Let $f$ be multiplicative with $|f|\leq 1$. Let $\delta\in(0,1/2)$, let
$\nu,\kappa\in(0,1)$ satisfy $\nu+\kappa<1$, let $Q=X^{\delta}$, and let $X$
be sufficiently large. For all $x\geq XQ^{-\nu}$ one has

$\sup_{\begin{subarray}{c}a\in\mathfrak{m}(X,Q)\\\ k\leq
Q^{\kappa}\end{subarray}}|S_{f}(x,k\alpha)|\ll\frac{x}{\log{x}}+\frac{x\log^{3/2}R}{R^{1/2}},$
(3.4)

where $R=Q^{1-\kappa-\nu}$.

###### Proof.

It follows from Lemma 3.2 that for $\alpha\in\mathfrak{m}(X,Q)$ and $k\leq
Q^{\kappa}$, one has

$\\{k\alpha\\}\in\mathfrak{m}(XQ^{-\nu},Q^{1-\kappa-\nu}).$ (3.5)

By Dirichlet’s approximation theorem there exist $q_{k}$ and $a_{k}$ such that
$(a_{k},q_{k})=1$, $1\leq q_{k}\leq XQ^{-\nu}/Q^{1-\kappa-\nu}$, and

$\mathopen{}\mathclose{{}\left|\\{k\alpha\\}-\frac{a_{k}}{q_{k}}}\right|\leq\frac{Q^{1-\kappa-\nu}}{q_{k}XQ^{-\nu}}\leq\frac{1}{q_{k}^{2}}.$

By (3.5) it holds that $q_{k}>Q^{1-\kappa-\nu}$, and by the assumptions that
$Q=X^{\delta}$ and that $X$ is sufficiently large, it additionally holds that

$2\leq Q^{1-\kappa-\nu}\leq q_{k}\leq\frac{XQ^{-\nu}}{Q^{1-\kappa-\nu}}.$
(3.6)

As (3.6) remains valid with $XQ^{-\nu}$ replaced by any $x\geq XQ^{-\nu}$,
setting $R:=Q^{1-\kappa-\nu}$ and applying Lemma 3.1 one deduces that

$S_{f}(x,\\{k\alpha\\})\ll\frac{x}{\log{x}}+\frac{x\log^{3/2}R}{R^{1/2}},$

and the result follows immediately since
$S_{f}(x,\\{k\alpha\\})=S_{f}(x,k\alpha)$. ∎

######  Remark 3.5.

Because the supremum in inequality (3.4) is taken over all $k\leq Q^{\kappa}$,
it is important that the implicit constant in inequality (3.1) does not depend
on $q_{k}$ and thereby depend on $k$. This is why we emphasize said
independence in Lemma 3.1.

Having established our desired bounds on $S_{f}(x,k\alpha)$, we now bound
$\Psi(\rho e(\alpha))$ for $\alpha\in\mathfrak{m}(X,Q)$ and, after taking
$Q=X^{1/3}$, establish Theorem 1.12.

######  Theorem 3.6 (Thm. 1.12).

Suppose $f$ is multiplicative and $\mid f|\leq 1$, and let $Q=X^{1/3}$. For
all $X>X_{0}$ and $\alpha\in\mathfrak{m}(X,Q)$, one has

$\Psi(\rho e(\alpha),f)\ll X/\log X.$

###### Proof.

Let $\delta\in(0,\tfrac{1}{2})$, let $\kappa,\nu\in(0,1)$ be such that
$\kappa<\nu$ and $\kappa+\nu<1$, let $Q=X^{\delta}$, let $X$ be sufficiently
large, and let $k\leq Q^{\kappa}$. Recall that
$F_{k}(z)=\sum_{n=1}^{\infty}f^{k}(n)z^{nk}$. Summing by parts, we have

$F_{k}(\rho
e(\alpha))=\sum_{n=1}^{\infty}f^{k}(n)\rho^{k}e(k\alpha)=\frac{k}{X}\int_{0}^{\infty}e^{-xk/X}S_{f}(x,k\alpha)\,dx.$
(3.7)

Let $R=Q^{1-\kappa-\nu}$. Bounding $S_{f}(x,k\alpha)\ll x$ when $x\leq
XQ^{-\nu}$ and using inequality (3.4) when $x>XQ^{-\nu}$, we find that
integral (3.7) is

$\displaystyle\ll\frac{k}{X}\mathopen{}\mathclose{{}\left[\int_{0}^{XQ^{-\nu}}e^{-xk/X}x\,dx+\int_{XQ^{-\nu}}^{\infty}e^{-xk/X}\mathopen{}\mathclose{{}\left(\frac{x}{\log
x}+\frac{x\log^{3/2}R}{R^{1/2}}}\right)\,dx}\right]$
$\displaystyle\ll\frac{X}{k}\mathopen{}\mathclose{{}\left[\int_{0}^{kQ^{-\nu}}e^{-u}u\,du+\mathopen{}\mathclose{{}\left(\frac{1}{\log
XQ^{-\nu}}+\frac{\log^{3/2}R}{R^{1/2}}}\right)\int_{kQ^{-\nu}}^{\infty}e^{-u}u\,du}\right].$
(3.8)

Observing that

$\frac{1}{\log
XQ^{-\nu}}+\frac{\log^{3/2}R}{R^{1/2}}=\frac{1}{\log(X^{1-\delta\nu})}+\frac{\log^{3/2}(X^{\delta(1-\kappa-\nu)})}{(X^{\delta(1-\kappa-\nu)})^{1/2}}\ll\frac{1}{\log
X},$

we integrate by parts in expression (3.8) to deduce that

$F_{k}(\rho
e(\alpha))\ll\frac{X}{k}\mathopen{}\mathclose{{}\left[1-(1+kQ^{-\nu})e^{-kQ^{-\nu}}+\frac{1}{\log
X}(1+kQ^{-\nu})e^{-kQ^{-\nu}}}\right].$ (3.9)

As $kQ^{-\nu}\leq Q^{\kappa-\nu}$ and $\kappa-\nu<0$, and $Q$ is sufficiently
large (because $X$ is), we use the approximation

$(1+x)e^{-x}=1-\tfrac{1}{2}x^{2}+O(x^{3})$

for small $x$ to bound the righthand side of (3.9) as

$\displaystyle\ll\frac{X}{k}\mathopen{}\mathclose{{}\left[\tfrac{1}{2}Q^{2\kappa-2\nu}+O(Q^{3\kappa-3\nu})+\frac{1}{\log
X}(1+O(Q^{2\kappa-2\nu}))}\right]\ll\frac{X/k}{\log X},$

and we conclude that

$F_{k}(\rho e(\alpha))\ll\frac{X/k}{\log X}\qquad\text{for
$\alpha\in\mathfrak{m}(X,Q)$ and $k\leq X^{\delta\kappa}$.}$

Summing over all $k$ and using Lemma 2.1 then, we have

$\Psi(\rho e(\alpha))=\mathopen{}\mathclose{{}\left[\sum_{k\leq
X^{\delta\kappa}}+\sum_{k>X^{\delta\kappa}}}\right]\frac{F_{k}(\rho
e(\alpha))}{k}\ll\frac{X}{\log X}\sum_{k\leq
X^{\delta\kappa}}\frac{1}{k^{2}}+X^{1-\delta\kappa},$

and this latter expression is

$\ll\frac{X}{\log
X}+\frac{X^{1-\delta\kappa}}{\log{X}}+X^{1-\delta\kappa}\ll\frac{X}{\log
X}+X^{1-\delta\kappa}.$

Taking $\delta=\tfrac{1}{3}$, $\kappa=\tfrac{1}{3}$, and $\nu=\tfrac{2}{5}$ we
see that

$\kappa<\nu,\quad\kappa+\nu<1,\quad\text{and}\quad
X^{1-\delta\kappa}=X^{1-\frac{1}{9}},$

and the result follows. ∎

##  4\. The major arcs for odd primes $p$

We now return to our specific consideration of $\Psi(z)=\Psi(z,\chi_{p})$ for
odd primes $p$ and derive first-order asymptotics for $\Psi(\rho e(\alpha))$
as $\rho\to 1^{-}$ when $\alpha$ is near to a reduced rational $a/q$. Using
Mellin-transform methods one may compute lower order terms for $\Psi(\rho
e(a/q))$, as seen in section 5 and later in section 12, but these computations
become cumbersome as $q$ grows. At present we are simply interested in
determining which major arcs $\mathfrak{M}(a/q)$ are the dominant contributors
in our asymptotic formulae, and thus coarser methods suffice for now. As in
the previous section, we begin with an undetermined $Q$ such that $1\leq Q\leq
X$.

Now let $\alpha=a/q+\beta$, with $q\leq Q$, $(a,q)=1$, and $|\beta|\leq
Q/(qX)$, or in other words, let $\alpha\in\mathfrak{M}(a/q)$ with $q\leq Q$,
and recall from (2.1) that

$\Psi(z)=\sum_{k=1}^{\infty}\frac{1}{k}\sum_{n=1}^{\infty}\chi^{k}(n)z^{nk}=\sum_{k=1}^{\infty}\frac{1}{k}F_{k}(z^{k}).$

It is convenient here, and indeed in many of our discussions, to let

$\tau=X^{-1}(1-2\pi iX\beta),$

so that for $\alpha=\tfrac{a}{q}+\beta$ we may write $\rho
e(\alpha)=e(\tfrac{a}{q})e^{-\tau}$. Doing this, we have

$F_{k}(\rho^{k}e(k\alpha))=\sum_{n=1}^{\infty}e\mathopen{}\mathclose{{}\left(\frac{nka}{q}}\right)\chi^{k}(n)e^{-nk\tau}=\sum_{m=1}^{[p,q]}e\mathopen{}\mathclose{{}\left(\frac{mka}{q}}\right)\chi^{k}(m)\sum_{n\equiv
m\,([p,q])}e^{-nk\tau},$

where $[p,q]:=\mathrm{lcm}(p,q)$. Since trivially $[p,q]\ll q$, and

$mk|\tau|\ll[p,q]k|\tau|\ll qk\mathopen{}\mathclose{{}\left|\frac{1}{X}-2\pi
i\beta}\right|\ll
qk\mathopen{}\mathclose{{}\left(\frac{1}{X}+\frac{Q}{qX}}\right)\ll\frac{kQ}{X}$

for $1\leq m\leq[p,q]$, we have

$\sum_{n\equiv
m\,([p,q])}e^{-nk\tau}=\frac{e^{-mk\tau}}{1-e^{-[p,q]k\tau}}=\frac{1}{[p,q]k\tau}\mathopen{}\mathclose{{}\left(\frac{1+O(mk\tau)}{1+O(qk\tau)}}\right)=\frac{1}{[p,q]k\tau}+O\mathopen{}\mathclose{{}\left(\frac{kQ}{X}}\right).$

Again since $[p,q]\ll q\ll Q$, we deduce that

$F_{k}(\rho^{k}e(k\alpha))=\frac{1}{[p,q]k\tau}\sum_{m=1}^{[p,q]}e\mathopen{}\mathclose{{}\left(\frac{mka}{q}}\right)\chi^{k}(m)+O\mathopen{}\mathclose{{}\left(\frac{kQ^{2}}{X}}\right).$

We are thus motivated to define, for $0\leq a\leq q$, $(a,q)=1$, and $k\geq
1$, the quantities

$U_{k}(q,a)=\frac{1}{[p,q]}\sum_{m=1}^{[p,q]}e\mathopen{}\mathclose{{}\left(\frac{mka}{q}}\right)\chi^{k}(m),$
(4.1)

where again $[p,q]=\mathrm{lcm}(p,q)$, so that

$F_{k}(\rho^{k}e(k\alpha))=\frac{U_{k}(q,a)}{k\tau}+O\mathopen{}\mathclose{{}\left(\frac{kQ^{2}}{X}}\right)$

and

$\sum_{k\leq K}\frac{1}{k}F_{k}(\rho^{k}e(k\alpha))=\tau^{-1}\sum_{k\leq
K}\frac{U_{k}(q,a)}{k^{2}}+O\mathopen{}\mathclose{{}\left(\frac{Q^{2}K}{X}}\right).$
(4.2)

Because $|U_{k}(q,a)|\leq 1$, we complete the sum in (4.2) at the cost of
$O(|\tau|^{-1}K^{-1})=O(X/K)$ to deduce that

$\sum_{k\leq
K}\frac{1}{k}F_{k}(\rho^{k}e(k\alpha))=\tau^{-1}\sum_{k=1}^{\infty}\frac{U_{k}(q,a)}{k^{2}}+O\mathopen{}\mathclose{{}\left(\frac{X}{K}}\right)+O\mathopen{}\mathclose{{}\left(\frac{Q^{2}K}{X}}\right).$

Recalling from Lemma 2.1 that $\sum_{k>K}k^{-1}F_{k}(z)\ll X/K$ as well, we
further deduce that

$\Psi(\rho
e(\alpha))=\tau^{-1}\sum_{k=1}^{\infty}\frac{U_{k}(q,a)}{k^{2}}+O\mathopen{}\mathclose{{}\left(\frac{X}{K}}\right)+O\mathopen{}\mathclose{{}\left(\frac{Q^{2}K}{X}}\right).$

Setting $Q=X^{1/3}$ and $K=X^{1/9}$ (consistent with the choices $\delta=1/3$
and $\kappa=1/3$ from section 3), we conclude that

$\Psi(\rho e(\alpha))=\mathopen{}\mathclose{{}\left(\frac{X}{1-2\pi
iX\beta}}\right)\sum_{k=1}^{\infty}\frac{U_{k}(q,a)}{k^{2}}+O(X^{8/9}).$ (4.3)

With formula (4.3), “sorting” the major arcs $\mathfrak{M}(a/q)$ based on
their relative contributions to $\mathfrak{p}(n,\chi)$ is now a matter of
computing $\sum_{k=1}^{\infty}U_{k}(q,a)/k^{2}$ for different $q$ and $a$. As
we ultimately find that

$\sum_{k=1}^{\infty}\frac{U_{k}(1,1)}{k^{2}}=\sum_{k=1}^{\infty}\frac{U_{k}(2,1)}{k^{2}}=\frac{\pi^{2}}{24}\mathopen{}\mathclose{{}\left(1-\frac{1}{p}}\right),$

which dictates the behavior of $\Psi(\rho e(\alpha))$ on our principal arcs,
it is convenient in the remainder of this paper to let

$\mathfrak{c}=\frac{\pi^{2}}{24}\mathopen{}\mathclose{{}\left(1-\frac{1}{p}}\right)$
(4.4)

and write our other constants in terms of $\mathfrak{c}$. In particular, we
define

$V_{q}(a)=\frac{1}{\mathfrak{c}}\sum_{k=1}^{\infty}\frac{U_{k}(q,a)}{k^{2}}=\frac{1}{\mathfrak{c}[p,q]}\sum_{k=1}^{\infty}\sum_{m=1}^{[p,q]}e\mathopen{}\mathclose{{}\left(\frac{mka}{q}}\right)\frac{\chi^{k}(m)}{k^{2}}$
(4.5)

and note that $|V_{q}(a)|\leq 1$ for all $(a,q)=1$.

The explicit computations of different $V_{q}(a)$ are little more than
exercises in the elementary properties of Dirichlet characters. Because
$\chi^{k}$ is either $\chi_{0}\,\,(\mathrm{mod}\,\,p)$ or $\chi_{p}$ depending
on the parity of $k$, and because the parity of $q$ also affects the formula
for $V_{q}(a)$, the derivations of the different $V_{q}(a)$ are somewhat
tedious. Thus, we skip these derivations presently and include them in the
appendix. Granting this, we establish the following proposition.

######  Proposition 4.1.

Let $X>X_{0}$ and let $\alpha=a/q+\beta$ with $(a,q)=1$ and $|\beta|\leq
1/(qX^{2/3})$. There exists a constant $V_{q}(a)$ such that as $X\to\infty$
one has

$\Psi(\rho e(\alpha))=\frac{V_{q}(a)\mathfrak{c}X}{1-2\pi
iX\beta}+O(X^{8/9}),$ (4.6)

where

$\mathfrak{c}=\frac{\pi^{2}}{24}\mathopen{}\mathclose{{}\left(1-\frac{1}{p}}\right)$

and $V_{q}(a)$, as defined in (4.5), has the following closed forms. First, if
$p\nmid q$ then

$V_{q}(a)=\begin{cases}1/q^{2}&\text{$p\nmid q$ and $2\nmid q$},\\\
4/q^{2}&\text{$p\nmid q$ and $2\mid q$}.\end{cases}$ (4.7)

If $p\mid q$ and $2\nmid q$, then

$V_{q}(a)=\mathopen{}\mathclose{{}\left[\chi(a)G(\chi)(1-\tfrac{\chi(2)}{4})L_{2}(\chi)/\mathfrak{c}-1}\right]\frac{p}{q^{2}},$
(4.8)

where $G(\chi)=\sum_{m=1}^{p}\chi(m)e(m/p)$ and $L_{2}(\chi)=L(2,\chi)$.
Finally, if $p\mid q$ and $2\mid q$ then

$V_{q}(a)=-4p/q^{2}.$ (4.9)

Because they feature prominently in our later discussions, we note that

$V_{1}(1)=V_{2}(1)=1\qquad\text{and}\qquad V_{4}(1)=V_{4}(3)=\tfrac{1}{4}.$

##  5\. The principal arcs

We now consider $\Psi(\rho e(\alpha))$ when $\alpha$ is in one of the two
principal arcs

$\displaystyle\mathfrak{P}$ $\displaystyle=\\{\alpha\in[0,1):\|\alpha\|\leq
3/(8\pi X)\\},$ $\displaystyle\mathfrak{P}_{*}$
$\displaystyle=\\{\alpha\in[0,1):|\alpha-\tfrac{1}{2}|\leq 3/(8\pi X_{*})\\}.$

Complex $s$ are written $\sigma+it$, and $\sigma$ and $t$ always represent the
real and imaginary parts of some $s\in\mathbb{C}$, respectively. Integrals
$\frac{1}{2\pi i}\int$ are abbreviated using dashed integrals
$\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int$.
For real $\beta$ we again set $\tau:=X^{-1}(1-2\pi iX\beta)$ so that $z=\rho
e(\beta)$ may be written as $e^{-\tau}$.

Because $\Psi(\rho e(\alpha))=\Psi(\rho e(\alpha-1))$ for all $\rho$ and
$\alpha$, it is convenient to identify the sets

$\\{e(\alpha):\alpha\in\mathfrak{P}\\}\qquad\text{and}\qquad\\{e(\beta):\text{$\beta\in\mathbb{R}$
and $|\beta|\leq 3/(8\pi X)$}\\}$ (5.1)

and consider $\Psi(\rho e(\alpha))$ with $\alpha\in\mathfrak{P}$ as $\Psi(\rho
e(\beta))$ with $|\beta|\leq 3/(8\pi X)$. As $e(1/2)=-1$, we may similarly
identify the sets

$\\{e(\alpha):\alpha\in\mathfrak{P}_{*}\\}\qquad\text{and}\qquad\\{-e(\beta):\text{$\beta\in\mathbb{R}$
and $|\beta|\leq 3/(8\pi X_{*})$}\\}$ (5.2)

and consider $\Psi(\rho_{*}e(\alpha))$ with $\alpha\in\mathfrak{P}_{*}$ as
$\Psi(-\rho_{*}e(\beta))$ with $|\beta|\leq 3/(8\pi X_{*})$.

######  Remark 5.1.

Despite the above definitions’ in terms of $X_{*}$, we do not presently
distinguish $X$ and $X_{*}$ because, at present, both $X$ and $X_{*}$ are
simply large real parameters. Thus, in light of (5.1) and (5.2), we see that
our results on $\Psi(\pm\rho e(\beta))$ with $|\beta|\leq 3/(8\pi X)$
sufficiently cover the analyses of $\Psi(\rho e(\alpha))$ for $\alpha$ in the
principal arcs $\mathfrak{P}$ and $\mathfrak{P}_{*}$.

Observing that $\chi^{k}(n)=\chi(n)$ for odd $k$ and $\chi^{k}(n)=\chi_{0}(n)$
for even $k$, where $\chi_{0}$ is the principal character (mod $p$), we split
$\Psi(z)$ into two sums

$\Psi(z)=\sum_{k\equiv
0\,(2)}\sum_{n=1}^{\infty}\frac{\chi_{0}(n)}{k}z^{nk}+\sum_{k\equiv
1\,(2)}\sum_{n=1}^{\infty}\frac{\chi(n)}{k}z^{nk},$ (5.3)

which we denote by $\Psi_{0}(z)$ and $\Psi_{1}(z)$ in the obvious manner, so
that

$\Psi(z)=\Psi_{0}(z)+\Psi_{1}(z).$

Using the well-known formula
$e^{-w}=\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int_{\sigma-i\infty}^{\sigma+i\infty}\Gamma(s)w^{-s}\,ds$
for $\operatorname{Re}w>0$ and $\sigma>0$, we express $\Psi_{0}(z)$ and
$\Psi_{1}(z)$ as sums of integrals and interchange the summations and
integrations using the series’ absolute convergence, and thereby derive the
formulae

$\displaystyle\Psi_{0}(\rho e(\beta))=\Psi_{0}(e^{-\tau})$
$\displaystyle=\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int_{2-i\infty}^{2+i\infty}2^{-s-1}\zeta(s+1)L(s,\chi_{0})\Gamma(s)\tau^{-s}\,ds,$
(5.4) $\displaystyle\Psi_{1}(\rho e(\beta))=\Psi_{1}(e^{-\tau})$
$\displaystyle=\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int_{2-i\infty}^{2+i\infty}(1-2^{-s-1})\zeta(s+1)L(s,\chi)\Gamma(s)\tau^{-s}\,ds.$
(5.5)

In what follows we again use the conventions that

$L_{r}(\chi)=L(r,\chi)\qquad\text{and}\qquad
L_{r}^{\prime}(\chi)=L^{\prime}(r,\chi)\qquad(r=0,1,2).$

######  Lemma 5.2.

For all $|\beta|\leq 3/(8\pi X)$, as $X\to\infty$ one has

$\Psi(\rho e(\beta))=\frac{\mathfrak{c}X}{1-2\pi
iX\beta}+2\lambda\log\mathopen{}\mathclose{{}\left(\frac{X}{1-2\pi
iX\beta}}\right)+\Lambda+O(X^{-1/2}),$ (5.6)

where

$\mathfrak{c}=\tfrac{\pi^{2}}{24}(1-\tfrac{1}{p}),\quad\lambda=\tfrac{1}{4}L_{0}(\chi),\quad\text{and}\quad\Lambda=\tfrac{1}{2}\big{[}L_{0}^{\prime}(\chi)+L_{0}(\chi)\log{2}\big{]}-\tfrac{1}{4}\log{p}.$

###### Proof.

As $L(s,\chi_{0})=(1-p^{-s})\zeta(s)$, equation (5.4) states that

$\Psi_{0}(\rho
e(\beta))=\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int_{2-i\infty}^{2+i\infty}2^{-s-1}(1-p^{-s})\zeta(s+1)\zeta(s)\Gamma(s)\tau^{-s}\,ds.$
(5.7)

Letting $T$ be a large parameter to be chosen below, we first truncate the
integral (5.7) at height $T$ with error term

$\ll\int_{T}^{\infty}\mathopen{}\mathclose{{}\left|\Gamma(2+it)\tau^{-2-it}}\right|\,dt.$
(5.8)

Having assumed that $|\beta|\leq 3/(8\pi X)$ we have

$\mathopen{}\mathclose{{}\left|\arg\tau}\right|=\mathopen{}\mathclose{{}\left|\arg(1-2\pi
iX\beta)}\right|\leq\mathopen{}\mathclose{{}\left|\arctan(\tfrac{3}{4})}\right|\leq\tfrac{\pi}{4},$

which implies that

$\mathopen{}\mathclose{{}\left|\tau^{2-it}}\right|=|\tau|^{-2}e^{t\arg\tau}\leq
X^{2}e^{\pi|t|/4}.$ (5.9)

We now recall two bounds on $\Gamma(s)$ and $\zeta(s)$. First, one has
[paris2001asymptotics]*ineq. (2.1.19)

$|\Gamma(s)|\ll|s|^{\sigma-\frac{1}{2}}\exp\mathopen{}\mathclose{{}\left(-\tfrac{1}{2}\pi|t|+\tfrac{1}{6}|s|^{-1}}\right)\qquad(\sigma\geq
0).$ (5.10)

Second, in any halfplane $\sigma\geq\sigma_{0}$, as $|t|\to\infty$ one has
[titchmarsh1986theory]*sec. 5.1

$|\zeta(s)|\ll|t|^{k}\qquad\text{for some $k=k(\sigma_{0})$.}$ (5.11)

Using inequalities (5.9), (5.10), and (5.11), it follows that integral (5.8)
is

$\ll X^{2}\int_{T}^{\infty}t^{c_{1}}e^{-\pi t/4}\,dt\ll X^{2}e^{-\pi T/5},$

whereby

$\Psi_{0}(e^{-\tau})=\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int_{2-iT}^{2+iT}2^{-s-1}(1-p^{-s})\zeta(s+1)\zeta(s)\Gamma(s)\tau^{-s}\,ds+O(X^{2}e^{-\pi
T/5}).$ (5.12)

The integrand in integral (5.12) is analytic in the halfplane
$\sigma\geq-\tfrac{1}{2}$ with the exceptions of simple poles at $s=1$ and
$s=0$; one may compute their residues to be

$\tfrac{\pi^{2}}{24}(1-\tfrac{1}{p})\tau^{-1}=\mathfrak{c}\tau^{-1}\qquad\text{and}\qquad-\tfrac{1}{4}\log
p,$

respectively. With these, and using (5.10) and (5.11), it is straightforward
to deduce that

$\Psi_{0}(e^{-\tau})=\mathfrak{c}\tau^{-1}-\tfrac{1}{4}\log p+O(X^{2}e^{-\pi
T/5})+O(X^{-1/2}),$

and selecting $T=X$ and replacing $\tau^{-1}$ with $X^{-1}(1-2\pi iX\beta)$ we
conclude that

$\Psi_{0}(\rho e(\beta))=\frac{\mathfrak{c}X}{1-2\pi
iX\beta}-\tfrac{1}{4}\log{p}+O(X^{-1/2}).$ (5.13)

Now for $\Psi_{1}(\rho e(\beta))$, equation (5.5) states that

$\Psi_{1}(\rho
e(\beta))=\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int_{2-i\infty}^{2+i\infty}(1-2^{-s-1})\zeta(s+1)L(s,\chi)\Gamma(s)\tau^{-s}\,ds.$

The integrand here is analytic on the halfplane $\sigma\geq-\tfrac{1}{2}$
except at $s=0$, where it has a double pole with residue

$-\tfrac{1}{2}L_{0}(\chi)\log{\tau}+\tfrac{1}{2}\big{[}L_{0}^{\prime}(\chi)+L_{0}(\chi)\log{2}\big{]}.$

Using arguments similar to those for (5.13) one may check that

$\Psi_{1}(\rho
e(\beta))=-\tfrac{1}{2}L_{0}(\chi)\log{\tau}+\tfrac{1}{2}\big{[}L_{0}^{\prime}(\chi)+L_{0}(\chi)\log{2}\big{]}+O(X^{-1/2}),$

and combining this with (5.13) yields formula (5.6). ∎

When $z=-\rho e(\beta)=-e^{-\tau}$ our formulae require only small changes. As
$(-z)^{nk}=z^{nk}$ for even $k$ we have $\Psi_{0}(-z)=\Psi_{0}(z)$, and thus
by (5.13) we immediately conclude that

$\Psi_{0}(-\rho e(\beta))=\frac{\mathfrak{c}X}{1-2\pi
iX\beta}-\tfrac{1}{4}\log{p}+O(X^{-1/2}).$

As $(-1)^{nk}=(-1)^{n}$ for odd $k$ we have

$\Psi_{1}(-z)=\sum_{k\equiv
1\,(2)}\sum_{n=1}^{\infty}(-1)^{n}k^{-1}\chi(n)z^{nk},$

using which we derive a formula like (5.5) by replacing $L(s,\chi)$ with a
suitable closed form for $\sum_{n=1}^{\infty}(-1)^{n}\chi(n)n^{-s}$. In
particular, by separating this latter sum into sums over even and odd $n$, we
find at once that

$\sum_{n=1}^{\infty}(-1)^{n}\chi(n)n^{-s}=(\chi(2)2^{1-s}-1)L(s,\chi)\qquad(\operatorname{Re}(s)>1),$
(5.14)

and using formula (5.14) in equation (5.5) we have

$\Psi_{1}(-\rho
e(\beta))=\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int_{2-i\infty}^{2+i\infty}(1-2^{-s-1})(2^{1-s}\chi(2)-1)\zeta(s+1)L(s,\chi)\Gamma(s)\tau^{-s}\,ds$

The integrand here has a double pole at $s=0$, this time with residue

$\displaystyle-\tfrac{1}{2}(2\chi(2)-1)L_{0}(\chi)\log{\tau}+\tfrac{1}{2}\big{[}(2\chi(2)-1)L^{\prime}_{0}(\chi)-L_{0}(\chi)\log{2}\big{]},$

and arguing as done for Lemma 5.2 we easily establish the following lemma.

######  Lemma 5.3.

For all $|\beta|\leq 3/(8\pi X)$, as $X\to\infty$ one has

$\Psi(-\rho e(\beta))=\frac{\mathfrak{c}X}{1-2\pi
iX\beta}+2\lambda_{*}\log\mathopen{}\mathclose{{}\left(\frac{X}{1-2\pi
iX\beta}}\right)+\Lambda_{*}+O(X^{-1/2}),$

where

$\mathfrak{c}=\tfrac{\pi^{2}}{24}(1-\tfrac{1}{p}),\qquad\lambda_{*}=\tfrac{1}{4}(2\chi(2)-1)L_{0}(\chi),$

and

$\Lambda_{*}=\tfrac{1}{2}\big{[}(2\chi(2)-1)L^{\prime}_{0}(\chi)-L_{0}(\chi)\log{2}\big{]}-\tfrac{1}{4}\log{p}.$

##  6\. The relationships between $n$, $X$, and $X_{*}$

Recalling that $\Phi(z)=\exp\Psi(z)$, $\rho=\exp(-1/X)$, and
$\rho_{*}=\exp(-1/X_{*})$, we now consider how the radius of integration
$\rho$ in

$\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int_{|z|=\rho}\Phi(z)z^{-n-1}\,dz=\rho^{-n}\int_{0}^{1}\Phi(\rho
e(\alpha))e(-n\alpha)\,d\alpha=\rho^{-n}\int_{0}^{1}\exp\mathopen{}\mathclose{{}\left(\Psi(\rho
e(\alpha))-2\pi in\alpha}\right)\,d\alpha$

should depend on $n$. Having the advance knowledge that this integral is
dominated by the contributions from those $\alpha$ close to $0$,
$\frac{1}{2}$, and $1$, i.e., those $\alpha$ in $\mathfrak{P}$ and
$\mathfrak{P}_{*}$, we pick $\rho=\rho(n)$ and $\rho_{*}=\rho_{*}(n)$ so as to
individually minimize

$\displaystyle\rho^{-n}\exp\Psi(\rho)$
$\displaystyle=\exp\mathopen{}\mathclose{{}\left[\Psi(\rho)+\frac{n}{X}}\right]\qquad\text{and}\qquad\rho_{*}^{-n}\exp\Psi(-\rho_{*})=\exp\mathopen{}\mathclose{{}\left[\Psi(-\rho_{*})+\frac{n}{X_{*}}}\right]$

as functions of $n$. We first focus on minimizing $\exp(\Psi(\rho)+n/X)$.

It follows from Lemma 5.2 that

$\Psi(\rho)=\mathfrak{c}X+2\lambda\log
X+\Lambda+O(X^{-1/2})\qquad(X\to\infty),$ (6.1)

where $\mathfrak{c}=\tfrac{\pi^{2}}{24}(1-\tfrac{1}{p})$ and $\lambda$ and
$\Lambda$ are given in said lemma (though their particular values are not
relevant here), and thus

$\exp\mathopen{}\mathclose{{}\left[\Psi(\rho)+\frac{n}{X}}\right]=e^{\Lambda}\exp\mathopen{}\mathclose{{}\left[\frac{n}{X}+\mathfrak{c}X+2\lambda\log
X+O(X^{-1/2})}\right].$ (6.2)

Since the $O(X^{-1/2})$ term in (6.2) is $o(1)$ as $X\to\infty$, it is
reasonable to minimize $n/X+\mathfrak{c}X+2\lambda\log X$ as a function of $X$
there. This is minimized when $\mathfrak{c}X^{2}+2\lambda X-n=0$, i.e., when

$X=\big{(}\sqrt{\mathfrak{c}n+\lambda^{2}}-\lambda\big{)}/\mathfrak{c}.$ (6.3)

We thus define $X=X(n)$ by (6.3) and note that

$n/X=\mathfrak{c}X+2\lambda\qquad\text{and}\qquad
X=(n/\mathfrak{c})^{1/2}-\lambda/\mathfrak{c}+O(n^{-1/2}),$ (6.4)

where the latter relation holds as $n\to\infty$.

As Lemma 5.3 provides a formula for $\Psi(-\rho_{*})$ similar to (6.1), namely
the formula

$\Psi(-\rho_{*})=\mathfrak{c}X_{*}+2\lambda_{*}\log{X_{*}}+\Lambda_{*}+O(X_{*}^{-1/2})\qquad(X_{*}\to\infty),$

we are similarly led to define $X_{*}$ via

$X_{*}=\big{(}\sqrt{\mathfrak{c}n+\lambda_{*}^{2}}-\lambda_{*}\big{)}/\mathfrak{c}.$
(6.5)

Doing so, we similarly have

$n/X_{*}=\mathfrak{c}X_{*}+2\lambda_{*}\qquad\text{and}\qquad
X_{*}=(n/\mathfrak{c})^{1/2}-\lambda_{*}/\mathfrak{c}+O(n^{-1/2}),$ (6.6)

the latter statement again holding as $n\to\infty$.

##  7\. Arc transference and $*$-arcs

We now recall the “arc transference” of [daniels2023mobius]*sec. 9 used to
modify the contour of integration for

$\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int_{|z|=r}\Phi(z)z^{-n-1}\,dz=r^{-n}\int_{0}^{1}\exp\Psi(\rho
e(\alpha))e(-n\alpha)\,d\alpha,$ (7.1)

where again dashed integrals
$\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int$
abbreviate $\frac{1}{2\pi i}\int$. In this integral, control of our error
terms when $\alpha$ is near $0$ and $1$ requires that radius $r$ be set to
$\rho=\exp(-1/X)$ with $X$ defined as in (6.3). On the other hand, control of
our error terms in (7.1) for $\alpha$ near $\tfrac{1}{2}$ similarly requires
that $r=\rho_{*}=\exp(-1/X_{*})$ with $X_{*}$ is defined as in (6.5). Despite
the similar definitions of $X$ and $X_{*}$ in equations (6.3) and (6.5),
respectively, we cannot expect that $X$ and $X_{*}$ are equal in general.
Indeed, in section 11 we see that $X\neq X_{*}$ when $p\equiv
3\,\,(\mathrm{mod}\,\,8)$. Thus, a compromise is needed.

As $\Phi(z)$ is analytic for $|z|<1$, we split the interval $[0,1)$ into the
sets

$\mathscr{A}:=[0,\tfrac{1}{4})\cup[\tfrac{3}{4},1)\qquad\text{and}\qquad\mathscr{A}_{*}:=[\tfrac{1}{4},\tfrac{3}{4})$

and change the path of integration on the left side of (7.1) to be the
positively oriented path consisting of the two semicircles

$\rho e(\mathscr{A}):=\\{\rho
e(\alpha):\alpha\in\mathscr{A}\\}\qquad\text{and}\qquad\rho_{*}e(\mathscr{A}_{*}):=\\{\rho_{*}e(\alpha):\alpha\in\mathscr{A}_{*}\\}$

and the two connecting line segments $[i\rho,i\rho_{*}]$ and
$[-i\rho_{*},-i\rho]$. Using this new contour of integration in (7.1) we have

$\mathfrak{p}(n,\chi)=\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int_{\rho
e(\mathscr{A})}\Phi(z)z^{-n-1}\,dz+\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int_{\rho_{*}e(\mathscr{A}_{*})}\Phi(z)z^{-n-1}\,dz+\mathfrak{T}(\rho,\rho_{*}),$
(7.2)

where

$\mathfrak{T}(\rho,\rho_{*}):=\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int_{i\rho}^{i\rho_{*}}\Phi(z)z^{-n-1}\,dz+\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int_{-i\rho_{*}}^{-i\rho}\Phi(z)z^{-n-1}\,dz.$

As we now show, the transference term $\mathfrak{T}(\rho,\rho_{*})$ is small
compared to the main integrals in (7.2), both of which grow like
$n^{c_{0}}\exp(2\sqrt{\mathfrak{c}n})$ with
$\mathfrak{c}=\frac{\pi^{2}}{24}(1-\tfrac{1}{p})$ and some constant $c_{0}$,
as shown in sections 9 and 10.

######  Lemma 7.1.

Let $\mathfrak{c}=\frac{\pi^{2}}{24}(1-\tfrac{1}{p})$, let $\lambda$ and
$\lambda_{*}$ be real constants, and for $n>n_{0}$ let

$X=\big{(}\sqrt{\mathfrak{c}n+\lambda^{2}}-\lambda\big{)}/\mathfrak{c}\qquad\text{and}\qquad
X_{*}=\big{(}\sqrt{\mathfrak{c}n+\lambda_{*}^{2}}-\lambda_{*}\big{)}/\mathfrak{c}.$
(7.3)

As $n\to\infty$, one has

$\mathfrak{T}(\rho,\rho_{*})\ll\exp(\tfrac{3}{2}\sqrt{\mathfrak{c}n}).$

###### Proof.

Fix $\varepsilon>0$ and let $n>n_{0}$. It is evident that
$\mathfrak{T}(\rho,\rho_{*})=-\mathfrak{T}(\rho_{*},\rho)$, so there is no
loss of generality in assuming that $X\leq X_{*}$ and therefore that
$\rho\leq\rho_{*}$. We first note, by (7.3), that

$n/X=\mathfrak{c}X+2\lambda\qquad\text{and}\qquad
n/X_{*}=\mathfrak{c}X_{*}+2\lambda_{*},$

and further note that as $n\to\infty$ we have

$\displaystyle\mathfrak{c}X+2\lambda$
$\displaystyle=\sqrt{\mathfrak{c}n+\lambda^{2}}+\lambda=\sqrt{\mathfrak{c}n}+O(n^{-1/2}),$
$\displaystyle\mathfrak{c}X_{*}+2\lambda_{*}$
$\displaystyle=\sqrt{\mathfrak{c}n+\lambda_{*}^{2}}+\lambda_{*}=\sqrt{\mathfrak{c}n}+O(n^{-1/2}).$

Next observing that $\rho^{-n}=e^{n/X}$ and $\rho_{*}^{-n}=e^{n/X_{*}}$, it
thus follows that

$\displaystyle\begin{aligned}
\int_{\rho}^{\rho_{*}}\frac{dt}{t^{n+1}}=\frac{1}{n}(\rho^{-n}-\rho_{*}^{-n})=\frac{1}{n}(e^{\mathfrak{c}X+2\lambda}-e^{\mathfrak{c}X_{*}+2\lambda_{*}})\ll
e^{\sqrt{\mathfrak{c}n}}.\end{aligned}$ (7.4)

Now let $t=\exp(-1/X_{t})$ for $\rho\leq t\leq\rho_{*}$. Recalling that
$V_{4}(1)=V_{4}(3)=\frac{1}{4}$ from the remark following Proposition 4.1, we
have

$\operatorname{Re}\Psi(it)=\tfrac{1}{4}\mathfrak{c}X_{t}+O(X_{t}^{8/9})\leq\tfrac{1}{4}\mathfrak{c}X_{*}+O(X_{*}^{8/9})=\tfrac{1}{4}\sqrt{\mathfrak{c}n}+O(n^{4/9}),$
(7.5)

for $\rho\leq t\leq\rho_{*}$, which, for $n>n_{0}$, is less than
$(\tfrac{1}{4}+\varepsilon)\sqrt{\mathfrak{c}n}$. Using inequalities (7.4) and
(7.5) we find that

$\mathopen{}\mathclose{{}\left|\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int_{i\rho}^{i\rho_{*}}\Phi(z)z^{-n-1}\,dz}\right|\ll\exp((\tfrac{1}{4}+\varepsilon)\sqrt{\mathfrak{c}n})\int_{\rho}^{\rho_{*}}\frac{dt}{t^{n+1}}\ll\exp((\tfrac{5}{4}+\varepsilon)\sqrt{\mathfrak{c}n}),$

and the result follows by taking $\varepsilon$ to be sufficiently small. ∎

######  Corollary 7.2.

For $n>n_{0}$ let $\rho=e^{-1/X}$ and $\rho_{*}=e^{-1/X_{*}}$ with $X$ and
$X_{*}$ as defined in Lemma 7.1. As $n\to\infty$ one has

$\displaystyle\mathfrak{p}(n,\chi)$
$\displaystyle=\rho^{-n}\int_{\mathscr{A}}\Phi(\rho
e(\alpha))e(-n\alpha)\,d\alpha+\rho_{*}^{-n}\int_{\mathscr{A}_{*}}\Phi(\rho_{*}e(\alpha))e(-n\alpha)\,d\alpha+O\big{(}e^{\frac{3}{2}\sqrt{\mathfrak{c}n}}\big{)}.$

##  8\. The contributions of the nonprincipal arcs

We now show that for odd primes $p\neq 5$, the magnitude of $\Phi(\rho
e(\alpha))$ is largest when $\alpha$ is close to $0$, $1$, or $\frac{1}{2}$.
As $|\Phi(z)|=\exp(\operatorname{Re}\Psi(z))$, we accomplish this by using the
formulae of Proposition 4.1 to compare $\operatorname{Re}\Psi(\rho e(\alpha))$
for different $\alpha$. We again recall that

$\displaystyle\mathfrak{P}$ $\displaystyle=\\{\alpha\in[0,1):\|\alpha\|\leq
3/(8\pi X)\\},$ $\displaystyle\mathfrak{P}_{*}$
$\displaystyle=\\{\alpha\in[0,1):|\alpha-\tfrac{1}{2}|\leq 3/(8\pi X_{*})\\}.$

######  Lemma 8.1.

Let $p\neq 5$ be an odd prime and let $X$ and $X_{*}$ be sufficiently large.
There exists a constant $0<\delta<1$ such that: for all
$\alpha\in\mathscr{A}\setminus\mathfrak{P}$ one has

$\operatorname{Re}\Psi(\rho e(\alpha))\leq\delta\Psi(\rho),$ (8.1)

and for all $\alpha\in\mathscr{A}_{*}\setminus\mathfrak{P}_{*}$ one has

$\operatorname{Re}\Psi(\rho_{*}e(\alpha))\leq\delta\Psi(-\rho_{*}).$ (8.2)

###### Proof.

Letting $Q=X^{1/3}$, we suppose that $\alpha\in\mathscr{A}$ can be written as
$\alpha=a/q+\beta$ with $0\leq a\leq q\leq X^{1/3}$, $(a,q)=1$, and
$|\beta|\leq 1/(qX^{2/3})$. Defining

$\Delta=(1+4\pi^{2}X^{2}\beta^{2})^{-1/2}\qquad\text{and}\qquad\varphi=\arctan(2\pi
X\beta)$

with $\arctan(u)\in(-\tfrac{\pi}{2},\tfrac{\pi}{2})$, equation (4.6) states
that

$\Psi(\rho e(\alpha))=V_{q}(a)\mathfrak{c}X\Delta e^{i\varphi}+O(X^{8/9}).$

Recalling that $V_{1}(1)=1$ (which we reconfirmed in Lemma 5.2) we have

$\Psi(\rho)=\mathfrak{c}X+O(X^{8/9}),$

and thus to establish inequality (8.1) it suffices to show that

$\operatorname{Re}(V_{q}(a)\Delta e^{i\varphi})\leq\delta\qquad\text{for some
$\delta<1$.}$ (8.3)

If $q>2$ and $(p,q)=1$, then $V_{q}(a)\leq 1/4$ by (4.7). As $V_{q}(a)<0$ when
$2p\mid q$, inequality (8.3) holds _a-fortiori_ as $X\to\infty$. It thus
remains to consider those $a$ and $q$ such that $p\mid q$ but $2\nmid q$, say
$q=(2r-1)p$ with $r\in\mathbb{N}$. Here

$V_{q}(a)\Delta
e^{i\varphi}=\mathopen{}\mathclose{{}\left[\chi(a)G(\chi)\mathopen{}\mathclose{{}\left(1-\frac{\chi(2)}{4}}\right)\frac{L_{2}(\chi)}{\mathfrak{c}}-1}\right]\frac{\Delta
e^{i\varphi}}{(2r-1)^{2}p},$ (8.4)

and since we are interested in bounding (8.4) from above, it suffices to let
$r=1$.

To handle the cumbersome term in square brackets in (8.4), it is convenient to
let

$W_{p}=\mathopen{}\mathclose{{}\left(1-\frac{\chi(2)}{4}}\right)\frac{L_{2}(\chi)}{\mathfrak{c}}=\frac{(4-\chi(2))L_{2}(\chi)}{(1-1/p)\zeta(2)}\qquad(\text{since
$\mathfrak{c}=\tfrac{1}{4}(1-\tfrac{1}{p})\zeta(2)$})$

and record the following crude bounds on $W_{p}$. First, we have

$L_{2}(\chi)=\prod_{\begin{subarray}{c}\ell\text{ prime}\\\ \ell\neq
p\end{subarray}}\Big{(}\frac{1}{1-\chi(\ell)\ell^{-2}}\Big{)}\geq\prod_{\begin{subarray}{c}\ell\text{
prime}\\\ \ell\neq
p\end{subarray}}\Big{(}\frac{1}{1+\ell^{-2}}\Big{)}=(1+p^{-2})\frac{\zeta(4)}{\zeta(2)}$

and

$L_{2}(\chi)=\sum_{k=1}^{\infty}\frac{\chi(k)}{k^{2}}\leq\sum_{k=1}^{\infty}\frac{\chi_{0}(k)}{k^{2}}=(1-p^{-2})\zeta(2).$

Since $\frac{\zeta(4)}{\zeta(2)}=\frac{\pi^{2}}{15}=\frac{2}{5}\zeta(2)$ we
have $L_{2}(\chi)\geq\frac{2}{5}(1+p^{-2})\zeta(2)$, and we deduce that

$1<\tfrac{2}{5}(4-\chi(2))\mathopen{}\mathclose{{}\left(\frac{1+p^{-2}}{1-p^{-1}}}\right)\leq
W_{p}\leq(4-\chi(2))(1+\tfrac{1}{p}).$ (8.5)

We now recall the classical fact that the Gauss sum $G(\chi_{p})=\sqrt{p}$ if
$p\equiv 1\,\,(\mathrm{mod}\,\,4)$ and $G(\chi_{p})=i\sqrt{p}$ if $p\equiv
3\,\,(\mathrm{mod}\,\,4)$, and we first consider the case of $p\equiv
1\,\,(\mathrm{mod}\,\,4)$. As $\Delta\leq 1$, it follows from (8.4) and (8.5)
that

$\operatorname{Re}(V_{q}(a)\Delta e^{i\varphi})\leq(\sqrt{p}W_{p}-1)/p,$

and thus it suffices to show that $(\sqrt{p}W_{p}-1)/p<1$. Numerical estimates
show that, among primes $p>5$ such that $p\equiv 1\,\,(\mathrm{mod}\,\,4)$,
one has

$\frac{\sqrt{p}W_{p}-1}{p}\leq
W_{13}=\frac{1}{13}\bigg{(}\frac{65\sqrt{13}}{2\pi^{2}}L_{2}(\chi_{13})-1\bigg{)}\approx
0.69,$

which validates inequality (8.3) when $p\equiv 1\,\,(\mathrm{mod}\,\,4)$ (and
$p\neq 5$) and $\alpha\in\mathscr{A}\cap\mathfrak{M}(\tfrac{a}{(2r-1)p})$.

We remark that since $L_{2}(\chi_{5})=\tfrac{4\pi^{2}\sqrt{5}}{125}$ (see,
e.g., Lemma A.5), one has

$\tfrac{1}{5}(\sqrt{5}W_{5}-1)=1,$

which implies that $V_{5}(1)=V_{5}(4)=1$, and thus that $\Psi(\rho
e(\frac{1}{5}))$ and $\Psi(\rho e(\tfrac{4}{5}))$ are both “on par” with
$\Psi(\rho)$ and $\Psi(-\rho_{*})$ as $\rho$ and $\rho_{*}$ tend to $1$. This
is precisely why we specially treat $\Psi(z,\chi_{5})$ and
$\mathfrak{p}(n,\chi_{5})$ in section 12.

Returning to (8.4), suppose now that $p\equiv 3\,\,(\mathrm{mod}\,\,4)$. Now
$G(\chi)=i\sqrt{p}$, whereby

$V_{q}(a)\Delta
e^{i\varphi}=\frac{1}{p}\big{(}i\chi(a)\sqrt{p}W_{p}-1\big{)}\Delta
e^{i\varphi}.$

Since

$e^{i\varphi}=\frac{1+i(2\pi
X\beta)}{(1+4\pi^{2}X^{2}\beta^{2})^{1/2}}=\Delta(1+i(2\pi X\beta))$

and $\Delta^{2}=(1+(2\pi X\beta)^{2})^{-1}$, we have

$\operatorname{Re}(V_{q}(a)\Delta e^{i\varphi})=\frac{-1-(2\pi
X\beta)\chi(a)\sqrt{p}W_{p}}{(1+(2\pi X\beta)^{2})p}.$ (8.6)

As we are interested in bounding (8.6) above by some $\delta<1$, it suffices
to let $\chi(a)=-1$ and $\beta>0$, set $u:=(2\pi X\beta)$, and show that

$\frac{-1+u\sqrt{p}W_{p}}{(1+u^{2})p}<1,\qquad\text{i.e., that}\qquad
u^{2}-(W_{p}/\sqrt{p})u+(1+1/p)>0,$

for _all_ $u\in\mathbb{R}$. This holds if and only if
$(1+1/p)>W_{p}^{2}/(4p)$, or equivalently if and only if
$W_{p}^{2}/(4(p+1))<1$. Using the crude bound (8.5) we have

$\frac{W^{2}_{p}}{4(p+1)}\leq\frac{(4-\chi(2))^{2}(1+1/p)^{2}}{4(p+1)},$ (8.7)

and for $p\geq 7$ the right side of (8.7) is maximized when $p=11$ (regardless
of the residue of $p$ modulo 4), where it has value $\tfrac{300}{484}\approx
0.62$. Numerically computing $W_{3}^{2}/16$ we have

$\frac{W^{2}_{3}}{16}=\frac{1}{16}\mathopen{}\mathclose{{}\left(\frac{5L_{2}(\chi_{3})}{(2/3)\zeta(2)}}\right)^{2}\approx
0.79,$

and therefore inequality (8.3) holds when $p\equiv 3\,\,(\mathrm{mod}\,\,4)$
and $\alpha\in\mathscr{A}\cap\mathfrak{M}(\tfrac{a}{(2r-1)p})$.

Finally it remains to handle those
$\alpha\in(\mathfrak{M}(\frac{0}{1})\cup\mathfrak{M}(\frac{1}{1}))\setminus\mathfrak{P}$.
However, if $\alpha=\beta\in\mathfrak{M}(\frac{0}{1})$ or
$\alpha=1-\beta\in\mathfrak{M}(\frac{1}{1})$ with $\beta\geq 3/(8\pi X)$, then
inequality (8.3) is immediate since

$\Delta\leq(1+\tfrac{36}{64})^{-1/2}<1,$

completing the proof of inequality (8.1). The arguments for
$\alpha\in\mathscr{A}_{*}\setminus\mathfrak{P}_{*}$ and (8.2) are identical,
mutatis mutandis. ∎

Recalling the result of Corollary 7.2, we now use Lemma 8.1 to further isolate
the main terms in our asymptotic formula for $\mathfrak{p}(n,\chi_{p})$, which
we recall are ultimately of order $n^{c_{0}}\exp(2\sqrt{\mathfrak{c}n})$ for
some $c_{0}$.

######  Proposition 8.2.

Let $p\neq 5$ be an odd prime, let
$\mathfrak{c}=\tfrac{\pi^{2}}{24}(1-\tfrac{1}{p})$, let $\lambda$ and
$\lambda_{*}$ be real constants, and for $n>n_{0}$ let

$X=\big{(}\sqrt{\mathfrak{c}n+\lambda^{2}}-\lambda\big{)}/\mathfrak{c}\qquad\text{and}\qquad
X_{*}=\big{(}\sqrt{\mathfrak{c}n+\lambda_{*}^{2}}-\lambda_{*}\big{)}/\mathfrak{c}.$
(8.8)

For some constant $\delta>0$, as $n\to\infty$ one has

$\mathfrak{p}(n,\chi_{p})=\rho^{-n}\int_{\mathfrak{P}}\Phi(\rho
e(\alpha))e(-n\alpha)\,d\alpha+\rho_{*}^{-n}\int_{\mathfrak{P}_{*}}\Phi(\rho_{*}e(\alpha))e(-n\alpha)\,d\alpha+O(e^{(2-\delta)\sqrt{\mathfrak{c}n}}).$

###### Proof.

Recalling from Lemma 5.2 that

$\Psi(\rho)=\mathfrak{c}X+2\lambda\log X+\Lambda+O(X^{-1/2}),$

with $\lambda$ and $\Lambda$ given in said lemma (though the values are
irrelevant here), Lemma 8.1 implies the existence of some $\delta_{1}<1$ such
that

$\displaystyle\rho^{-n}\int_{\mathscr{A}\setminus\mathfrak{P}}\Phi(\rho
e(\alpha))e(-n\alpha)\,d\alpha\ll\rho^{-n}e^{\delta_{1}\Psi(\rho)}\ll\exp\mathopen{}\mathclose{{}\left(n/X+\delta_{1}\mathfrak{c}X+2\delta_{1}\lambda\log
X}\right).$ (8.9)

As $\delta_{1}\mathfrak{c}X+2\delta_{1}\lambda\log X<\delta_{2}\mathfrak{c}X$
for some $\delta_{1}<\delta_{2}<1$ and all $X>X_{0}(\delta_{1})$, equations
(8.8) imply that

$n/X+\delta_{1}\mathfrak{c}X+2\delta_{1}\lambda\log
X<(1+\delta_{2})\mathfrak{c}X+2\lambda=(1+\delta_{2})\sqrt{\mathfrak{c}n+\lambda^{2}}+(1-\delta_{2})\lambda.$

Since

$(1+\delta_{2})\sqrt{\mathfrak{c}n+\lambda^{2}}+(1-\delta_{2})\lambda\sim(1+\delta_{2})\sqrt{\mathfrak{c}n}<(2-\delta_{3})\sqrt{\mathfrak{c}n}$

for some $\delta_{3}>0$ as $n\to\infty$, it follows that

$\exp(n/X+\delta_{1}\mathfrak{c}X+2\delta_{1}\lambda\log
X)\ll\exp((2-\delta_{3})\sqrt{\mathfrak{c}n}),$

and thus from (8.9) we conclude that

$\rho^{-n}\int_{\mathscr{A}\setminus\mathfrak{P}}\exp(\Psi(\rho
e(\alpha))-2\pi
in\alpha)\,d\alpha\ll\exp((2-\delta_{3})\sqrt{\mathfrak{c}n}).$

An analogous argument using Lemmata 5.3 and 8.1 and equations (8.8) provides a
similar bound for the integral over
$\mathscr{A}_{*}\setminus\mathfrak{P}_{*}$, and by assuming, without loss of
generality, that $\delta_{3}$ is small enough that $3/2<2-\delta_{3}$, we
obtain the result by taking $\delta=\delta_{3}$. ∎

##  9\. The principal integrals

We now apply the formulae of sections 5 and 6 to derive asymptotic formulae
for the integrals over $\mathfrak{P}$ and $\mathfrak{P}_{*}$ in Proposition
8.2. As the arguments for both integrals are so similar, and because we must
later consider other “principal” integrals in sections 12 and 13, we handle
these cases simultaneously in the following general proposition.

######  Proposition 9.1.

Let $\mathfrak{c}$, $\kappa$, and $K$ be constants dependent on $p$, $q$ and
$a$, with $\mathfrak{c}>0$, and suppose that for $n>n_{0}$ one has

$X=\big{(}\sqrt{\mathfrak{c}n+\kappa^{2}}-\kappa\big{)}/\mathfrak{c}$ (9.1)

and

$\Psi(\rho e(\tfrac{a}{q}+\beta))=\frac{\mathfrak{c}X}{1-2\pi
iX\beta}+2\kappa\log\mathopen{}\mathclose{{}\left(\frac{X}{1-2\pi
iX\beta}}\right)+K+O(X^{-1/2}).$ (9.2)

Then, as $n\to\infty$, one has

$\rho^{-n}\int_{\mathfrak{P}(a/q,X)}\Phi(\rho
e(\alpha))e(-n\alpha)\,d\alpha=e\Big{(}\frac{-na}{q}\Big{)}\mathopen{}\mathclose{{}\left(\frac{n}{\mathfrak{c}}}\right)^{\kappa}e^{K}\frac{\mathfrak{c}^{1/4}e^{2\sqrt{\mathfrak{c}n}}}{(4\pi)^{1/2}n^{3/4}}\mathopen{}\mathclose{{}\left[1+O(n^{-1/5})}\right],$
(9.3)

where

$\mathfrak{P}(a/q,X)=\\{a/q+\beta:\beta\in\mathbb{R}\text{ and }|\beta|\leq
3/(8\pi X)\\}.$

######  Remark 9.2.

In the following proof, quantities $c_{0},c_{1},\ldots$ denote positive
constants.

###### Proof.

By (9.1), as $n\to\infty$ we have

$n/X=\mathfrak{c}X+2\kappa\qquad\text{and}\qquad
X=(n/\mathfrak{c})^{1/2}-\kappa/\mathfrak{c}+O(n^{-1/2}).$ (9.4)

We start by writing the integral (9.3) as

$\int_{|\beta|\leq\frac{3}{8\pi X}}\rho^{-n}\exp\\!\big{[}\Psi(\rho
e(\tfrac{a}{q}+\beta))-2\pi in(\tfrac{a}{q}+\beta)\big{]}\,d\beta.$ (9.5)

Writing $\rho e(\beta)=\exp(X^{-1}(1-2\pi iX\beta))$, we observe that under
the change of variable $t=2\pi X\beta$, formula (9.2) states that

$\Psi\mathopen{}\mathclose{{}\left(e(\tfrac{a}{q})e^{\frac{1}{X}(1-it)}}\right)=\frac{\mathfrak{c}X}{1-it}+2\kappa\log\mathopen{}\mathclose{{}\left(\frac{X}{1-it}}\right)+K+O(X^{-1/2}).$
(9.6)

Making said change of variable in (9.5), the integral therein becomes

$\frac{e(-na/q)}{2\pi
X}\int_{-\frac{3}{4}}^{\frac{3}{4}}\exp\mathopen{}\mathclose{{}\left[\Psi\mathopen{}\mathclose{{}\left(e^{\frac{1}{X}(1-it)}}\right)+\frac{n}{X}(1-it)}\right]\,dt.$

Now letting

$\Theta(t,X):=\frac{n}{X}(1-it)+\frac{\mathfrak{c}X}{1-it}+2\kappa\log\mathopen{}\mathclose{{}\left(\frac{X}{1-it}}\right),$

formulae (9.6) and (9.4) imply that (9.5) is

$=e\mathopen{}\mathclose{{}\left(\frac{-na}{q}}\right)\frac{e^{K}}{2\pi
X}\mathopen{}\mathclose{{}\left[1+O(n^{-1/4})}\right]\int_{-\frac{3}{4}}^{\frac{3}{4}}\exp\Theta(t,X)\,dt.$
(9.7)

In light of (9.7), we focus on the integral
$\int_{-\frac{3}{4}}^{\frac{3}{4}}\exp\Theta(t,X)\,dt$. For $|t|<\tfrac{3}{4}$
set

$\Delta:=(1+t^{2})^{-\frac{1}{2}}\qquad\text{and}\qquad\varphi:=\arctan
t=t-\tfrac{1}{3}t^{3}+\tfrac{1}{5}t^{5}-\cdots$ (9.8)

so that

$(1-it)^{-1}=\Delta
e^{i\varphi}\qquad\text{and}\qquad\log\mathopen{}\mathclose{{}\left(\frac{X}{1-it}}\right)=\log
X\Delta+i\varphi.$

With these, now

$\Theta(t,X)=(1-it)(\mathfrak{c}X+2\kappa)+\mathfrak{c}X\Delta
e^{i\varphi}+2\kappa(\log X\Delta+i\varphi).$ (9.9)

When $|t|<\tfrac{3}{4}$ we have $\tfrac{4}{5}<\Delta\leq 1$ and

$\Delta^{2}=(1+t^{2})^{-1}\leq 1-t^{2}+t^{4}\leq 1-\tfrac{2}{5}t^{2},$

and because $\cos\varphi=\Delta$ and $X$ is large we find that

$\displaystyle\operatorname{Re}\Theta(t,X)$
$\displaystyle\leq\mathfrak{c}X+2\kappa+\mathfrak{c}X(1-\tfrac{2}{5}t^{2})+2\kappa\log
X+2\kappa\log{\Delta}$ (9.10) $\displaystyle\leq
2\mathfrak{c}X+2\kappa+2\kappa\log X-\tfrac{2}{5}\mathfrak{c}Xt^{2}+c_{0}.$

For the remainder of the proof it is convenient to let

$\delta:=X^{-1/2}(\log X)^{3/2}\qquad\text{and}\qquad
Y:=2(\mathfrak{c}X+\kappa).$

If $|t|\geq\delta$, then

$-\tfrac{2}{5}\mathfrak{c}Xt^{2}+c_{0}<-\tfrac{2}{5}\mathfrak{c}(\log
X)^{3}+c_{0}<-c_{1}(\log X)^{3}.$ (9.11)

Since $-c_{1}(\log X)^{3}\sim-c_{2}(\log n)^{3}$ by (9.1), it follows from
(9.10) and (9.11) that

$\int_{\delta\leq|t|<\frac{3}{4}}\exp\Theta(t,X)\,dt\ll
X^{2\kappa}e^{Y}\exp(-c_{1}(\log X)^{3})\ll X^{2\kappa}e^{Y}n^{-B}$ (9.12)

for any $B>0$ and $n>n_{0}(B)$.

It thus remains to consider the integral in (9.7) for $|t|<\delta$. In
equation (9.9) we now express $\Delta e^{i\varphi}=(1-it)^{-1}$ as a geometric
series and express $\varphi$ using (9.8), so that

$\displaystyle\Theta(t,X)$
$\displaystyle=(1-it)(\mathfrak{c}X+2\kappa)+\mathfrak{c}X(1+it-t^{2}+O(|t|^{3}))$
$\displaystyle\qquad+2\kappa\mathopen{}\mathclose{{}\left(\log
X\Delta+it+O(|t|^{3})}\right)$ $\displaystyle=Y+2\kappa\log
X-\mathfrak{c}Xt^{2}-\kappa\log(1+t^{2})+O(X\delta^{3})$
$\displaystyle=Y+2\kappa\log X-\tfrac{1}{2}Yt^{2}+O(t^{4})+O(X\delta^{3}).$

As $t^{4}\leq\delta^{4}\leq X\delta^{3}$and $X\delta^{3}=X^{-1/2}(\log
X)^{9/2}\ll n^{-1/5}$, we deduce that

$\Theta(t,X)=Y+2\kappa\log
X-\tfrac{1}{2}Yt^{2}+O(n^{-1/5})\qquad(|t|<\delta).$

We thus have

$\int_{-\delta}^{\delta}\exp\Theta(t,x)\,dt=X^{2\kappa}e^{Y}\mathopen{}\mathclose{{}\left[1+O(n^{-1/5})}\right]\int_{-\delta}^{\delta}e^{-\tfrac{1}{2}Yt^{2}}\,dt.$

As
$\int_{\delta}^{\infty}\exp(-\tfrac{1}{2}Yt^{2})\,dt\ll(Y\delta)^{-1}\exp(-\tfrac{1}{2}Y\delta^{2})$
and $Y\asymp X\asymp\sqrt{n}$, we have

$\int_{-\delta}^{\delta}e^{-\frac{1}{2}Yt^{2}}\,dt-\sqrt{\frac{2\pi}{Y}}\ll\frac{\exp(-c_{3}(\log
X)^{3})}{X^{1/2}(\log X)^{3/2}}\ll\exp(-c_{4}(\log n)^{3})\ll n^{-B}$

for any $B>0$ and all $n>n_{0}(B)$. Since
$Y=2\sqrt{\mathfrak{c}n+\kappa^{2}}\sim 2\sqrt{\mathfrak{c}n}$ and $B$ can be
arbitrarily large, it follows that

$\displaystyle\int_{-\delta}^{\delta}\exp\Theta(t,X)\,dt$
$\displaystyle=X^{2\kappa}e^{Y}\mathopen{}\mathclose{{}\left[1+O(n^{-\frac{1}{5}})}\right]\bigg{[}\sqrt{\frac{2\pi}{Y}}+O(n^{-B})\bigg{]}$
(9.13)
$\displaystyle=X^{2\kappa}e^{Y}\sqrt{\frac{2\pi}{Y}}\mathopen{}\mathclose{{}\left[1+O(n^{-\frac{1}{5}})}\right]$

Using (9.12) and (9.13) in (9.7) then, and again using the facts that $Y\sim
2\sqrt{\mathfrak{c}n}$ and that $B>0$ can be arbitrary, we deduce that

$\frac{e^{K}}{2\pi
X}\mathopen{}\mathclose{{}\left[1+O(n^{-1/4})}\right]\int_{-\frac{3}{4}}^{\frac{3}{4}}\exp\Theta(t,X)\,dt=e^{K}\frac{X^{2\kappa-1}e^{Y}}{\sqrt{2\pi
Y}}\mathopen{}\mathclose{{}\left[1+O(n^{-1/5})}\right].$

Finally, using the asymptotic relations

$X=\sqrt{n/\mathfrak{c}}+O(n^{-1/2})\qquad\text{and}\qquad
Y=2\sqrt{\mathfrak{c}n}+O(n^{-1}),$

we find that

$e^{K}\frac{X^{2\kappa-1}e^{Y}}{\sqrt{2\pi
Y}}\mathopen{}\mathclose{{}\left[1+O(n^{-1/5})}\right]=\mathopen{}\mathclose{{}\left(\frac{n}{\mathfrak{c}}}\right)^{\kappa}e^{K}\frac{\mathfrak{c}^{1/4}e^{2\sqrt{\mathfrak{c}n}}}{(4\pi)^{1/2}n^{3/4}}\mathopen{}\mathclose{{}\left[1+O(n^{-1/5})}\right],$

completing the proof of the proposition. ∎

##  10\. A general asymptotic formula

After briefly recalling the pertinent results and constants from the preceding
sections, we now apply our results to derive a general asymptotic formula for
$\mathfrak{p}(n,\chi_{p})$, again excluding the case of $p=5$. We first recall
the constants

$\kappa=\pi\sqrt{\tfrac{2}{3}}\qquad\text{and}\qquad\mathfrak{c}=\frac{\pi^{2}}{24}\mathopen{}\mathclose{{}\left(1-\frac{1}{p}}\right)$
(10.1)

and recall Hardy and Ramanujan’s “benchmark” formula

$\mathfrak{p}(n,1)\sim(4\sqrt{3})^{-1}n^{-1}\exp\mathopen{}\mathclose{{}\left(\kappa\sqrt{n}}\right)\mathopen{}\mathclose{{}\left[1+O(n^{-1/5})}\right].$

Again writing

$L_{r}(\chi)=L(r,\chi)\qquad\text{and}\qquad
L_{r}^{\prime}(\chi)=L^{\prime}(r,\chi)\qquad(\text{for $r=0,1$}),$

Lemmata 5.2 and 5.3 establish that

$\displaystyle\Psi(\rho)$ $\displaystyle=\mathfrak{c}X+2\lambda\log
X+\Lambda+O(X^{-1/2}),\qquad(X\to\infty)$ (10.2)
$\displaystyle\Psi(-\rho_{*})$
$\displaystyle=\mathfrak{c}X_{*}+2\lambda_{*}\log{X_{*}}+\Lambda_{*}+O(X_{*}^{-1/2})\qquad(X_{*}\to\infty),$
(10.3)

respectively, where

$\lambda=\tfrac{1}{4}L_{0}(\chi),\qquad\Lambda=\tfrac{1}{2}\mathopen{}\mathclose{{}\left[L_{0}^{\prime}(\chi)+L_{0}(\chi)\log{2}}\right]-\tfrac{1}{4}\log{p},$
(10.4)
$\lambda_{*}=\tfrac{1}{4}(2\chi(2)-1)L_{0}(\chi),\qquad\Lambda_{*}=\tfrac{1}{2}\mathopen{}\mathclose{{}\left[(2\chi(2)-1)L_{0}^{\prime}(\chi)-L_{0}(\chi)\log{2}}\right]-\tfrac{1}{4}\log{p}.$
(10.5)

Again defining

$X=(\sqrt{\mathfrak{c}n+\lambda^{2}}-\lambda)/\mathfrak{c}\qquad\text{and}\qquad
X_{*}=(\sqrt{\mathfrak{c}n+\lambda_{*}^{2}}-\lambda_{*})/\mathfrak{c},$ (10.6)

Proposition 8.2 establishes that

$\mathfrak{p}(n,\chi)=\rho^{-n}\int_{\mathfrak{P}}\Phi(\rho
e(\alpha))e(-n\alpha)\,d\alpha+\rho_{*}^{-n}\int_{\mathfrak{P}_{*}}\Phi(\rho_{*}e(\alpha))e(-n\alpha)\,d\alpha+O(e^{(2-\delta)\sqrt{\mathfrak{c}n}})$
(10.7)

for some $\delta>0$, and, using (10.2)–(10.6), Proposition 9.1 provides
asymptotic formulae for the integrals over $\mathfrak{P}$ and
$\mathfrak{P}_{*}$ in (10.7). In particular, Proposition 9.1 implies that

$\displaystyle\mathfrak{p}(n,\chi)$
$\displaystyle=\mathopen{}\mathclose{{}\left(\frac{n}{\mathfrak{c}}}\right)^{\lambda}e^{\Lambda}\frac{\mathfrak{c}^{1/4}e^{2\sqrt{\mathfrak{c}n}}}{(4\pi)^{1/2}n^{3/4}}\mathopen{}\mathclose{{}\left[1+O(n^{-\frac{1}{5}})}\right]+(-1)^{n}\mathopen{}\mathclose{{}\left(\frac{n}{\mathfrak{c}}}\right)^{\lambda_{*}}e^{\Lambda_{*}}\frac{\mathfrak{c}^{1/4}e^{2\sqrt{\mathfrak{c}n}}}{(4\pi)^{1/2}n^{3/4}}\mathopen{}\mathclose{{}\left[1+O(n^{-\frac{1}{5}})}\right]$
(10.8) $\displaystyle\qquad+O(e^{(2-\delta)\sqrt{\mathfrak{c}n}}).$

Because the first term on the righthand side here is $\asymp
n^{\lambda-3/4}\exp(2\sqrt{\mathfrak{c}n})$, we absorb the error term
$O(e^{(2-\delta)\sqrt{\mathfrak{c}n}})$ into this expression and collect
constants to write

$\mathfrak{p}(n,\chi)=\mathfrak{a}_{p}n^{-3/4}\exp(2\sqrt{\mathfrak{c}n})\mathopen{}\mathclose{{}\left[n^{\lambda}(1+O(n^{-1/5}))+(-1)^{n}\mathfrak{b}_{p}n^{\lambda_{*}}(1+O(n^{-1/5}))}\right],$
(10.9)

where

$\mathfrak{a}_{p}:=(4\pi)^{-1/2}\mathfrak{c}^{1/4-\lambda}e^{\Lambda}\qquad\text{and}\qquad\mathfrak{b}_{p}:=\mathfrak{c}^{\lambda-\lambda_{*}}e^{\Lambda_{*}-\Lambda}.$

For the moment assume that all $L_{0}(\chi)\geq 0$. Then, using (10.4) and
(10.5), we have

$\lambda_{*}-\lambda=\tfrac{1}{2}(\chi(2)-1)L_{0}(\chi)\leq 0,$ (10.10)

so we further extract a factor of $n^{\lambda}$ from the square bracketed term
in (10.9), and rewrite

$2\sqrt{\mathfrak{c}n}=2\sqrt{\tfrac{\pi^{2}}{24}(1-\tfrac{1}{p})n}=\tfrac{1}{2}\kappa\sqrt{(1-\tfrac{1}{p})n}\qquad(\kappa=\pi\sqrt{2/3}),$

to finally establish the asymptotic formula

$\mathfrak{p}(n,\chi_{p})=\mathfrak{a}_{p}n^{\lambda-3/4}\exp\mathopen{}\mathclose{{}\left(\tfrac{1}{2}\kappa\sqrt{(1-\tfrac{1}{p})n}\,}\right)\mathopen{}\mathclose{{}\left[1+(-1)^{n}\mathfrak{b}_{p}n^{\lambda_{*}-\lambda}+O(n^{-1/5})}\right],$
(10.11)

where again

$\mathfrak{a}_{p}=(4\pi)^{-1/2}\mathfrak{c}^{1/4-\lambda}e^{\Lambda}\qquad\text{and}\qquad\mathfrak{b}_{p}=\mathfrak{c}^{\lambda-\lambda_{*}}e^{\Lambda_{*}-\Lambda}.$

In order to “unpack” the formulae for $\lambda$, $\Lambda$, etc., we record
several basic facts regarding Dirichlet $L$-functions. Using the well-known
the functional equation

$L(s,\chi)=\frac{G(\chi)}{i^{\nu}\pi}\mathopen{}\mathclose{{}\left(\frac{2\pi}{p}}\right)^{s}L(1-s,\bar{\chi})\Gamma(1-s)\sin\tfrac{\pi}{2}(s+\nu),\quad\text{where}\quad\nu=\begin{cases}0&p\equiv
1\,(4)\\\ 1&p\equiv 3\,(4)\end{cases},$

see, e.g., [montgomery2007multiplicative]*Cor. 10.9, one may quickly check
that

$L_{0}(\chi)=\begin{cases}0&p\equiv 1\,\,(\mathrm{mod}\,\,4),\\\
\tfrac{1}{\pi}\sqrt{p}L_{1}(\chi)&p\equiv
3\,\,(\mathrm{mod}\,\,4),\end{cases}$ (10.12)

and

$L_{0}^{\prime}(\chi)=\begin{cases}\tfrac{1}{2}\sqrt{p}L_{1}(\chi)&p\equiv
1\,\,(\mathrm{mod}\,\,4),\\\
\tfrac{1}{\pi}\sqrt{p}L_{1}(\chi)\mathopen{}\mathclose{{}\left(\gamma+\log(\frac{2\pi}{p})-\frac{L_{1}^{\prime}(\chi)}{L_{1}(\chi)}}\right)&p\equiv
3\,\,(\mathrm{mod}\,\,4),\end{cases}$ (10.13)

where $\gamma$ is the Euler-Mascheroni constant. Finally, as mentioned in
section 1 one has

$L_{1}(\chi_{p})>0$ (10.14)

for all $p$, and indeed this inequality holds for all nonprincipal quadratic
characters. For completeness, a sketch of this is included in the appendix. We
note that by (10.12) and (10.14), our assumption that $L_{0}(\chi)\geq 0$ in
(10.10) is validated.

##  11\. Formulae for different residues modulo 8

When $p\equiv 1\,\,(\mathrm{mod}\,\,4)$, many of our computations and formulae
are greatly simplified by the fact that $L_{0}(\chi)=0$, since in this case
$\lambda=\lambda_{*}=0$ and thus formula (10.11) reduces to

$\mathfrak{p}(n,\chi)=\mathfrak{a}_{p}n^{-3/4}\exp\\!\Big{(}\tfrac{1}{2}\kappa\sqrt{(1-\tfrac{1}{p})n}\,\Big{)}\mathopen{}\mathclose{{}\left[2+(-1)^{n}\mathfrak{b}_{p}+O(n^{-1/5})}\right]$
(11.1)

with

$\kappa=\pi\sqrt{2/3},\quad\mathfrak{a}_{p}=2^{-7/4}3^{-1/4}(1-p^{-1})^{1/4}e^{\Lambda},\quad\text{and}\quad\mathfrak{b}_{p}=e^{\Lambda_{*}-\Lambda}.$

From (10.4) and (10.13) we have

$\Lambda=\tfrac{1}{2}L_{0}^{\prime}(\chi)-\tfrac{1}{4}\log{p}=\tfrac{1}{4}\sqrt{p}L_{1}(\chi)-\tfrac{1}{4}\log{p},$

so that, regardless of the value of $\chi(2)$, the constant $\mathfrak{a}_{p}$
has formula

$\mathfrak{a}_{p}=2^{-7/4}3^{-1/4}(p^{-1}-p^{-2})^{1/4}\exp(\tfrac{1}{4}\sqrt{p}L_{1}(\chi)).$
(11.2)

By (10.5) and (10.13) we have

$\Lambda_{*}-\Lambda=(\chi(2)-1)L_{0}^{\prime}(\chi)=\tfrac{1}{2}(\chi(2)-1)\sqrt{p}L_{1}(\chi),$

and it follows that

$\mathfrak{b}_{p}=e^{\Lambda_{*}-\Lambda}=\begin{cases}1&p\equiv
1\,\,(\mathrm{mod}\,\,8),\\\ \exp(-\sqrt{p}L_{1}(\chi))&p\equiv
5\,\,(\mathrm{mod}\,\,8).\end{cases}$ (11.3)

Thus, the formulae of Theorem 1.3 are established.

###  11.1. Formulae for $p\equiv 3\,\,(\mathrm{mod}\,\,4)$

When $p\equiv 3\,\,(\mathrm{mod}\,\,4)$ our formulae become noticeably more
complicated, especially with respect to the values of $\mathfrak{a}_{p}$ and
$\mathfrak{b}_{p}$. Our asymptotic formulae when $p\equiv
3\,\,(\mathrm{mod}\,\,4)$ and $\chi(2)=+1$, i.e., when $p\equiv
7\,\,(\mathrm{mod}\,\,8)$ are somewhat simpler than those for $p\equiv
3\,\,(\mathrm{mod}\,\,8)$, so we consider the former case first.

When $p\equiv 7\,\,(\mathrm{mod}\,\,8)$, from (10.4), (10.5), and (10.12) we
have

$\lambda=\lambda_{*}=\tfrac{1}{4}L_{0}(\chi)=\sqrt{p}L_{1}(\chi)/(4\pi),$

so that

$\mathfrak{p}(n,\chi)=\mathfrak{a}_{p}n^{\sqrt{p}L_{1}(\chi)/(4\pi)-3/4}\exp\mathopen{}\mathclose{{}\left(\tfrac{1}{2}\kappa\sqrt{(1-\tfrac{1}{p})n}\,}\right)\mathopen{}\mathclose{{}\left[1+(-1)^{n}\mathfrak{b}_{p}+O(n^{-1/5})}\right],$

with

$\kappa=\pi\sqrt{2/3},\qquad\mathfrak{b}_{p}=e^{\Lambda_{*}-\Lambda}=e^{-L_{0}(\chi)\log{2}}=2^{-\sqrt{p}L_{1}(\chi)/\pi},$

and $\mathfrak{a}_{p}$ kept (for the moment) as

$\mathfrak{a}_{p}=2^{-7/4}3^{-1/4}(1-p^{-1})^{1/4}\mathfrak{c}^{-\lambda}e^{\Lambda}.$
(11.4)

Now recalling (10.12) and (10.13), we have

$\displaystyle\mathfrak{c}^{-\lambda}e^{\Lambda}$
$\displaystyle=\exp\\!\Big{(}\tfrac{1}{2}L_{0}^{\prime}(\chi)+\tfrac{1}{2}L_{0}(\chi)\log{2}-\tfrac{1}{4}\log{p}-\tfrac{1}{2}L_{0}(\chi)\log(\sqrt{}\mathfrak{c})\Big{)}$
(11.5)
$\displaystyle=p^{-1/4}\exp\mathopen{}\mathclose{{}\left(\frac{\sqrt{p}L_{1}(\chi)}{2\pi}\mathopen{}\mathclose{{}\left(\gamma+\log\mathopen{}\mathclose{{}\left(\frac{4\pi}{p\sqrt{\mathfrak{c}}}}\right)-\frac{L_{1}^{\prime}(\chi)}{L_{1}(\chi)}}\right)\\!}\right)$
$\displaystyle=p^{-1/4}\exp\\!\bigg{(}\frac{\sqrt{p}L_{1}(\chi)}{2\pi}\bigg{(}\gamma+\log\\!\bigg{(}\frac{8\sqrt{6}}{\sqrt{p-1}}\bigg{)}-\frac{L_{1}^{\prime}(\chi)}{L_{1}(\chi)}\bigg{)}\\!\bigg{)}.$

Combining (11.4) and (11.5) then, we conclude that

$\mathfrak{p}(n,\chi)=\mathfrak{a}_{p}n^{\sqrt{p}L_{1}(\chi)/(4\pi)-3/4}\exp\mathopen{}\mathclose{{}\left(\tfrac{1}{2}\kappa\sqrt{(1-\tfrac{1}{p})n}\,}\right)\mathopen{}\mathclose{{}\left[1+(-1)^{n}\mathfrak{b}_{p}+O(n^{-1/5})}\right]$
(11.6)

with

$\mathfrak{a}_{p}=2^{-7/4}3^{-1/4}(p^{-1}-p^{-2})^{1/4}\exp\\!\bigg{(}\frac{\sqrt{p}L_{1}(\chi)}{2\pi}\bigg{(}\gamma+\log\\!\bigg{(}\frac{8\sqrt{6}}{\sqrt{p-1}}\bigg{)}-\frac{L_{1}^{\prime}(\chi)}{L_{1}(\chi)}\bigg{)}\\!\bigg{)}$
(11.7)

and

$\mathfrak{b}_{p}=2^{-\sqrt{p}L_{1}(\chi)/\pi},$

and this proves the first part of Theorem 1.5.

Finally we consider primes $p$ such that $p\equiv 3\,\,(\mathrm{mod}\,\,4)$
and $\chi(2)=-1$, or equivalently primes $p\equiv 3\,\,(\mathrm{mod}\,\,8)$.
Now we find that

$\lambda-\lambda_{*}=\tfrac{1}{4}L_{0}(\chi)+\tfrac{3}{4}L_{0}(\chi)=\sqrt{p}L_{1}(\chi)/\pi$
(11.8)

and

$\Lambda_{*}-\Lambda=-2L_{0}^{\prime}(\chi)-L_{0}(\chi)\log{2}=\frac{\sqrt{p}L_{1}(\chi)}{\pi}\mathopen{}\mathclose{{}\left(2\frac{L_{1}^{\prime}(\chi)}{L_{1}(\chi)}-2\gamma-2\log\mathopen{}\mathclose{{}\left(\frac{2\pi}{p}}\right)-\log{2}}\right).$

While our formula for $\mathfrak{a}_{p}$ is the same as in (11.7), we now have

$\displaystyle\mathfrak{c}^{\lambda-\lambda_{*}}=\exp\mathopen{}\mathclose{{}\left(\frac{\sqrt{p}L_{1}(\chi)}{\pi}\log\mathopen{}\mathclose{{}\left(\frac{\pi^{2}(1-1/p)}{24}}\right)\\!}\right),$
(11.9)

and thus

$\displaystyle\mathfrak{b}_{p}=\mathfrak{c}^{\lambda-\lambda_{*}}e^{\Lambda_{*}-\Lambda}$
$\displaystyle=\exp\mathopen{}\mathclose{{}\left[\frac{\sqrt{p}L_{1}(\chi)}{\pi}\mathopen{}\mathclose{{}\left(2\frac{L_{1}^{\prime}(\chi)}{L_{1}(\chi)}-2\gamma+\log\mathopen{}\mathclose{{}\left(\frac{p(p-1)}{192}}\right)\\!}\right)}\right].$
(11.10)

Additionally noting that the factor of $n^{\lambda_{*}-\lambda}$ in (10.11) is
now $n^{-\sqrt{p}L_{1}(\chi)/\pi}$, we conclude that for $p\equiv
3\,\,(\mathrm{mod}\,\,8)$ we have

$\mathfrak{p}(n,\chi)=\mathfrak{a}_{p}n^{\sqrt{p}L_{1}(\chi)/(4\pi)-3/4}\exp\mathopen{}\mathclose{{}\left(\tfrac{1}{2}\kappa\sqrt{(1-\tfrac{1}{p})n}\,}\right)\mathopen{}\mathclose{{}\left[1+(-1)^{n}\mathfrak{b}_{p}n^{-\sqrt{p}L_{1}(\chi)/\pi}+O(n^{-1/5})}\right],$
(11.11)

where $\mathfrak{a}_{p}$ is again given by $\eqref{eq:P78fa}$, and
$\mathfrak{b}_{p}$ is given by (11.10), completing the proof of the second
part of Theorem 1.5.

######  Remark 11.1.

Recalling the definitions

$X=(\sqrt{\mathfrak{c}n+\lambda^{2}}-\lambda)/\mathfrak{c}\qquad\text{and}\qquad
X_{*}=(\sqrt{\mathfrak{c}n+\lambda_{*}^{2}}-\lambda_{*})/\mathfrak{c}$

and noting that $(\sqrt{\mathfrak{c}n+t^{2}}-t)/\mathfrak{c}$ is strictly
decreasing in $t$, equation (11.8) implies that $X_{*}>X$ (and thus
$\rho_{*}>\rho$) when $p\equiv 3\,\,(\mathrm{mod}\,\,8)$. Therefore, to
compute $\mathfrak{p}(n,\chi_{p})$ in this case we use a contour of
integration with like that in the following picture.

$\rho_{*}$$\rho$$1$$-1$$i$$-i$

Figure 11.1. The contour of integration used for computing
$\mathfrak{p}(n,\chi_{p})$ when $p\equiv 3\,\,(\mathrm{mod}\,\,8)$.

##  12\. The special case of $\mathfrak{p}(n,\chi_{5})$

The sequence $(\mathfrak{p}(n,\chi_{5}))_{\mathbb{N}}$ requires special
treatment because, roughly speaking, the generating function
$\Phi(z,\chi_{5})$ has _four_ dominant singularities on the circle $|z|=1$
instead of the usual two at $z=\pm 1$. Specifically, $\Phi(z,\chi_{5})$ has
dominant singularities $z=\pm 1$ and $z=e(\pm\tfrac{1}{5})$ as we demonstrate
now.

It is immediate from Proposition 4.1 that, as $X\to\infty$, for all odd $p$
one has

$\Psi(\rho e(\tfrac{a}{q}))\sim V_{q}(a)\mathfrak{c}X,$

where $\mathfrak{c}=\tfrac{\pi^{2}}{24}(1-\tfrac{1}{p})$ and $V_{q}(a)$ is
given by the formulae in said proposition. We always have
$V_{1}(1)=V_{1}(2)=1$, and, as seen in the proof of Lemma 8.1, for primes
$p\neq 5$ with $p\equiv 1\,\,(\mathrm{mod}\,\,4)$ we have $V_{q}(a)<1$ when
$q>2$ and $(a,q)=1$. This is why $\pm 1$ (equivalently $e(0)$ and
$e(\tfrac{1}{2})$) are usually the only dominant singularities of
$\Phi(z,\chi_{p})$.

However, in the case of $p=5$ we have

$\mathfrak{c}=\frac{\pi^{2}}{30},\quad
G(\chi_{5})=\sqrt{5},\quad\text{and}\quad
L_{2}(\chi_{5})=\frac{4\pi^{2}\sqrt{5}}{125},$

and thus for $q=5$ and $1\leq a\leq 4$ the formula

$V_{5}(a)=\big{[}\chi_{5}(a)G(\chi_{5})(1-\tfrac{\chi_{5}(2)}{4})L_{2}(\chi_{5})/\mathfrak{c}-1\big{]}\tfrac{5}{25}$

from (4.8) reduces to

$V_{5}(a)=\tfrac{1}{5}(6\chi(a)-1)\qquad(1\leq a\leq 4).$

From this we see that

$V_{5}(1)=V_{5}(4)=1\qquad\text{and}\qquad V_{5}(2)=V_{5}(3)=-\tfrac{7}{5},$

which implies that

$\Psi(\rho)\sim\Psi(-\rho)\sim\Psi(\rho e(\tfrac{1}{5}))\sim\Psi(\rho
e(\tfrac{4}{5}))\sim\mathfrak{c}X,$

illustrating the fact that $\Phi(z,\chi_{5})$ has four “principal”
singularities.

######  Remark 12.1.

For brevity, going forward we identify $e(\tfrac{4}{5})=e(-\tfrac{1}{5})$ so
that we may, e.g., speak of $V_{5}(\pm 1)$, $\Psi(\rho e(\pm\tfrac{1}{5}))$,
etc..

Starting over with our “crude” formula (10.8) for $\mathfrak{p}(n,\chi_{p})$,
the additional principal arcs around $\alpha=\pm\tfrac{1}{5}$ (or formally
$\alpha=\tfrac{1}{5}$ and $\alpha=\tfrac{4}{5}$) yield an asymptotic formula

$\displaystyle\mathfrak{p}(n,\chi_{5})=\frac{\mathfrak{c}^{1/4}e^{2\sqrt{\mathfrak{c}n}}}{(4\pi)^{1/2}n^{3/4}}\mathopen{}\mathclose{{}\left[e^{\Lambda}+(-1)^{n}e^{\Lambda_{*}}+e^{-2\pi
in/5}e^{i\Lambda_{5}(1)}+e^{2\pi
in/5}e^{i\Lambda_{5}(-1)}+O(n^{-1/5})}\right],$ (12.1)

where $\Lambda$ and $\Lambda_{*}$ have their usual values from (10.4) and
(10.5) and the quantities $\Lambda_{5}(\pm 1)$ are constants determined below.
As we ultimately find that $\Lambda_{5}(-1)=-\Lambda_{5}(1)$, we collect
constants and reduce (12.1) to

$\mathfrak{p}(n,\chi_{5})=\mathfrak{a}_{5}n^{-3/4}\exp\\!\Big{(}\tfrac{1}{2}\kappa\sqrt{\tfrac{4}{5}n}\,\Big{)}\mathopen{}\mathclose{{}\left[1+(-1)^{n}\mathfrak{b}_{5}+\mathfrak{d}_{5}\cos\mathopen{}\mathclose{{}\left(\tfrac{2}{5}\pi
n-\Lambda_{5}(1)}\right)+O(n^{-1/5})}\right],$ (12.2)

where $\kappa=\pi\sqrt{2/3}$ as usual, from (11.2) and (11.3) we have

$\mathfrak{a}_{5}=2^{-5/4}15^{-1/4}\exp(\tfrac{1}{4}\sqrt{5}L_{1}(\chi_{5}))\qquad\text{and}\qquad\mathfrak{b}_{5}=\exp(-\sqrt{5}L_{1}(\chi_{5})),$

respectively, and we now additionally define

$\mathfrak{d}_{5}=2\exp(-\Lambda)=2\exp(-\tfrac{1}{4}\sqrt{5}L_{1}(\chi_{5})).$

Computing (using, e.g., Lemma A.5) that

$\sqrt{5}L_{1}(\chi_{5})=\log(\tfrac{1}{2}(3+\sqrt{5})),$

we find the explicit formulae

$\mathfrak{a}_{5}=\bigg{(}\frac{3+\sqrt{5}}{960}\bigg{)}^{1/4},\quad\mathfrak{b}_{5}=\frac{3-\sqrt{5}}{2},\quad\text{and}\quad\mathfrak{d}_{5}=\sqrt{2(5-\sqrt{5})}.$

Although it remains to compute the constants $\Lambda_{5}(\pm 1)$ in formula
(12.2), said formula highlights how $\mathfrak{p}(n,\chi_{5})$ is influenced
by the 10-periodic sum in the square brackets there.

###  12.1. The computation of $\Lambda_{5}(\pm 1)$

Just as $\Lambda$ and $\Lambda_{*}$ were defined as the constant (i.e., order
$X^{0}$) terms in our formulae for $\Psi(\pm\rho e(\beta))$ (note
$\rho=\rho_{*}$ here since $5\equiv 1\,\,(\mathrm{mod}\,\,4)$) in Lemmata 5.2
and 5.3, respectively, the quantities $\Lambda_{5}(\pm 1)$ are the constant
terms in the asymptotic formulae for $\Psi(\rho e(\pm\tfrac{1}{5}+\beta))$.
Our computations of $\Lambda_{5}(\pm 1)$ are similar to the methods used in
establishing Lemmata 5.2 and 5.3, so we are brief in our exposition. Again we
use the dashed integral
$\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int$
as a shorthand for $\frac{1}{2\pi i}\int$, and we now reserve $\chi_{0}$ for
the principal character (mod 5) and reserve $\psi$ for a general character
(mod 5).

Let $|\beta|\leq 3/(8\pi X)$. Recalling the definitions of $\Psi_{0}$ and
$\Psi_{1}$ from (5.3), we again write $\tau=X^{-1}(1-2\pi iX\beta)$ so that
$\rho e(\beta)=e^{-\tau}$, and we first consider

$\Psi_{0}(e(\tfrac{1}{5})e^{-\tau})=\sum_{2|k}\sum_{n=1}^{\infty}\frac{\chi_{0}(n)}{k}e\mathopen{}\mathclose{{}\left(\frac{nk}{5}}\right)e^{-nk\tau}=\sum_{2|k}\sum_{m=1}^{5}\sum_{n\equiv
m\,(5)}\frac{\chi_{0}(n)}{k}e\mathopen{}\mathclose{{}\left(\frac{mk}{5}}\right)e^{-nk\tau}.$

Since the only nonzero sums $\sum_{n\equiv m\,(5)}$ here are those with
$(m,5)=1$, we have

$\sum_{m=1}^{5}\sum_{n\equiv
m\,(5)}\chi_{0}(n)e\mathopen{}\mathclose{{}\left(\frac{mk}{5}}\right)e^{-nk\tau}=\frac{1}{4}\sum_{\psi\,\mathrm{mod}\,5}\sum_{n=1}^{\infty}\psi(n)\chi_{0}(n)e^{-nk\tau}\sum_{m=1}^{5}\bar{\psi}(m)e\mathopen{}\mathclose{{}\left(\frac{mk}{5}}\right),$
(12.3)

and since $\psi(n)\chi_{0}(n)=\psi(n)$ for any character
$\psi\,\,(\mathrm{mod}\,\,5)$, it follows that

$\sum_{2|k}\sum_{n=1}^{\infty}\frac{\chi_{0}(n)}{k}e\mathopen{}\mathclose{{}\left(\frac{nk}{5}}\right)e^{-nk\tau}=\frac{1}{4}\sum_{\psi\,\mathrm{mod}\,5}\sum_{2|k}\sum_{n=1}^{\infty}\frac{G(k,\bar{\psi})}{k}\psi(n)e^{-nk\tau},$

where $G(k,\bar{\psi})=\sum_{m=1}^{5}\bar{\psi}(m)e(mk/5)$.

Writing
$e^{-nk\tau}=\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int_{2-i\infty}^{2+i\infty}\Gamma(s)(nk\tau)^{-s}\,ds$
and rearranging terms, it follows that

$\displaystyle\Psi_{0}(e(\tfrac{1}{5})e^{-\tau})=\frac{1}{4}\sum_{\psi\,\mathrm{mod}\,5}\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int_{2-i\infty}^{2+i\infty}\Big{(}\sum_{2|k}\frac{G(k,\bar{\psi})}{k^{s+1}}\Big{)}L(s,\psi)\Gamma(s)\tau^{-s}\,ds$
(12.4)
$\displaystyle\qquad=\frac{1}{4}\sum_{\psi\,\mathrm{mod}\,5}\sum_{\nu=1}^{5}G(2\nu,\bar{\psi})\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int_{2-i\infty}^{2+i\infty}10^{-s}\zeta(s+1,\tfrac{\nu}{5})L(s,\psi)\Gamma(s)\tau^{-s}\,ds,$

where $\zeta(z,r)$ is the Hurwitz zeta function. Akin to the arguments of
section 5, using (LABEL:eq:5:Psi0ints) and shifting the line of integration to
$\operatorname{Re}(s)=-\frac{1}{2}$, and bounding the resulting integral
yields the formula

$\Psi_{0}(e(\tfrac{1}{5})e^{-\tau})=-\tfrac{1}{5}\mathfrak{c}\tau^{-1}+\tfrac{1}{4}\sum_{\begin{subarray}{c}\psi\,\mathrm{mod}\,5\\\
\psi\neq\chi_{0}\end{subarray}}G(\bar{\psi})\tfrac{\psi(2)}{2}L_{0}(\psi)L_{1}(\psi)+O(|\tau|^{1/2})\qquad(\mathfrak{c}=\tfrac{\pi^{2}}{30}).$
(12.5)

Using, e.g., Lemma A.5 one may quickly reduce (LABEL:eq:5:Psi0ints) to

$\displaystyle\Psi_{0}(e(\tfrac{1}{5})e^{-\tau})$
$\displaystyle=-\tfrac{1}{5}\mathfrak{c}\tau^{-1}+0+O(|\tau|^{1/2}).$ (12.6)

Now turning to $\Psi_{1}(\rho e(\frac{1}{5}+\beta))$, in place of (12.3) we
have

$\sum_{2\hskip 0.70004pt\nmid\hskip
0.70004ptk}\sum_{n=1}^{\infty}\frac{\chi_{5}(n)}{k}e\mathopen{}\mathclose{{}\left(\frac{nk}{5}}\right)e^{-nk\tau}=\frac{1}{4}\sum_{\psi\,\mathrm{mod}\,5}\sum_{2\hskip
0.70004pt\nmid\hskip
0.70004ptk}\sum_{n=1}^{\infty}\frac{G(k,\bar{\psi})}{k}\chi_{5}(n)\psi(n)e^{-nk\tau},$

and in place of (LABEL:eq:5:Psi0ints) we have

$\Psi_{1}(e(\tfrac{1}{5})e^{-\tau})=\frac{1}{4}\sum_{\psi\,\mathrm{mod}\,5}\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int_{2-i\infty}^{2+i\infty}\Big{(}\sum_{2\hskip
0.70004pt\nmid\hskip
0.70004ptk}\frac{G(k,\bar{\psi})}{k^{s+1}}\Big{)}L(s,\chi_{5}\psi)\Gamma(s)\tau^{-s}\,ds.$
(12.7)

Rather than write (12.7) using $\zeta(z,r)$ like in (LABEL:eq:5:Psi0ints), it
is perhaps simpler, and is indeed more illustrative, to compute that

$\sum_{2\hskip 0.70004pt\nmid\hskip
0.70004ptk}\frac{G(k,\bar{\psi})}{k^{s+1}}=\begin{cases}(1-2^{-s-1})(5^{-s}-1)\zeta(s+1)&\psi=\chi_{0},\\\
G(\bar{\psi})(1-\tfrac{\psi(2)}{2^{s+1}})L(s+1,\psi)&\psi\neq\chi_{0}\end{cases}$

and use this to more closely examine the integrals in (12.7).

This time, because of the factor $L(s,\chi_{5}\psi)$ in (12.7), our main term
there comes from the term with $\psi=\chi_{5}$ since
$L(s,\chi_{5}^{2})=L(s,\chi_{0})=(1-5^{-s})\zeta(s)$. Thus, writing the
summands in (12.7) over $\psi\,\,(\mathrm{mod}\,\,5)$ with $\psi$ in the order
$\chi_{5}$, then $\chi_{0}$, and then the remaining characters (mod $5$), we
have

$\displaystyle\Psi_{1}(e(\tfrac{1}{5})e^{-\tau})$ (12.8)
$\displaystyle\qquad=\frac{1}{4}\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int_{2-i\infty}^{2+i\infty}G(\chi_{5})\big{(}1-\tfrac{\chi_{5}(2)}{2^{s+1}}\big{)}(1-5^{-s})L(s+1,\chi_{5})\zeta(s)\Gamma(s)\tau^{-s}\,ds$
$\displaystyle\qquad\qquad-\frac{1}{4}\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int_{2-i\infty}^{2+i\infty}(1-2^{-s-1})(1-5^{-s})\zeta(s+1)L(s,\chi_{5})\Gamma(s)\tau^{-s}\,ds$
$\displaystyle\qquad\qquad+\frac{1}{4}\sum_{\begin{subarray}{c}\psi\,\mathrm{mod}\,5\\\
\psi\neq\chi_{0},\chi_{5}\end{subarray}}G(\bar{\psi})\mathchoice{{\vbox{\hbox{$\textstyle-$}}\kern-4.86108pt}}{{\vbox{\hbox{$\scriptstyle-$}}\kern-3.25pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-2.29166pt}}{{\vbox{\hbox{$\scriptscriptstyle-$}}\kern-1.875pt}}\\!\int_{2-i\infty}^{2+i\infty}\big{(}1-\tfrac{\psi(2)}{2^{s+1}}\big{)}L(s+1,\psi)L(s,\chi_{5}\psi)\Gamma(s)\tau^{-s}\,ds.$

At $s=1$ the first integrand here has residue

$\tfrac{1}{5}G(\chi_{5})(1-\tfrac{\chi_{5}(2)}{4})L_{2}(\chi_{5})\tau^{-1}=\tfrac{\pi^{2}}{25}\tau^{-1}=\tfrac{6}{5}\mathfrak{c}\tau^{-1},$
(12.9)

and at $s=0$ it has residue 0 due to the factor $(1-5^{-s})\Gamma(s)$. We
remark that the leftmost expression in (12.9) is consistent with formula
(4.8). The second integrand in (12.8) has residue
$-\tfrac{1}{8}L_{0}(\chi_{5})\log{5}$ at $s=0$, but this is 0 since
$L_{0}(\chi_{5})=0$.

For the remaining integrals in (12.8), there are only two characters
$\psi\,\,(\mathrm{mod}\,\,5)$ different from $\chi_{0}$ and $\chi_{5}$, say
$\omega$ and $\bar{\omega}$, where $\omega(2)=i$. It is again straightforward
to compute that these two integrals together provide a residue at $s=0$ of

$\tfrac{1}{4}G(\bar{\omega})(1-\tfrac{i}{2})L_{0}(\bar{\omega})L_{1}(\omega)+\tfrac{1}{4}G(\omega)(1+\tfrac{i}{2})L_{0}(\omega)L_{1}(\bar{\omega})=i\tfrac{\pi}{10},$

so that, in total, from (12.8) we find that

$\Psi_{1}(e(\tfrac{1}{5})e^{-\tau})=\tfrac{6}{5}\mathfrak{c}\tau^{-1}+i\tfrac{\pi}{10}+O(|\tau|^{1/2}).$
(12.10)

Adding (12.6) and (12.10) and replacing $\tau^{-1}$ with $X/(1-2\pi iX\beta)$,
we have

$\Psi(\rho e(\tfrac{1}{5}+\beta))=\frac{\mathfrak{c}X}{1-2\pi
iX\beta}+\frac{i\pi}{10}+O(X^{-1/2}),$

and we thus deduce that

$\Lambda_{5}(1)=\pi/10.$

A similar computation provides essentially the same formula for $\Psi(\rho
e(-\tfrac{1}{5}+\beta))$, with the only difference being the replacement of
$i\pi/10$ with $-i\pi/10$, so that indeed

$\Lambda_{5}(-1)=-\Lambda_{5}(1)=-\pi/10.$

Having computed that $\Lambda_{5}(\pm 1)=\pm\frac{\pi}{10}$, we return to
(12.2) and conclude that

$\mathfrak{p}(n,\chi_{5})=\mathfrak{a}_{5}n^{-3/4}\exp\\!\Big{(}\tfrac{1}{2}\kappa\sqrt{\tfrac{4}{5}n}\,\Big{)}\mathopen{}\mathclose{{}\left[1+(-1)^{n}\mathfrak{b}_{5}+\mathfrak{d}_{5}\cos\mathopen{}\mathclose{{}\left(\tfrac{2\pi}{5}n-\tfrac{\pi}{10}}\right)+O(n^{-1/5})}\right],$
(12.11)

where we recall that

$\kappa=\pi\sqrt{\tfrac{2}{3}},\quad\mathfrak{a}_{5}=\bigg{(}\frac{3+\sqrt{5}}{960}\bigg{)}^{1/4},\quad\mathfrak{b}_{5}=\frac{3-\sqrt{5}}{2},\quad\text{and}\quad\mathfrak{d}_{5}=\sqrt{2(5-\sqrt{5})}.$

This completes the proof of Theorem 1.7.

##  13\. The formula for $\mathfrak{p}(n,\chi_{2})$

We now consider our final case for this paper, recalling that $\chi_{2}(n)$ is
the Kronecker symbol $(\frac{n}{2})$, defined via

$\chi_{2}(n)=\begin{cases}1&n\equiv\pm 1\,\,(\mathrm{mod}\,\,8),\\\
-1&n\equiv\pm 3\,\,(\mathrm{mod}\,\,8),\\\ 0&\text{otherwise}.\end{cases}$
(13.1)

Because $\chi_{2}$ is multiplicative and clearly $|\chi_{2}|\leq 1$, Theorem
1.12 precludes the need for any minor arc analysis of $\Psi(\rho
e(\alpha),\chi_{2})$. Arguing as done in section 4, for $\alpha=a/q+\beta$
with $(a,q)=1$ and $|\beta|\leq 1/(qX^{2/3})$ we have

$\Psi(\rho e(\alpha),\chi_{2})=\mathopen{}\mathclose{{}\left(\frac{X}{1-2\pi
iX\beta}}\right)\sum_{k=1}^{\infty}\frac{U_{k}(q,a)}{k^{2}}+O(X^{8/9}),$

where now, because $\chi_{2}$ is a character modulo $8$, we define

$U_{k}(q,a)=\frac{1}{[8,q]}\sum_{m=1}^{[8,q]}\chi_{2}^{k}(m)e\mathopen{}\mathclose{{}\left(\frac{mka}{q}}\right).$
(13.2)

Since our prime of interest is $2$ here, we define (cf. equation (4.4))

$\mathfrak{c}=\frac{\pi^{2}}{24}\mathopen{}\mathclose{{}\left(1-\frac{1}{2}}\right)=\frac{\pi^{2}}{48}$

and

$V_{q}(a)=\frac{1}{\mathfrak{c}}\sum_{k=1}^{\infty}\frac{U_{k}(q,a)}{k^{2}},$

using formula (13.2) for $U_{k}(q,a)$. Following computations akin to those
done for Proposition 4.1 (see section A.1 of the appendix), we derive the
following analogue of said proposition. We recall that for any prime $\ell$
and any $m>0$, one writes $\ell^{m}\|n$ if $\ell^{m}\mid n$ but
$\ell^{m+1}\nmid n$.

######  Lemma 13.1.

Let $\chi_{2}$ be defined as in (13.1), let $\mathfrak{c}=\frac{\pi^{2}}{48}$,
and let $X>X_{0}$. For coprime $a$ and $q$ with $0\leq a\leq q\leq X^{1/3}$,
there exist constants $V_{q}(a)$ such that: for all $\alpha=a/q+\beta$ with
$|\beta|\leq 1/(qX^{2/3})$, as $X\to\infty$ one has

$\Psi(\rho e(\alpha),\chi_{2})=\frac{V_{q}(a)\mathfrak{c}X}{1-2\pi
iX\beta}+O(X^{8/9}),$

where $V_{q}(a)$ is determined as follows. If $2^{3}\|q$ then (cf. (4.8))

$V_{q}(a)=\big{[}\chi_{2}(a)G(\chi_{2})L_{2}(\chi_{2})/\mathfrak{c}-1\big{]}\frac{8}{q^{2}},$
(13.3)

and otherwise

$V_{q}(a)=\begin{cases}1/q^{2}&2\nmid q,\\\ 4/q^{2}&2^{1}\|q,\\\
-8/q^{2}&2^{2}\|q,\\\ -8/q^{2}&2^{4}|q.\end{cases}$ (13.4)

######  Remark 13.2.

Because $(1-\tfrac{\chi_{2}(2)}{4})=1$, if we momentarily relax the
restriction that $p$ only denote an odd prime and let $p=2$, equation (13.3)
may be written as

$V_{q}(a)=\mathopen{}\mathclose{{}\left[\chi_{2}(a)G(\chi_{2})(1-\tfrac{\chi_{2}(2)}{4})L_{2}(\chi_{2})/\mathfrak{c}-1}\right]\frac{4p}{q^{2}},$

and the quantities $-8/q^{2}$ in (13.4) may be written as $-4p/q^{2}$, further
illustrating the similarities between Lemma 13.1 and Proposition 4.1.

As quick computations show that

$G(\chi_{2})=2\sqrt{2}\qquad\text{and}\qquad
L_{2}(\chi_{2})=\frac{\pi^{2}\sqrt{2}}{16},$

we find that

$V_{1}(1)=V_{2}(1)=1\qquad\text{and}\qquad V_{8}(1)=V_{8}(7)=\tfrac{11}{8},$

showing that the major arcs about $\alpha=\tfrac{1}{8}$ and
$\alpha=\tfrac{7}{8}$ in fact yield higher-order asymptotic terms than do the
arcs about $0$, $1$, and $\tfrac{1}{2}$. Maintaining that
$\mathfrak{c}=\tfrac{\pi^{2}}{48}$, computations like those done in sections 5
and 12 show that

$\Psi(\rho
e(\pm\tfrac{1}{8}+\beta),\chi_{2})=\frac{\frac{11}{8}\mathfrak{c}X}{1-2\pi
iX\beta}\pm\frac{3i\pi}{16}+O(X^{-1/2})$ (13.5)

and

$\Psi(\pm\rho e(\beta),\chi_{2})=\frac{\mathfrak{c}X}{1-2\pi
iX\beta}+\mathopen{}\mathclose{{}\left(-\tfrac{1}{4}\log{2}\pm\tfrac{1}{2}\log(1+\sqrt{2})}\right)+O(X^{-1/2}).$
(13.6)

We now recall that in section 6, from the formula

$\Psi(\rho e(\beta),\chi_{p})=\frac{\mathfrak{c}X}{1-2\pi
iX\beta}+2\lambda\log\mathopen{}\mathclose{{}\left(\frac{X}{1-2\pi
iX\beta}}\right)+\Lambda+O(X^{-1/2})$ (13.7)

we deduce that $X$ (and therefore the radius $\rho=e^{-1/X}$) should be
defined via

$X=(\sqrt{\mathfrak{c}n+\lambda^{2}}-\lambda)/\mathfrak{c},$

and that $X_{*}$ should be defined similarly with $\lambda_{*}$ in place of
$\lambda$. Comparing (13.6) and (13.7), we see that in this case we have
$\lambda=\lambda_{*}=0$, so that for $\mathfrak{p}(n,\chi_{2})$ we set

$X=X_{*}=\sqrt{n/\mathfrak{c}}.$ (13.8)

On the other hand, comparing (13.5) and (13.7) we deduce that we should define

$X_{8}=\sqrt{8n/(11\mathfrak{c})}\qquad\text{and}\qquad\rho_{8}=e^{-1/X_{8}},$
(13.9)

and use $\rho$ and $\rho_{8}$ for an “arc-transference contour” for

$\mathfrak{p}(n,\chi_{2})=\frac{1}{2\pi
i}\int_{|z|=r}\Phi(z,\chi_{2})z^{-n-1}\,dz\qquad(0<r<1),$

like we do for $\mathfrak{p}(n,\chi_{p})$ when $p\equiv
3\,\,(\mathrm{mod}\,\,8)$. This time, our modified contour has the form shown
in Figure 13.1; we remark that the inequality $\rho_{8}<\rho$ implied by
(13.8) and (13.9) is reflected in the figure.

$\rho$$\rho_{8}$$e(\tfrac{1}{16})$$e(\tfrac{3}{16})$$e(\tfrac{-1}{16})$$e(\tfrac{-3}{16})$$1$$-1$$i$$-i$
Figure 13.1. The contour of integration used for computing
$\mathfrak{p}(n,\chi_{2})$.

The remaining derivations and estimates used to establish the asymptotic
formulae of section 9 and 10, specifically the crude formula (10.9), may again
be applied to derive similar results for $\mathfrak{p}(n,\chi_{2})$. Because
our principal arcs are now those about $\alpha=\tfrac{1}{8}$ and
$\alpha=\tfrac{7}{8}$ (alternatively about $\alpha=\pm\tfrac{1}{8}$), our main
asymptotic term for $\mathfrak{p}(n,\chi_{2})$ is

$\displaystyle\frac{\mathopen{}\mathclose{{}\left(\frac{11}{8}}\right)^{1/4}\mathfrak{c}^{1/4}}{(4\pi)^{1/2}n^{3/4}}\exp\\!\Big{(}2\sqrt{\tfrac{11}{8}\mathfrak{c}n}\,\Big{)}\mathopen{}\mathclose{{}\left[e\Big{(}\frac{-n}{8}\Big{)}e^{3i\pi/16}+e\mathopen{}\mathclose{{}\left(\frac{n}{8}}\right)e^{-3i\pi/16}}\right]$
(13.10)
$\displaystyle\qquad=\mathfrak{a}_{2}n^{-3/4}\exp\\!\Big{(}\tfrac{1}{2}\kappa\sqrt{\tfrac{11}{16}n}\,\Big{)}\cos\\!\Big{(}\frac{2\pi
n}{8}-\frac{3\pi}{16}\Big{)},$

where again $\kappa=\pi\sqrt{2/3}$, and now

$\mathfrak{a}_{2}=2(11/8)^{1/4}\mathfrak{c}^{1/4}(4\pi)^{-1/2}=2^{-7/4}(11/3)^{1/4}.$

In light of (13.6), the principal arcs $\mathfrak{P}$ and $\mathfrak{P}_{*}$
contribute terms

$\frac{\mathfrak{c}^{1/4}e^{\Lambda_{1}}}{(4\pi)^{1/2}}n^{-3/4}\exp\\!\Big{(}\tfrac{1}{2}\kappa\sqrt{\tfrac{1}{2}n}\,\Big{)}\qquad\text{and}\qquad(-1)^{n}\frac{\mathfrak{c}^{1/4}e^{\Lambda_{2}}}{(4\pi)^{1/2}}n^{-3/4}\exp\\!\Big{(}\tfrac{1}{2}\kappa\sqrt{\tfrac{1}{2}n}\,\Big{)},$
(13.11)

respectively, where, breaking with our previous notation just this once, we
simply let

$\Lambda_{1}=-\tfrac{1}{4}\log{2}+\tfrac{1}{2}\log(1+\sqrt{2})\qquad\text{and}\qquad\Lambda_{2}=-\tfrac{1}{4}\log{2}-\tfrac{1}{2}\log(1+\sqrt{2}).$

As $\exp(\Lambda_{2}-\Lambda_{1})=(1+\sqrt{2})^{-1}$, we sum up the quantities
(13.10) and (13.11) and collect constants to conclude that

$\mathfrak{p}(n,\chi_{2})=\mathfrak{a}_{2}n^{-3/4}\exp\\!\Big{(}\tfrac{1}{2}\kappa\sqrt{\tfrac{11}{16}n}\,\Big{)}\mathfrak{S}(n),$

where

$\mathfrak{S}(n)=\cos\\!\Big{(}\frac{2\pi
n}{8}-\frac{3\pi}{16}\Big{)}+\mathfrak{b}_{8}\exp\\!\Big{(}\\!\\!-\\!\tfrac{1}{2}\kappa\sqrt{\tfrac{1}{2}n}\Big{(}\sqrt{\tfrac{11}{8}}-1\Big{)}\\!\Big{)}\mathopen{}\mathclose{{}\left[1+\frac{(-1)^{n}}{1+\sqrt{2}}}\right],$
$\kappa=\pi\sqrt{\tfrac{2}{3}},\quad\mathfrak{a}_{2}=\mathopen{}\mathclose{{}\left(\frac{11}{2^{7}3}}\right)^{1/4},\qquad\text{and}\qquad\mathfrak{b}_{2}=\sqrt{\frac{1+\sqrt{2}}{2\sqrt{11}}}.$

This completes the proof of Theorem 1.9.

## Appendix

###  A.1. The computations for Proposition 4.1

Here in the first part of the appendix we include the computations used in
establishing Proposition 4.1, which, paraphrasing, we recall stated that

$\Psi(\rho e(\tfrac{a}{q}+\beta),\chi_{p})=\frac{V_{q}(a)\mathfrak{c}X}{1-2\pi
iX\beta}+O(X^{8/9})\qquad(\text{for $(a,q)=1$}),$

where,

$\mathfrak{c}=\frac{\pi^{2}}{24}\mathopen{}\mathclose{{}\left(1-\frac{1}{p}}\right),$
$U_{k}(q,a)=\frac{1}{[p,q]}\sum_{m=1}^{[p,q]}\chi^{k}(m)e\mathopen{}\mathclose{{}\left(\frac{mka}{q}}\right)\qquad(\text{with
$[p,q]=\mathrm{lcm}(p,q)$}),$ (A.1)

and

$V_{q}(a)=\frac{1}{\mathfrak{c}}\sum_{k=1}^{\infty}\frac{U_{k}(q,a)}{k^{2}}.$

As mentioned in section 4, the specific value of $V_{q}(a)$ depends on
divisibility properties of $q$, and thus we consider four different cases
regarding $q$. First, the quantities $U_{k}(q,a)$ and $V_{q}(a)$ are easiest
to handle when $(p,q)=1$.

######  Lemma A.1.

Suppose that $(p,q)=1$ and $(a,q)=1$. One has

$V_{q}(a)=\begin{cases}1/q^{2}&2\nmid q,\\\ 4/q^{2}&2\mid q.\end{cases}$

###### Proof.

We begin by establishing that

$U_{k}(q,a)=\begin{cases}(1-\tfrac{1}{p})&\text{$2\mid k$ and $q\mid k$,}\\\
0&\text{otherwise.}\end{cases}$ (A.2)

As $(p,q)=1$ and $[p,q]=pq$ we may express each $1\leq m\leq pq$ (A.1) as
$m=tp+s$ with $1\leq t\leq q$ and $1\leq s\leq p$, so that

$pqU_{k}(q,a)=\sum_{s=1}^{p}\sum_{t=1}^{q}e\mathopen{}\mathclose{{}\left(\frac{(tp+s)ka}{q}}\right)\chi^{k}(tp+s)=\sum_{s=1}^{p}\chi^{k}(s)e\mathopen{}\mathclose{{}\left(\frac{ska}{q}}\right)\sum_{t=1}^{q}e\mathopen{}\mathclose{{}\left(\frac{tkpa}{q}}\right).$

Because $(pa,q)=1$, the inner sum here is equal to $q$ if $q\mid k$, and is 0
otherwise, so assume now that $q\mid k$. With this assumption then,

$pU_{k}(q,a)=\sum_{s=1}^{p}\chi^{k}(s)e\mathopen{}\mathclose{{}\left(\frac{ska}{q}}\right)=\sum_{s=1}^{p}\chi^{k}(s).$

As $\chi$ is primitive and $\chi^{2n}=\chi_{0}$ and $\chi^{2n-1}=\chi$ for all
$n\in\mathbb{N}$, one has

$\sum_{s=1}^{p}\chi^{k}(s)=\begin{cases}p-1&2\mid k,\\\ 0&2\nmid
k,\end{cases}$

and equation (A.2) follows.

Now since $U_{k}(q,a)=0$ unless $q\mid k$, we write $k=qk_{1}$ for such $k$ to
find that

$\sum_{k=1}^{\infty}\frac{U_{k}(q,a)}{k^{2}}=\mathopen{}\mathclose{{}\left(1-\frac{1}{p}}\right)\sum_{\begin{subarray}{c}k_{1}=1\\\
2|qk_{1}\end{subarray}}^{\infty}\frac{1}{q^{2}k_{1}^{2}}.$ (A.3)

If $2\nmid q$ then $2\mid qk_{1}$ if and only if $2\mid k_{1}$, and the sum
(A.3) is

$\mathopen{}\mathclose{{}\left(1-\frac{1}{p}}\right)\sum_{2|k_{1}}^{\infty}\frac{1}{q^{2}k_{1}^{2}}=\frac{\pi^{2}}{24q^{2}}\mathopen{}\mathclose{{}\left(1-\frac{1}{p}}\right)=\frac{\mathfrak{c}}{q^{2}}.$

On the other hand, if $2\mid q$ then the condition $2\mid qk_{1}$ in (A.3) is
redundant, reducing said sum to

$\mathopen{}\mathclose{{}\left(1-\frac{1}{p}}\right)\sum_{k_{1}=1}^{\infty}\frac{1}{q^{2}k_{1}^{2}}=\frac{\pi^{2}}{6q^{2}}\mathopen{}\mathclose{{}\left(1-\frac{1}{p}}\right)=\frac{4\mathfrak{c}}{q^{2}},$

and the result follows from collecting our computations and assumptions above.
∎

We now consider the case when $p\mid q$, recalling that
$G(\psi)=\sum_{n=1}^{q}\bar{\psi}(n)e(n/q)$ for a general character $\psi$
(mod $q$).

######  Lemma A.2.

Suppose that $p\mid q$ and $(a,q)=1$, and let $q=pq_{1}$. First, one has

$U_{k}(q,a)=0\qquad\text{if $q_{1}\nmid k$.}$

Now supposing that $k=q_{1}k_{1}$ for some $k_{1}\in\mathbb{N}$, one has

$U_{k}(q,a)=\begin{cases}1-1/p&\text{$2\mid k$ and $p\mid k_{1}$,}\\\
-1/p&\text{$2\mid k$ and $p\nmid k_{1}$,}\\\
G(\chi)\chi(ak_{1})/p&\text{$2\nmid k$.}\end{cases}$ (A.4)

###### Proof.

Since $[p,q]=q$ now, we express each $1\leq m\leq q$ as $m=tp+s$ with $1\leq
t\leq q_{1}$ and $1\leq s\leq p$, whereby

$qU_{k}(q,a)=\sum_{t=1}^{q_{1}}\sum_{s=1}^{p}\chi^{k}(tp+s)e\mathopen{}\mathclose{{}\left(\frac{(tp+s)ka}{q}}\right)=\sum_{s=1}^{p}\chi^{k}(s)\mathopen{}\mathclose{{}\left(\frac{ska}{q}}\right)\sum_{t=1}^{q_{1}}e\mathopen{}\mathclose{{}\left(\frac{tka}{q_{1}}}\right).$
(A.5)

As $\sum_{t=1}^{q_{1}}e(tka/q_{1})$ is $q_{1}$ if $q_{1}\mid k$ and is $0$
otherwise, we have $U_{k}(q,a)=0$ if $q_{1}\nmid k$.

Now suppose that $q_{1}\mid k$ and $k=q_{1}k_{1}$. Noting that $k/q=k_{1}/p$,
it follows that equation (A.5) may be rewritten as

$U_{k}(q,a)=\frac{1}{p}\sum_{s=1}^{p}\chi^{k}(s)e\mathopen{}\mathclose{{}\left(\frac{sk_{1}a}{p}}\right).$
(A.6)

First, if $2\mid k$ then $\chi^{k}=\chi_{0}\,\,(\mathrm{mod}\,\,p)$ and the
righthand side of (A.6) is

$\frac{1}{p}\sum_{s=1}^{p}\chi_{0}(s)e\mathopen{}\mathclose{{}\left(\frac{sk_{1}a}{p}}\right)\begin{cases}1-1/p&p\mid
k_{1},\\\ -1/p&p\nmid k_{1},\end{cases}$

which gives the first two cases of (A.4). If $2\nmid k$ then $\chi^{k}=\chi$,
and the righthand side of (A.6) is equal to

$\frac{1}{p}\sum_{s=1}^{p}\chi(s)e(sk_{1}a/p)=G(\chi)\bar{\chi}(ak_{1})/p=G(\chi)\chi(ak_{1})/p,$

establishing the final case of (A.4). ∎

######  Lemma A.3.

Suppose that $p\mid q$ and $(a,q)=1$. If $2\nmid q$ then

$V_{q}(a)=\mathopen{}\mathclose{{}\left[\chi(a)G(\chi)(1-\tfrac{\chi(2)}{4})L_{2}(\chi)/\mathfrak{c}-1}\right]\frac{p}{q^{2}},$

where $L_{2}(\chi)=L(2,\chi)$.

###### Proof.

Let $q=pq_{1}$ for some $q_{1}\in\mathbb{N}$. By Lemma A.2 $U_{k}(q,a)$ is
nonzero only if $q_{1}\mid k$, so for such $k$ let $k=q_{1}k_{1}$. When $2\mid
k$, since $2\nmid q$ one has $2\mid k$ if and only if $2\mid k_{1}$, so that

$\displaystyle\sum_{2|k}^{\infty}\frac{U_{k}(q,a)}{k^{2}}$
$\displaystyle=\sum_{2p|k_{1}}^{\infty}\frac{1}{(q_{1}k_{1})^{2}}-\frac{1}{p}\sum_{2|k_{1}}^{\infty}\frac{1}{(q_{1}k_{1})^{2}}=\frac{\zeta(2)}{4p^{2}q_{1}^{2}}-\frac{p\zeta(2)}{4p^{2}q_{1}^{2}}=\frac{\zeta(2)}{4q^{2}}(1-p),$

and we rewrite this latter term as

$\frac{\zeta(2)}{4q^{2}}(1-p)=-\frac{\pi^{2}}{24}\mathopen{}\mathclose{{}\left(1-\frac{1}{p}}\right)\frac{p}{q^{2}}=-\frac{\mathfrak{c}p}{q^{2}}.$
(A.7)

Now considering $\sum_{2\hskip 0.70004pt\nmid\hskip
0.70004ptk}U_{k}(q,a)/k^{2}$, by (A.4) and the fact that $2\nmid k$ if and
only if $2\nmid k_{1}$, we have

$\frac{U_{k}(q,a)}{k^{2}}=\frac{G(\chi)\chi(ak_{1})}{p(q_{1}k_{1})^{2}}=\mathopen{}\mathclose{{}\left(\frac{\chi(a)G(\chi)p}{q^{2}}}\right)\frac{\chi(k_{1})}{k_{1}^{2}}$

and

$\sum_{2\hskip 0.70004pt\nmid\hskip
0.70004ptk}^{\infty}\frac{U_{k}(q,a)}{k^{2}}=\chi(a)G(\chi)\frac{p}{q^{2}}\sum_{2\hskip
0.70004pt\nmid\hskip
0.70004ptk_{1}}^{\infty}\frac{\chi(k_{1})}{k_{1}^{2}}=\chi(a)G(\chi)(1-\tfrac{\chi(2)}{4})L_{2}(\chi)\mathopen{}\mathclose{{}\left(\frac{p}{q^{2}}}\right).$
(A.8)

The result then follows from adding (A.7) and (A.8) and dividing by
$\mathfrak{c}$. ∎

######  Lemma A.4.

If $p\mid q$ and $2\mid q$, then

$V_{q}(a)=-4p/q^{2}.$

###### Proof.

Let $q=pq_{1}$ for some $q_{1}\in\mathbb{N}$. Again $U_{k}(q,a)$ is nonzero
only if $q_{1}\mid k$, and again for such $k$ write $k=q_{1}k_{1}$. Since
necessarily $2\mid q_{1}$, we have $2\mid k$, so that by (A.4) we have

$\sum_{k=1}^{\infty}\frac{U_{k}(q,a)}{k^{2}}=\sum_{\begin{subarray}{c}2|k\\\
k=q_{1}k_{1}\end{subarray}}\frac{U_{k}(q,a)}{k^{2}}=\sum_{\begin{subarray}{c}k_{1}=1\\\
p|k_{1}\end{subarray}}^{\infty}\frac{1}{q_{1}^{2}k_{1}^{2}}-\frac{1}{p}\sum_{k_{1}=1}^{\infty}\frac{1}{q_{1}^{2}k_{1}^{2}}=\frac{\pi^{2}}{6}\mathopen{}\mathclose{{}\left(\frac{1}{q^{2}}-\frac{p}{q^{2}}}\right).$

This latter quantity is equal to $-4\mathfrak{c}p/q^{2}$, and the result
follows. ∎

###  A.2. Formulae and results for different $L(r,\psi)$

In this second part of the appendix we sketch the fact that both
$L_{1}(\chi_{2})>0$ and $L_{1}(\chi_{p})>0$ using the following general
argument from the proof of [montgomery2007multiplicative]*Thm. 4.9.

Let $\psi$ be a nonprincipal quadratic character (mod $q$) and let
$r(n):=\sum_{d|n}\psi(d)$. Then
$\sum_{n=1}^{\infty}r(n)n^{-s}=\zeta(s)L(s,\psi)$ for $\sigma>1$, $r(n)$ is
multiplicative, and for primes $\ell$ one has

$r(\ell^{a})=\begin{cases}1&\text{if $\ell\mid q$},\\\ a+1&\text{if
$\psi(\ell)=1$},\\\ 1&\text{if $\psi(\ell)=-1$ and $2\mid a$,}\\\ 0&\text{if
$\psi(\ell)=-1$ and $2\nmid a$.}\end{cases}$

Thus $r(n)\geq 0$ and $r(n^{2})\geq 1$ for all $n$. If $L_{1}(\psi)=0$, then
the series $\sum r(n)n^{-s}$ converges for $\sigma>0$ and is analytic there,
but this is impossible since

$\sum_{n=1}^{\infty}\frac{r(n)}{\sqrt{n}}\geq\sum_{n=1}^{\infty}\frac{r(n^{2})}{n}\geq\sum_{n=1}^{\infty}\frac{1}{n}.$

Thus $L_{1}(\psi)\neq 0$. As $L(\sigma,\psi)>0$ for quadratic $\psi$ and
$\sigma>1$, we deduce that $L_{1}(\psi)>0$.

Because many of our formulae involve the quantities $L_{1}(\chi_{p})$, we
include some formulae from [montgomery2007multiplicative] that useful for
explicit computations.

######  Lemma A.5 ([montgomery2007multiplicative]*Thm. 9.9, Exer. 10.1.14,
Exer. 10.1.15).

Suppose that $\psi$ is primitive modulo $q$ and that $\psi(-1)=1$. One has
$L_{0}(\psi)=0$ and

$\displaystyle L_{1}(\psi)$
$\displaystyle=-\frac{G(\psi)}{q}\sum_{a=1}^{q-1}\psi^{*}(a)\log\sin\\!\Big{(}\frac{\pi
a}{q}\Big{)},$ $\displaystyle L_{2}(\psi)$
$\displaystyle=\frac{\pi^{2}G(\psi)}{q}\sum_{a=1}^{q}\psi^{*}(a)\mathopen{}\mathclose{{}\left((a/q)^{2}-a/q+1/6}\right).$

If instead one has $\psi(-1)=-1$, then

$\displaystyle
L_{0}(\psi)=\frac{-1}{q}\sum_{a=1}^{q}a\psi^{*}(a)\qquad\text{and}\qquad
L_{1}(\psi)=\frac{i\pi G(\psi)}{q^{2}}\sum_{a=1}^{q}a\psi^{*}(a).$

## References