1. Introduction
Numbers with missing digits have been studied extensively in number theory because of their distinctive arithmetic properties. This is particularly true in sieve theory, where such sets are of interest due to their sparsity. In recent years, missing digit problems have also been approached using the Hardy–Littlewood circle method. This approach is viable because the indicator function of the set of missing digit numbers admits strong Fourier decay properties. Exploiting this structure, Maynard [
Reference Maynard14
] showed that for a sufficiently large base g, there are infinitely many primes whose base g expansion omits a given digit
$0\leqslant b\lt g$
. He later refined this result to work for the base
$g=10$
, see [
Reference Maynard13
].
Following the work of Maynard [ Reference Maynard14 ], there has been substantial progress on problems concerning primes with missing digits. In particular, attention has turned to variants of the classical problems in number theory incorporating missing digit restrictions. One such example is the Vinogradov three primes theorem. In this direction, Maier and Rassias [ Reference Maier and Rassias12 ] established, under the Generalised Riemann Hypothesis, a version of Vinogradov’s three primes theorem involving one missing digit prime and two Piatetski–Shapiro primes. This was later refined by Leng and Sawhney [ Reference Leng and Sawhney10 ], who proved Vinogradov’s three primes theorem with all three primes missing a digit.
Another central problem in number theory, particularly in the context of the Hardy–Littlewood circle method, is Waring’s problem. Given a positive integer n, the problem asks for the smallest number of kth powers required to represent n as their sum. This question has been studied extensively, see Vaughan and Wooley [ Reference Vaughan and Wooley20 ] for a survey on this problem.
In a variant of this problem where the kth powers are required to come from numbers with restricted digit expansions, Green [
Reference Green6
] proved that every sufficiently large integer can be written as a sum of at most
$ g^{160k^2} $
terms of the form
$x^k$
, where x has a base g expansion using only two digits.
In this paper, we will study a problem that is somewhat related to both the Waring problem and the missing digit problem. For this, we start by defining the normalised representation function for sums of two prime squares
where
$\Lambda(\!\cdot\!)$
is the von Mangoldt function. Then we know by the Prime Number Theorem in arithmetic progressions, for any
$A\gt0$
,
$1\leqslant q\leqslant (\!\log x)^A$
and
$0\leqslant a\lt q$
,
\begin{align*} \sum_{\substack{n\leqslant x \\ n\equiv a \,({\rm mod}\,q)}} r_2(n) = \frac{\rho(a;\;q)}{\varphi^2(q)} \cdot \frac{\pi}{4} x + O_A \bigg( \frac{x}{(\!\log x)^A}\bigg), \end{align*}
where
Our first theorem is about the average of this function over the missing digit set. For this, we fix the base
$g\geqslant 2$
, and let
$X=g^k$
for some k large. We take the digit we want to miss
$0\leqslant b \lt g$
. Now, we can define
\begin{equation}\mathcal{A} \;:\!=\; \bigg\{n \in \mathbb{N} \;:\; n=\sum_{i=0}^{\infty} a_i g^i , a_i\not=b\Bigg\} \quad \text{ and } \quad \mathcal{A}(X) \;:\!=\; \mathcal{A} \cap [1,X].\end{equation}
Theorem 1·1. Fix
$g\geqslant 2$
sufficiently large. Let
$A\gt0$
be given. We have as
$k\to\infty$
, for
$X=g^k$
,
\begin{equation}\sum_{n\in \mathcal{A}(X)} r_2(n) = \mathfrak{S}(b,g) \cdot \frac{\pi}{4} \#\mathcal{A}(X) + O_{A}\bigg( \frac{\#\mathcal{A}(X)}{(\!\log X)^A} \bigg) ,\end{equation}
where
and
$\rho(a;\;q)$
is given by (1·1).
In this regard, there has been some work on averages of arithmetic functions over missing digit numbers. More recently, Nath [
Reference Nath15
, theorem 7] proved that for arithmetic functions f with
$|f| \ll \log X$
satisfying certain natural hypotheses, one gets a general theorem on the level of distribution of f(n). More precisely, he shows that for
$|\sigma|\leqslant \tau$
an arithmetic function supported on
$[1,X^{1/2})$
,
$c_d$
some congruence class, and
\begin{align*}\lambda_d = \lim_{y\to\infty} \frac{1}{y}\sum_{\substack{n\leqslant y \\ (n,d)=1}} f(n),\end{align*}
the quantity
\begin{align*}\sigma(d) \!\left(\sum_{\substack{n\in \mathcal{A}(X) \\ n\equiv c_d \,({\rm mod}\,d)}} f(n)- \frac{\lambda_d}{\varphi(d)}\frac{b}{\varphi(b)} \#\mathcal{A}(X) \right)\!, \end{align*}
is small on average over moduli
$d \lt X^{1/2}$
.
Remark 1·2. We note that the local factor
$\mathfrak{S}(b,g)$
is maximized when
$\exists p| g$
such that
$p\equiv 3\,({\rm mod}\,4)$
, and
$b=0$
, for which, we have
$\mathfrak{S}(b,g)=g/(g-1)$
. It is minimised when
$\forall p|g$
we have
$p\equiv 1 \,({\rm mod}\,4)$
and
$b=0$
, for which
$\mathfrak{S}(b,g)= ({g}/{g-1}) (1 - 2^{\omega(g)}/\varphi(g))$
where
$\omega(g)$
is the number of distinct prime factors of g. See Lemma 2·1 for values of
$\rho(a;\;q)$
. Moreover,
i.e. the local factor is 1 on average over the digit
$b\,({\rm mod}\,g)$
.
Now, we can define the regular representation function for sums of two prime squares
where
$\mathcal{P}$
is the set of prime numbers. This function has been studied before in the works [
Reference Blomer and Brüdern1
,
Reference Daniel2
,
Reference Erdös3
,
Reference Sabuncu17
,
Reference Sedunova18
]. Hence, we can use Theorem 1·1 along with some counting arguments to get a bound for this function.
Corollary 1·3. Fix
$g\geqslant 2$
sufficiently large. We have as
$k\to\infty$
, for
$X=g^k$
,
\begin{align*}\sum_{n\in \mathcal{A}(X)} r_*(n) \asymp \frac{\#\mathcal{A}(X)}{(\!\log X)^2}. \end{align*}
It is possible to get an asymptotic of the form
\begin{align*} \sum_{n\in \mathcal{A}(X)} r_*(n) \sim \mathfrak{S}(b,g) \cdot \pi \frac{\#\mathcal{A}(X)}{(\!\log X)^2}, \end{align*}
by partial summation, and obtaining an asymptotic to the more general problem
\begin{align*} \sum_{\substack{p \leqslant A, q\leqslant B \\ p^2+q^2 \in \mathcal{A}(X)}} 1 , \end{align*}
for any
$A,B\leqslant X$
. However, we do not pursue this direction in the paper, as our current bounds are insufficient to yield an asymptotic result for Theorem 1·6. Nonetheless, we expect that this can be proved with some modifications of the ideas in the paper.
We know from earlier results that
$r_*(n)$
is 2 almost surely whenever
$r_*(n)\gt0$
, i.e.
We want to show a similar result when n is in the set of missing digits. To show such a result, we need to study the second moment of
$r_*(n)$
over
$n\in \mathcal{A}(X)$
. As an immediate bound, we have
Nonetheless, we can refine this bound by combining the machinery of the circle method with sieve estimates, which leads to the following theorem.
Theorem 1·4. Fix
$g\geqslant 2$
sufficiently large. We have as
$k\to\infty$
, for
$X=g^k$
,
\begin{align*} \sum_{n\in \mathcal{A}(X)} (r_*^2(n) - 2r_*(n)) = \sum_{\substack{p_1^2+q_1^2=p_2^2+q_2^2 \in \mathcal{A}(X) \\ \{p_1,q_1\}\not=\{p_2,q_2\}}} 1 \ll \frac{\#\mathcal{A}(X) (\!\log\log X)^4}{\log X} . \end{align*}
Remark 1·5. We actually expect the size of this set to be
$\asymp \#\mathcal{A}(X)/(\!\log X)^3$
. Unfortunately, we lose a
$(\!\log X)^2$
factor mainly because we can’t take the major arcs thin enough. This stems from our failure to understand
$L^{\infty}$
bounds for the Fourier transform of the indicator function of
$\mathcal{A}$
. See Remark 2·9 for more details.
Trivially, we have the bound
coming from Corollary 1·3. Nonetheless, we can say more by using the following inequality,
since
$1_{m\gt2} \leqslant m(m-2)/3$
for
$m\gt1$
, where the big O term comes from the
$r_*(n)=1$
contribution. Thus, as stated in Remark 1·5, we actually expect
in other words, for a typical
$n\in \mathcal{A}(X)$
with
$r_*(n)\gt0$
, we have
$r_*(n)=2$
.
Finally, putting together everything, we will get a result on the quantity of the integers in
$\mathcal{A}$
that can be represented as a sum of two prime squares.
Theorem 1·6. Fix
$g\geqslant 2$
sufficiently large. We have as
$k\to\infty$
, for
$X=g^k$
,
As one would guess, we actually expect
where
and
$\rho(a;\;q)=\#\{ (u,v)\in (\mathbb{Z}/q\mathbb{Z})^2 \;:\; (uv,q)=1, u^2+v^2\equiv a \,({\rm mod}\,q) \}$
are as before. Unfortunately, we can’t accomplish this because of the loss of the
$(\!\log X)^2$
factor in Theorem 1.4.
Our theorems would also work in the case we are missing more digits. That is, for
$0\lt t \lt g^{1/768 - \varepsilon}$
, and
$b_1,\ldots , b_t\in \{0,\ldots , g-1\}$
, if we define the set
$\mathcal{B}\;:\!=\; \{n\in \mathbb{N} \;:\; n=\sum_{i=0}^{\infty} a_i g^i, a_i\not\in \{b_1,\ldots , b_t\} \}$
, and similarly
$\mathcal{B}(X)\;:\!=\;\mathcal{B} \cap [1,X]$
, then we can get similar asymptotics and bounds for Theorems 1·1, 1·4, 1·6 and Corollary 1·3 with
$\mathcal{B}(X)$
instead of
$\mathcal{A}(X)$
, and
\begin{align*} \mathfrak{S}(\overrightarrow{\boldsymbol{b}},g) \;:\!=\; \frac{g}{g-t} \bigg( 1 - \sum_{i=1}^t \frac{\rho(b_i ;\; g)}{\varphi^2(g)} \bigg), \end{align*}
instead of
$\mathfrak{S}(b,g)$
. These results would follow from the modifications mentioned in [
Reference Maynard14
] and playing around with other constants. The number
$768=192\times 4$
comes from Lemma 2·4, more precisely (3·7).
Remark 1·7. We can also prove similar results as Theorems 1·1, 1·4, 1·6 and Corollary 1·3 for the functions
and
The proof of these would be very similar with some minor modifications throughout. For example, as an asymptotic, we would get
\begin{align*} \sum_{n\in \mathcal{A}(X)} r_1(n) = \widetilde{\mathfrak{S}}(b,g) \frac{\pi}{4} \#\mathcal{A}(X) + O_A\bigg( \frac{\#\mathcal{A}(X)}{(\!\log X)^A} \bigg) , \end{align*}
where
and
$\widetilde{\rho}(a;\;q)\;:\!=\;\#\{(u,v)\in (\mathbb{Z}/q\mathbb{Z})^2 \;:\; (u,q)=1 , u^2+v^2\equiv a \,({\rm mod}\,q) \}$
. Also, we would get
and
However, in this case, obtaining an asymptotic for the size of this set is more difficult and would require studying the second moment of
$\widetilde{r_{*}}(n)$
over
$n\in \mathcal{A}(X)$
with a fixed number of prime factors. See [
Reference Daniel2
,
Reference Granville, Sedunova and Sabuncu5
] for more information on
$\widetilde{r_{*}}(n)$
and
$\widetilde{\rho}(a;\;q)$
.
1·1. Idea of the proof
To prove Theorem 1·1, we use the circle method as was used in the paper of Maynard [ Reference Maynard14 ] to study primes with missing digits. Major arcs are defined by
\begin{align*} \bigcup_{s\leqslant (\!\log X)^B} \bigcup_{\substack{ 1 \leqslant r \lt s \\ (r,s)=1}} \bigg[ \frac{r}{s} - \frac{(\!\log X)^B}{X} , \frac{r}{s} + \frac{(\!\log X)^B}{X} \bigg] ,\end{align*}
for some
$B\gt0$
. Most of the analysis for major arcs is similar except for getting the local factor, which requires understanding the prime factorisation of the base g. For the minor arcs, we need to understand sums of the form
for
$\alpha$
away from rationals with small denominator and
$y\leqslant \sqrt{X}$
. We can get cancellations for these sums, see Lemma 2·4.
For the proof of Theorem 1.4, we use an idea of the author [
Reference Sabuncu17
] to split
$p_1^2+q_1^2=p_2^2+q_2^2$
in
$\mathbb{Z}[i]$
as
$(a^2+b^2)(c^2+d^2)$
with some linear forms in a, b, c, d being prime. Then we can go from primes to very rough integersFootnote 1, and use an upper bound sieve to get rid of the roughness condition, see Lemma 2·11. At the end, we get a sum of the form
\begin{align*} \sum_{\substack{X^{3/4}/(a^2+b^2) \lt c^2+d^2 \leqslant X/(a^2+b^2) \\ (a^2+b^2)(c^2+d^2)\in \mathcal{A} \\ (c,d)\equiv (v_1,v_2)\,({\rm mod}\,h)}} 1, \end{align*}
for some
$h\leqslant H$
with
$H=\exp\!(O_g(\!\log X)^{1/2})$
. Then we can use the circle method machinery to understand this sum. In this case, we take major arcs a bit thinner, more precisely
\begin{align*} \bigcup_{s\leqslant \exp\!(C_g(\!\log X)^{1/2})} \bigcup_{\substack{1\leqslant r \lt s \\ (r,s)=1}} \bigg[ \frac{r}{s} - \frac{\exp\!\big(C_g(\!\log X)^{1/2}\big)}{X} , \frac{r}{s} + \frac{\exp\!\big(C_g(\!\log X)^{1/2}\big)}{X} \bigg] ,\end{align*}
for some constant
$C_g\gt0$
. However, in this case the local factor is more intricate than in the first part. Since we are only concerned with establishing an upper bound, many of these complications can be safely ignored. A detailed treatment is provided at the end of the paper. For minor arcs, we leverage the extra average over
$a^2+b^2$
. Essentially, we prove an averaged double quadratic exponential sum estimate, see Lemma 2·10, which gives us what we want.
Lastly, Theorem 1.6 follows from Corollary 1·3 and Theorem 1.4 by the Cauchy–Schwarz inequality and Markov’s inequality,
\begin{align*} \bigg(\sum_{n\in\mathcal{A}(X)} r_*(n) \bigg)^2 \bigg/ \bigg( \sum_{n\in \mathcal{A}(X)} r_*^2(n)\bigg) \leqslant \#\{ n\in \mathcal{A}(X) \;:\; r_*(n)\gt0\} \leqslant \sum_{n\in \mathcal{A}(X)} r_*(n) ,\end{align*}
and splitting the second moment into diagonal and off-diagonal contributions.
Proving the corollaries are easy in comparison, and we leave the fine details to the reader. To get Corollary 1·3, we use the following inequality
\begin{align*} (\!\log X^{1/4})^2 \sum_{\substack{p^2+q^2 \in \mathcal{A}(X) \\ p,q\gt X^{1/4}}} 1 \lt \sum_{n\in \mathcal{A}(X)} r_2(n) \leqslant (\!\log \sqrt{X})^2 \sum_{n\in \mathcal{A}(X)} r_*(n). \end{align*}
Next, we note that
\begin{align*} \sum_{\substack{p^2+q^2 \in \mathcal{A}(X) \\ p,q\gt X^{1/4}}} 1 = \sum_{n\in \mathcal{A}(X)} r_*(n) + O(X^{3/4}), \end{align*}
which proves the result.
Notation: We use the usual asymptotic notation of Vinogradov. By
$(a,b)\equiv (u,v) \,({\rm mod}\,q)$
we mean
$a\equiv u \,({\rm mod}\,q)$
and
$b\equiv v \,({\rm mod}\,q)$
. Throughout the paper, g is the base sufficiently large and b is the digit we are missing. We have
$X\;:\!=\;g^k$
with k an integer going to infinity. We use
$(a,b)=1$
to mean that a and b are coprime, and use [a, b] for the least common multiple of a and b. All our bounds depend on the base g which we only mention as a reminder to the reader. We also use
$\ll_A (\!\log X)^{-A}$
or
$O_A((\!\log X)^{-A})$
to mean that such a bound holds for any A with a constant depending on A, and similarly
$\ll_{\varepsilon} X^{\varepsilon}$
. In Section 3, we will have a fixed B that is sufficiently large which will take the place of A from the theorem. In Section 4, we will use
$\mathcal{P}_g$
to be the set of primes coprime to 3g.
2. Preliminary lemmas
2·1. Elementary results
We start by studying the properties of the function
$\rho(a;\;q)$
given by (1·1).
Lemma 2·1. We have for
$p\geqslant 3$
,
\begin{align*} \rho(\nu ;\; p) = \begin{cases} (1+\chi_4(p))(p-1) & \nu\equiv 0 \,({\rm mod}\,p) \\ p-1-\chi_4(p)-\big(\frac{\nu}{p}\big) & \nu\not\equiv 0\,({\rm mod}\,p), \end{cases} \end{align*}
where
$\chi_4$
is the non-principal character modulo 4, and
$\rho(\nu;\;p^a) = p^{a-1} \rho(\nu;\; p)$
for
$a\geqslant 1$
Footnote 2. In the case
$p=2$
, we have
$\rho(\nu;\;2)= 1_{\nu\equiv 0\,({\rm mod}\,2)}$
,
$\rho(\nu;\;4)=1_{\nu\equiv 2 \,({\rm mod}\,4)}\cdot 4$
and
$\rho(\nu;\;2^a)= 2^{a-3} \rho(\nu;\; 8)=1_{\nu\equiv 2 \,({\rm mod}\,8)}\cdot 2^{a+1}$
for
$a\geqslant 3$
.
Proof. This is [
Reference Plaksin16
, lemma 15], but we give a short proof here. The proof of the first part comes from classical estimates on the sums of Legendre symbols. To lift to prime powers, fix a
$\nu \,({\rm mod}\,p^a)$
, for a given solution
$(u,v)\in (\mathbb{Z}/p^{a-1}\mathbb{Z})^2$
with
$u^2+v^2\equiv \nu \,({\rm mod}\,p^{a-1})$
, then we can put
$(u+p^{a-1}k,v+p^{a-1}\ell)$
for
$0\leqslant k,\ell\lt p $
. Hence, we have
and this is
$\equiv \nu \,({\rm mod}\,p^a)$
if and only if
$2(k+\ell) \equiv (\nu-u^2-v^2)/p^{a-1} \,({\rm mod}\,p)$
. Therefore, we only have p choices for the pairs
$(k,\ell)$
. Now, we have
$(u_1+p^{a-1}k_1,v_1+p^{a-1}\ell_1)=(u_2+p^{a-1}k_2,v_2+p^{a-1}\ell_2)$
if and only if
$u_1\equiv u_2, v_1\equiv v_2, k_1\equiv k_2, \ell_1\equiv \ell_2 \,({\rm mod}\,p^{a-1})$
since
$(u_1v_1u_2v_2, p)=1$
. For the powers of 2, we check by hand 2, 4, 8 and we know if
$\nu\not\equiv 2 \,({\rm mod}\,8)$
, then
$\rho(\nu;\;2^a)=0$
for all
$a\geqslant 3$
. To lift
$\nu\equiv 2 \,({\rm mod}\,8)$
, we refer to [
Reference Daniel2
, lemma] since both functions are the same in this case.
Next, we have a lemma on the behaviour of the
$r_2(n)$
function in short intervals.
Lemma 2·2. Let X be a sufficiently large number, and fix
$A\gt0$
. We have for
$t\leqslant X$
,
\begin{align*} \sum_{t\lt n\leqslant t + X/(\!\log X)^A} r_2(n) = \frac{\pi}{4} \frac{X}{(\!\log X)^A} + O\bigg( \frac{X}{(\!\log X)^{10A}} \bigg). \end{align*}
Proof. To prove this, we first assume
$t\leqslant \sqrt{X}$
, then we have
for which the claim holds trivially. So, we can assume
$t\gt\sqrt{X}$
. We first take care of the case when
$n=a^2+b^2$
has
$\min\{a,b\} \leqslant t^{1/4}$
. In this case, we trivially have
\begin{align*} \sum_{\substack{t\lt a^2+b^2\lt t+X/(\!\log X)^A \\ \min\{a,b\}\leqslant t^{1/4}}} \Lambda(a)\Lambda(b) \ll_{\varepsilon} X^{1/2}t^{1/4+\varepsilon} \leqslant X^{3/4+\varepsilon}, \end{align*}
since
$\#\{a^2+b^2=n\} \ll n^{\varepsilon}$
. We focus on the annulus
$t \lt x^2+y^2 \leqslant t+X/(\!\log X)^A$
with
$\min\{x,y\}\gt t^{1/4}$
, and split this region into a dyadic partition of squares. Let W be a smooth non-negative function supported on [
Reference Blomer and Brüdern1, Reference Daniel2
] such that
where
$M_1,M_2\geqslant 1$
run over a sequence of positive real numbers such that
$t\leqslant M_1^2+M_2^2 \leqslant t + X/(\!\log X)^A$
, and
$\min\{M_1,M_2\} \gt t^{1/4}$
with
$\#\{M_1,M_2\} \ll (\!\log X)^2$
. Then we have, by the prime number theorem in short intervals and partial summation,
\begin{align*} & \sum_{M_1,M_2} \sum_{m_1,m_2} W\bigg( \frac{m_1}{M_1} \bigg)W\bigg( \frac{m_2}{M_2} \bigg) \Lambda(m_1) \Lambda(m_2) = \sum_{M_1,M_2} \int_{\mathbb{R}} W\bigg( \frac{x}{M_1} \bigg) dx \int_{\mathbb{R}}W\bigg( \frac{y}{M_2} \bigg) dy \\&\quad + O\Bigg( \sum_{t\lt M_1^2+M_2^2\lt t+X/(\!\log X)^A} \frac{M_1M_2}{\min\{(\!\log M_1)^{50A} , (\!\log M_2)^{50A}\}} \Bigg),\end{align*}
where we used
$W( u /M ) \ll 1$
for
$M\leqslant u \leqslant 2M$
. Since we have
$\min\{M_1,M_2\} \gt t^{1/4} \gg X^{1/8}$
since
$t\gt\sqrt{X}$
. Using this, we get that the error term is
$\ll X/(\!\log X)^{10A}$
since
$t\leqslant X$
. For the main term, we have, by changing the sum and the integrals,
\begin{align*} \sum_{M_1,M_2} \int_{\mathbb{R}^2}\! W\bigg( \frac{x}{M_1} \bigg) W\bigg( \frac{y}{M_2} \bigg) dxdy = \int_{\substack{t\lt x^2+y^2 \lt t+X/(\!\log X)^A \\ \min\{x,y\} \gt t^{1/4}}} 1 dxdy = \frac{\pi}{4}\frac{X}{(\!\log X)^A} + O_{\varepsilon}(X^{3/4+\varepsilon}).\end{align*}
The following is an elementary lemma that we give without the proof.
Lemma 2·3. Let x be a sufficiently large number and take
$q\leqslant x^{\varepsilon}$
. We have for
$0 \lt u,v \leqslant q$
,
\begin{align*} \sum_{\substack{a^2+b^2\leqslant x \\ (a,b)\equiv (u,v)\,({\rm mod}\,q)}} 1 = \frac{\pi}{4} \frac{x}{q^2}+O\bigg( \frac{\sqrt{x}}{q} \bigg) .\end{align*}
2·2. Exponential sum estimates
We start with the following result on exponential sums over squares of primes. Similar estimates appeared in [ Reference Kawada and Wooley8 ] to get results on Waring’s problem in higher powers.
Lemma 2·4. Let
$\alpha={r}/{s} +\xi$
with
$(r,s)=1$
,
$s\leqslant N^{3/4}$
, and
$s|\xi|\lt1/N^{3/4}$
. Then we have uniformly for
$x\leqslant \sqrt{N}$
and
$s \leqslant N^{1/8}$
,
\begin{equation}\sum_{n\leqslant x} \Lambda(n) e(\alpha n^2) \ll_{\varepsilon} \bigg( N^{2/5+\varepsilon} + \frac{1}{s^{1/2-\varepsilon}|\xi|^{1/2}} \bigg) (\!\log N)^c , \end{equation}
for some absolute constant
$c\gt0$
, and for
$s\geqslant (\!\log N)^{3073}$
, we have
\begin{equation}\sum_{n\leqslant x} \Lambda(n) e(\alpha n^2) \ll N (\!\log N) \bigg( \frac{1}{s} + \frac{1}{N^{1/3}}+ \frac{s}{N^2} \bigg)^{\frac{1}{192}} . \end{equation}
Proof. See Vinogradov [
Reference Vinogradov21
] for the latter inequality. For the first inequality, we trivially bound when
$x\leqslant N^{2/5}$
which is negligible. In the case
$x\gt N^{2/5}$
, we use [
Reference Kumchev9
, theorem 2] by splitting
$x^{5/8}\lt p\leqslant x$
into dyadic ranges
$P\lt p\leqslant 2P$
and with
$Q=P^{1/2}$
. Note that we have
$N^{1/4}\lt P\leqslant \sqrt{N}$
in this case, and since
$s\leqslant N^{1/8}\lt P^{1/2}$
the condition
$|s\alpha - r| \leqslant 1/\sqrt{N}\lt 1/P^{3/2}$
is satisfied by definition. We bound
$n\leqslant x^{5/8} \ll N^{5/16}$
trivially, which can be absorbed to the
$N^{2/5+\varepsilon}$
term.
We use this to get information on exponential sums of
$r_2(n)$
.
Lemma 2·5. Under the assumptions of Lemma 2·4, we have for
$s\leqslant N^{1/8}$
,
\begin{equation}\sum_{n\leqslant N} r_2(n) e(\alpha n) \ll_{\varepsilon} \bigg( N^{9/10+\varepsilon} + \frac{\sqrt{N}}{s^{1/2-\varepsilon}|\xi|^{1/2}} \bigg) (\!\log N)^c ,\end{equation}
for some absolute constant
$c\gt0$
, and for
$s\gg (\!\log N)^{3073}$
,
\begin{equation}\sum_{n\leqslant N} r_2(n) e(\alpha n) \ll N (\!\log N)\bigg( \frac{1}{s}+ \frac{1}{N^{1/3}} + \frac{s}{N^2} \bigg)^{\frac{1}{192}} . \end{equation}
Proof. Recall that
$r_2(n)= \sum_{n=a_1^2+a_2^2} \Lambda(a_1)\Lambda(a_2)$
. Hence, if we write
$n=q_1^2+q_2^2$
, then by the triangle inequality, we get
\begin{align*} \left|\sum_{n\leqslant N} r_2(n) e(\alpha n) \right| \leqslant \sum_{q_1\leqslant \sqrt{N}} \Lambda(q_1) \left| \sum_{q_2\leqslant \sqrt{N-q_1^2}} \Lambda(q_2) e\big(\alpha q_2^2\big) \right|, \end{align*}
and use Lemma 2·4.
Next, we have some lemmas from Maynard [
Reference Maynard14
] on the exponential sum over the set of missing digits
$\mathcal{A}$
. For this, define
Lemma 2·6 (Maynard [
Reference Maynard14
, lemma 5·1]). There exists a constant
$C_g \in [1/\log g,$
$1+3/\log g]$
such that
\begin{align*} \sup_{\theta\in \mathbb{R}} \sum_{0\leqslant a \lt X} \bigg|\widehat{1}_{\mathcal{A}}\bigg(\theta + \frac{a}{X}\bigg)\bigg| \ll (C_g g \log g)^k. \end{align*}
Lemma 2·7 (Maynard [
Reference Maynard14
, lemma 5·3]). Let
$S,B\gg 1$
. Then we have
\begin{align*} \sum_{S\leqslant s \lt2S} \sum_{\substack{1\leqslant r \lt s \\ (r,s)=1 }} \sum_{\substack{|\eta|\lt D \\ Xr/s+\eta \in \mathbb{Z}}} \bigg| \widehat{1}_{\mathcal{A}}\bigg( \frac{r}{s} + \frac{\eta}{X} \bigg)\bigg| \ll \#\mathcal{A}(X) (S^2D)^{\alpha_g} + S^2D(C_g \log g)^k , \end{align*}
where
$C_g$
is the constant in Lemma 2·6, and
Lemma 2·8. Let
$s\lt X^{1/3}$
be of the form
$s=s_1s_2$
with
$(s_1,g)=1$
and
$s_1\not=1$
, and let
$|\epsilon|\lt1/2X^{2/3}$
. Then for any
$(r,s)=1$
, we have
for some constant
$c_g\gt0$
depending only on g.
Proof. This can be obtained from [
Reference Maynard14
, lemma 5·4] by changing
$c_q$
there to
$c_g /\log g$
.
Remark 2·9. Note that if we had major arcs of the form
\begin{align*} \bigcup_{s\leqslant S}\bigcup_{\substack{1 \leqslant r \lt s \\ (r,s)=1}} \bigg[ \frac{r}{s} - \frac{S}{X} , \frac{r}{s} + \frac{S}{X} \bigg], \end{align*}
then we would be summing the above quantity over
$s\leqslant S$
, which gives
\begin{align*} \sum_{s\leqslant S} \sum_{\substack{1\leqslant r \lt s \\ (r,s)=1}} \sum_{\substack{|\eta|\leqslant S \\ Xr/s + \eta \in \mathbb{Z}}} \bigg|\widehat{1}_{\mathcal{A}} \bigg( \frac{r}{s} +\varepsilon \bigg)\bigg| \ll \#\mathcal{A}(X) X^{- c_g /\log S} S^3. \end{align*}
From this, one can see that the best S to get savings for this sum is
$\exp\!(c_g^{1/2}/3 (\!\log X)^{1/2})$
. This in turn means our error term can only have a saving of a power of
$\exp\!(O((\!\log X)^{1/2}))$
. However, this means we can’t take our sieving variable to be beyond this, and we need
$S=\exp\!((\!\log X)^{3/4+\varepsilon})$
to get an asymptotic in Theorem 1.6.
Finally, we have the following exponential sum to study minor arcs coming from the study of Theorem 1.4.
Lemma 2·10. Let
$\alpha = r/s + \xi$
with
$(r,s)=1$
,
$s\leqslant x$
, and
$|\xi|\lt 1/s^2$
. Also let
$M_1,M_2,N$
be positive integers with
$(M_1^2+M_2^2)N\ll x$
and
$\max\{ M_1,M_2 \} \gg x^{\delta}$
for some
$\delta\gt0$
. Then, for any sequence
$(a_n)_{n\in \mathbb{N}}$
with
$|a_n|\leqslant \tau(n)$
, we haveFootnote 3
\begin{align*}\sum_{n\leqslant N} a_n \sum_{\substack{m_1\leqslant M_1 \\ m_2\leqslant M_2 \\ (m_1,m_2)\equiv (u,v)\,({\rm mod}\,q)}} e\big(\alpha n\big(m_1^2+m_2^2\big)\big) \ll q^{1/2} \bigg( x^{1-\delta/4} + x (s|\xi|)^{1/4} + \frac{x^{3/4}}{(s|\xi|)^{1/4}} \bigg) (\!\log x)^3 ,\end{align*}
and also for
$s\gg 1$
sufficiently large
\begin{align*}\sum_{n\leqslant N} a_n \sum_{\substack{m_1\leqslant M_1 \\ m_2\leqslant M_2 \\ (m_1,m_2)\equiv (u,v)\,({\rm mod}\,q)}} e\big(\alpha n\big(m_1^2+m_2^2\big)\big) \ll q^{1/2} \bigg( x^{1-\delta/4} +s^{1/4}x^{3/4}+ \frac{x}{s^{1/4}} \bigg) (\!\log x)^3 . \end{align*}
Proof. Without loss of generality, we can assume
$M_2\leqslant M_1$
, and thus
$NM_1^2 \ll x$
. We start by applying Cauchy-Schwarz twice to our equation to get
\begin{align*}& \bigg| \sum_{n\leqslant N} a_n \sum_{\substack{m_1\leqslant M_1 \\ m_2\leqslant M_2 \\ (m_1,m_2)\equiv (u,v)\,({\rm mod}\,q)}} e\big(\alpha n\big(m_1^2+m_2^2\big)\big) \bigg| \leqslant \bigg( M_1M_2 \sum_{n\leqslant N} |a_n|^2 \bigg)^{1/2} \\&\quad \times\bigg( \sum_{n\leqslant N} \bigg| \sum_{\substack{m_2\leqslant M_2 \\ m_2\equiv v\,({\rm mod}\,q)}} e\big(\alpha nm_2^2\big) \bigg| \cdot \bigg| \sum_{\substack{m_1\leqslant M_1 \\ m_1\equiv u\,({\rm mod}\,q)}} e\big(\alpha nm_1^2\big) \bigg| \bigg)^{1/2} \leqslant \bigg( M_1M_2 \sum_{n\leqslant N} |a_n|^2 \bigg)^{1/2} \\&\quad \times\bigg( \sum_{n\leqslant N} \bigg| \sum_{\substack{m_2\leqslant M_2 \\ m_2\equiv v\,({\rm mod}\,q)}} e\big(\alpha nm_2^2\big) \bigg|^2 \bigg)^{1/4} \bigg( \sum_{n\leqslant N} \bigg| \sum_{\substack{m_1\leqslant M_1 \\ m_1\equiv u\,({\rm mod}\,q)}} e\big(\alpha nm_1^2\big) \bigg|^2 \bigg)^{1/4} .\end{align*}
We note that the sum
$\sum_{n\leqslant N} |a_n|^2 \ll N (\!\log x)^3$
since
$|a_n|\leqslant \tau(n)$
. By symmetry, we just focus on the
$m_1$
sum. We have, by the Weyl differencing,
\begin{align*}& \bigg|\sum_{\substack{m_1\leqslant M_1 \\ m_1\equiv u\,({\rm mod}\,q)}} e\big(\alpha nm_1^2\big) \bigg|^2\\ &\quad \leqslant \sum_{\substack{|h|\leqslant M_1 \\ q|h}} \bigg| \sum_{\substack{m\leqslant M_1 \\ m\equiv u \,({\rm mod}\,q)}} e(2\alpha n h m) \bigg| \ll M_1 + \sum_{0\lt|h|\leqslant M_1} \min\big\{ M_1 , \| 2\alpha q n h \|^{-1} \big\} . \end{align*}
We also have the sum over
$n\leqslant N$
, hence, we can glue together
$\ell\;:\!=\;2n|h|q$
to get
\begin{align*} \sum_{n\leqslant N}\bigg|\sum_{\substack{m_1\leqslant M_1 \\ m_1\equiv u\,({\rm mod}\,q)}} e\big(\alpha nm_1^2\big) \bigg|^2 \ll NM_1 + \sum_{\ell \leqslant 2qNM_1} \tau(\ell) \min \big\{ M_1 , \|\alpha \ell \|^{-1} \big\} . \end{align*}
We split the sum over
$\ell$
into
$\tau(\ell)\leqslant B$
and
$\tau(\ell) \gt B$
with
\begin{align*} B\;:\!=\; \bigg( \frac{1}{M_1} + s|\xi| + \frac{1}{qNM_1^2 s|\xi|}\bigg)^{-1/2}. \end{align*}
Then for
$\tau(\ell)\leqslant B$
using the trivial bound and [
Reference Maynard14
, lemma 4·1]Footnote 4 for the remaining sum, and for
$\tau(\ell)\gt B$
using Rankin’s trick, we get
\begin{align*} \sum_{n\leqslant N} \bigg|\sum_{\substack{m_1\leqslant M_1 \\ m_1\equiv u\,({\rm mod}\,q)}} e\big(\alpha nm_1^2\big) \bigg|^2 \ll NM_1 + qNM_1^2 \bigg( \frac{1}{M_1} + s|\xi| + \frac{1}{NM_1^2 s|\xi|}\bigg)^{1/2} (\!\log x)^3. \end{align*}
Note that the
$NM_1$
term is smaller than the first term on the right. We get a similar result for the
$m_2$
sum, and since
$M_2\leqslant M_1$
, we can assume that we get the same bound. Hence, we get
\begin{align*}& \sum_{n\leqslant N} a_n \sum_{\substack{m_1\leqslant M_1 \\ m_2\leqslant M_2 \\ (m_1,m_2)\equiv (u,v)\,({\rm mod}\,q)}} e\big(\alpha n\big(m_1^2+m_2^2\big)\big)\\ &\quad \ll q^{1/2} \big(N M_1^2\big)^{1/2} \bigg( N^2M_1^3 + N^2M_1^4 s|\xi| + \frac{NM_1^2}{s|\xi|} \bigg)^{1/4} (\!\log x)^3 \\ &\quad \ll q^{1/2} \bigg( N M_1^{7/4} + N M_1^2 (s|\xi|)^{1/4} + \frac{\big(NM_1^2\big)^{3/4}}{(s|\xi|)^{1/4}} \bigg) (\!\log x)^3.\end{align*}
Lastly, since
$NM_1^2 \ll x$
and
$M_1\gg x^{\delta}$
, we get the first result. For the second one, we use the classical estimate
\begin{align*} \sum_{n\leqslant N} \min\{M , \|\alpha n \|^{-1}\} \ll \bigg(M+N+\frac{MN}{s} + s \bigg) \log x ,\end{align*}
instead.
2·3. Sieve result
Lastly, we have the following beta sieve result, see [ Reference Iwaniec and Kowalski7 , fundamental lemma 6·8].
Lemma 2·11. Let
$z\geqslant 2$
,
$\kappa\gt0$
, and
$D=z^s$
with
$s\geqslant 9\kappa + 2$
, and
$\mathcal{S}$
be a set of primes. There exists coefficients
$\lambda_d$
depending only on
$\kappa$
and D such that the following hold:
-
(i) we have that
$|\lambda_d|\leqslant 1$
and is supported in
$\{d\leqslant D \;:\; d|P(z)\}$
, where
$P(z)\;:\!=\;\prod_{\substack{p\lt z \\ p\in \mathcal{S}}} p$
; -
(ii) we have
\begin{align*}1_{(n,P(z))=1} \leqslant \sum_{d|n}\lambda_d;\end{align*}
-
(iii) if
$g\;:\;\mathbb{N}\to [0,1)$
is a multiplicative function such that
$g(p)=0$
if
$p\not\in \mathcal{S}$
, and for any
\begin{align*} \prod_{w_1 \lt p \leqslant z_1} (1 - g(p))^{-1} \ll_{\kappa} \bigg(\frac{\log z_1}{\log w_1}\bigg)^{\kappa}, \end{align*}
$2\leqslant w_1 \lt z_1$
, then
\begin{align*} \sum_{d|P(z)} \lambda_d \cdot g(d) \ll_{\kappa} \prod_{p\leqslant z} (1 - g(p) ). \end{align*}
3. Average of the representation function
We work on (1·3). By inverse Fourier transform
\begin{align*} \sum_{n\in \mathcal{A}(X)} r_2(n) = \sum_{n\leqslant X} r_2(n) 1_{\mathcal{A}}(n) = \frac{1}{X} \sum_{a\leqslant X} \widehat{1}_{\mathcal{A}}\bigg(\frac{a}{X}\bigg) S\bigg(\frac{-a}{X}\bigg), \end{align*}
where
is the Fourier transform of the indicator function of the set
$\mathcal{A}$
, and
is the Fourier transform of
$r_2(n)$
. Now, we split into major and minor arcs. If we fix
$B\gt0$
large enough, then we can define
Then, major arcs are defined as
\begin{align*} \mathfrak{M} \;:\!=\; \bigcup_{s\leqslant (\!\log X)^B} \bigcup_{\substack{1\leqslant r \lt s \\ (r,s)=1}} \mathfrak{M}_{r,s}, \end{align*}
and minor arcs are
Then we have
\begin{align*} \frac{1}{X} \sum_{a\leqslant X} &\widehat{1}_{\mathcal{A}}\bigg(\frac{a}{X}\bigg) S\bigg(\frac{-a}{X}\bigg) = \frac{1}{X} \sum_{a\in \mathfrak{M}} \widehat{1}_{\mathcal{A}}\bigg(\frac{a}{X}\bigg) S\bigg(\frac{-a}{X}\bigg) + \frac{1}{X} \sum_{a\in \mathfrak{m}} \widehat{1}_{\mathcal{A}}\bigg(\frac{a}{X}\bigg) S\bigg(\frac{-a}{X}\bigg) \\&= \frac{1}{X} \sum_{s\leqslant (\!\log X)^B} \sum_{\substack{1\leqslant r \lt s \\ (r,s)=1}} \sum_{\substack{|\eta|\leqslant (\!\log X)^B \\ Xr/s + \eta\in \mathbb{Z}}}\widehat{1}_{\mathcal{A}}\bigg(\frac{r}{s}+ \frac{\eta}{X}\bigg) S\bigg(\frac{-r}{s} + \frac{-\eta}{X}\bigg)\\ & \quad + \frac{1}{X} \sum_{a\in \mathfrak{m}} \widehat{1}_{\mathcal{A}}\bigg(\frac{a}{X}\bigg) S\bigg(\frac{-a}{X}\bigg) ,\end{align*}
since we can write
$\xi={\eta}/{X}$
.
3·1. Major arcs
For the major arcs, we have
${a}/{X} = {r}/{s} + {\eta}/{X}$
with
$|\eta| \leqslant (\!\log X)^B$
. We split into 3 cases:
Case 1:
$\exists p|s$
but
$p\nmid g$
. In this case by Lemma 2·8, we get
\begin{equation} \frac{1}{X} \sum_{\substack{s\leqslant (\!\log X)^B \\ \exists p|s, p\nmid g}} \sum_{\substack{1 \leqslant r \lt s \\ (r,s)=1}} \sum_{\substack{|\eta|\leqslant (\!\log X)^B \\ Xr/s + \eta\in \mathbb{Z}}}\widehat{1}_{\mathcal{A}}\bigg(\frac{r}{s}+ \frac{\eta}{X}\bigg) S\bigg(\frac{-r}{s} + \frac{-\eta}{X}\bigg) \ll _{\varepsilon}\#\mathcal{A}(X)\cdot \exp\!\big(\!- c_g (\!\log X)^{1-\varepsilon}\big) ,\end{equation}
by trivially bounding
$S(\!-r/s - \eta/X) \ll X$
, and using the bound
$\log X/(B\log\log X) \gg_{\varepsilon} (\!\log X)^{1-\varepsilon}$
for
$X\to\infty$
.
Case 2:
$\eta\not=0$
. In this case, we have
\begin{align*}\sum_{n\leqslant X} r_2(n) e\bigg(\bigg(\frac{-r }{s} + \frac{-\eta }{X} \bigg) n \bigg) &= \sum_{\nu\,({\rm mod}\,s)} e\bigg( \frac{-r\nu}{s}\bigg) \sum_{\substack{n\leqslant X \\ n\equiv \nu \,({\rm mod}\,s)}} r_2(n) e\bigg(\frac{-\eta n}{X}\bigg)\\&= \frac{1}{\varphi^2(s)}\sum_{\nu\,({\rm mod}\,s)} e\bigg( \frac{-r\nu}{s}\bigg) \rho(\nu;\;s) \sum_{n\leqslant X} r_2(n) e\bigg(\frac{-\eta n}{X}\bigg)+ E( X ;\;s),\end{align*}
where we recall
$\rho(\nu;\;s)$
is the multiplicative function
and
\begin{align*}E(X;\;s) \leqslant s \cdot \max_{\nu\,({\rm mod}\,s)}\bigg| \sum_{n\leqslant X} r_2(n) e\bigg( \frac{-\eta n}{X} \bigg) \bigg(1_{n\equiv \nu \,({\rm mod}\,s)} - \frac{\rho(\nu;\;s)}{\varphi^2(s)}\bigg) \bigg| . \end{align*}
By the Siegel-Walfisz theorem, we know
\begin{align*}E(t) \;:\!=\;\max_{\nu\,({\rm mod}\,s)}\bigg|\sum_{n\leqslant t} r_2(n) \bigg(1_{n\equiv \nu \,({\rm mod}\,s)} - \frac{\rho(\nu;\;s)}{\varphi^2(s)}\bigg) \bigg| \ll_A \frac{t}{(\!\log t)^A},\end{align*}
so, using partial summation we get that
\begin{align}E(X;\;s) &= s\cdot \bigg( e(\!-\eta) E(X) - e(\!-\eta/X)E(1) + \frac{\eta}{X}\cdot \int_1^X e\bigg( \frac{-\eta t}{X} \bigg) E(t) dt \bigg) \nonumber \\&\ll_A X/(\!\log X)^A ,\end{align}
since
$s, |\eta| \leqslant (\!\log X)^B$
. Hence, bounding the Fourier transform
$\widehat{1}_{\mathcal{A}}$
trivially and summing over
$s,\eta$
, we get an error term of
$\ll X/(\!\log X)^B$
coming from
$E(X;\;s)$
. By Lemma 2·2, we get by splitting into short intervals,
\begin{align}\sum_{n\leqslant X} r_2(n) e\bigg(\frac{-\eta n }{X} \bigg) &= \sum_{t\ll X} \sum_{t \lt n \leqslant t + X/\lfloor (\!\log X)^{5B}\rfloor} r_2(n) e\bigg(\frac{-\eta n }{X} \bigg) \nonumber \\[5pt]&= \sum_{t\ll X} e\bigg( \frac{-\eta t}{X} \bigg) \sum_{t\lt n\leqslant t+X/\lfloor (\!\log X)^{5B} \rfloor} r_2(n) + O_B \bigg( \frac{X}{(\!\log X)^{4B}} \bigg) \nonumber \\[5pt]&= \frac{\pi}{4} \frac{X}{(\!\log X)^{5B}} \sum_{t\ll X} e\bigg( \frac{-\eta t}{X} \bigg) + O_B\bigg( \frac{X}{(\!\log X)^{4B}} \bigg) \nonumber \\[5pt]&= \frac{\pi}{4} \frac{X}{(\!\log X)^{5B}} \sum_{0\leqslant m \lt \lfloor (\!\log X)^{5B}\rfloor}e\bigg( \frac{-\eta m}{\lfloor (\!\log X)^{5B}\rfloor} \bigg) \nonumber \\[5pt] & \quad + O_B \bigg( \frac{X}{(\!\log X)^{4B}} \bigg) \ll \frac{X}{(\!\log X)^{4B}} ,\end{align}
where we parametrised
$t=m X/\lfloor (\!\log X)^{5B}\rfloor$
and also noticed the exponential sum is 0 since
$\eta\not=0$
. Thus, from (3·2) and (3·3), we get an error term of
where we bounded trivially the Fourier transform
$|\widehat{1}_{\mathcal{A}}(\theta) | \leqslant \#\mathcal{A}(X)$
.
Case 3:
$\eta=0$
and
$p|s\implies p|g$
. This will be the main term, and we focus on the subset of
$s\leqslant (\!\log X)^B$
with
$p|s \implies p|g$
, and
$\eta=0$
. Then we have
\begin{gather*}\frac{1}{X} \sum_{\substack{s\leqslant (\!\log X)^B \\ p|s\implies p|g}} \sum_{\substack{1\leqslant r \lt s \\ (r,s)=1}} \frac{1}{\varphi^2(s)} \sum_{c\in \mathcal{A}} \sum_{\nu \,({\rm mod}\,s)} e\bigg(\frac{-r(\nu-c)}{s} \bigg) \rho(\nu;\; s) \sum_{n\leqslant X} r_2(n).\end{gather*}
We can take out the sum over
$n\leqslant X$
since there is no dependence on it elsewhere. For the remaining sum, we note that for any choice of
$J \leqslant (\!\log\log X)/\log 2$
, we focus on
$s|g^J$
. So, we have
\begin{gather*}\frac{\pi}{4} \cdot \sum_{\substack{s|g^J }} \sum_{\substack{1\leqslant r \lt s \\ (r,s)=1}} \frac{1}{\varphi^2(s)} \sum_{c\in \mathcal{A}} \sum_{\nu \,({\rm mod}\,s)} e\bigg(\frac{-r(\nu-c)}{s} \bigg) \rho(\nu;\; s) + O_A\bigg( \frac{\#\mathcal{A}(X)}{(\!\log X)^A} \bigg).\end{gather*}
Now, we write
$s=s_1\cdots s_{\ell}$
where
$g=g_1\cdots g_{\ell}$
where
$g_i$
are pairwise coprime prime powers and
$s_i | g_i^J$
. In this case, we can further write
$r=\sum_{i=1}^{\ell}r_i \prod_{j\not=i} s_j$
for some unique
$(r_i,s_i)=1$
for
$i\in [\ell]$
. Similarly, we can write
$\nu=\sum_{i=1}^{\ell} \nu_i \prod_{j\not= i} s_j$
for some unique
$\nu_i \,({\rm mod}\,s_i)$
. This gives us
\begin{align*}& \sum_{\substack{s| g^J}}\sum_{\substack{1\leqslant r \lt s \\ (r,s)=1}} \frac{1}{\varphi(s)} \sum_{\nu \,({\rm mod}\,s)} \frac{\rho(\nu;\; s)}{\varphi(s)} \sum_{c\in \mathcal{A}}e\bigg(\frac{-r(\nu-c)}{s} \bigg) \\&\quad = \sum_{c\in \mathcal{A}} \prod_{i=1}^{\ell}\sum_{\substack{s_i| g_i^J}} \sum_{\substack{1\leqslant r_i \lt s_i \\ (r_i,s_i)=1}} \frac{1}{\varphi(s_i)} \sum_{\nu_i \,({\rm mod}\,s_i)} \frac{\rho(\mu_i\nu_i;\; s_i)}{\varphi(s_i)} e\bigg(\frac{-r_i(\mu_i\nu_i-c)}{s_i} \bigg),\end{align*}
where we denote
$\mu_i \;:\!=\;\prod_{j\not=i}s_j$
. Then we can write the individual sum for
$s_i$
(
$g_i$
coprime to 2) as
\begin{align*} & \sum_{\substack{s_i| g_i^J}} \sum_{\substack{1\leqslant r_i \lt s_i \\ (r_i,s_i)=1}} \frac{1}{\varphi(s_i)} \sum_{\nu_i \,({\rm mod}\,s_i)} \frac{\rho(\mu_i\nu_i;\; s_i)}{\varphi(s_i)} e\bigg(\frac{-r_i(\mu_i\nu_i-c)}{s_i} \bigg) \\ &\quad = 1 + \sum_{\substack{s_i| g_i^J \\ s_i\gt1}} \sum_{\substack{1\leqslant r_i \lt s_i \\ (r_i,s_i)=1}} \frac{1}{\varphi(s_i)} \frac{s_i}{g_i^J} \sum_{\nu_i \,({\rm mod}\,g_i^J)} \frac{\rho(\mu_i\nu_i;\;s_i)}{\varphi(s_i)} e\bigg(\frac{-r_i (\mu_i\nu_i-c)}{s_i} \bigg) \\ &\quad = 1 + \sum_{\substack{s_i| g_i^J \\ s_i\gt1}} \sum_{\substack{1\leqslant r_i \lt s_i \\ (r_i,s_i)=1}} \frac{1}{\varphi\big(g_i^J\big)}\sum_{\nu_i \,({\rm mod}\,g_i^J)} \frac{\rho(\mu_i\nu_i;\;g_i^J)}{\varphi\big(g_i^J\big)} e\bigg(\frac{-r_i (\mu_i\nu_i-c)}{s_i} \bigg) \\ &\quad = \sum_{\substack{s_i| g_i^J}} \sum_{\substack{1\leqslant r_i \lt s_i \\ (r_i,s_i)=1}} \sum_{\nu_i \,({\rm mod}\,g_i^J)} \frac{\rho(\mu_i\nu_i;\;g_i^J)}{\varphi^2\big(g_i^J\big)} e\bigg(\frac{-r_i (\mu_i\nu_i-c)}{s_i} \bigg),\end{align*}
where to get the first line we used the fact that
$\nu \to \nu + ks_i$
for
$0\leqslant k \lt g_i^J/s_i$
gives the same residue class
$\bmod s_i$
. For the second line, we use the fact that
$\rho(\nu;\;s_i)/\varphi(s_i)$
is independent of powers of
$s_i$
by Lemma 2·1 and properties of
$\varphi(s_i)$
. Same idea for
$s_i/\varphi(s_i) = g_i^J/\varphi(g_i^J)$
. For the last line, we add back the
$s_i=1$
to the sum since
$(g_i,\mu_i)=1$
. The case when one of
$g_i$
is power of 2 is done in the same way, but we take out the cases
$s_i=2, 4$
just like
$s_i=1$
, and then add it back at the end. This can be done because
$\rho(\nu;\;2^a)$
is supported on
$\nu\equiv 2\,({\rm mod}\,4)$
.
Now, we glue back the
$s_i$
sums as well as the
$r_i$
and
$\nu_i$
. This gives us
\begin{align*} \sum_{c\in \mathcal{A}} \sum_{\substack{s|g^J}} \sum_{\substack{1\leqslant r \lt s\\ (r,s)=1}} \sum_{\nu \,({\rm mod}\,g^J)} \frac{\rho(\nu;\;g^J)}{\varphi^2(g^J)} e\bigg( \frac{-r(\nu-c)}{s} \bigg), \end{align*}
where we used the fact that
$\rho(\mu_i\nu_i;\;g_i^J)=\rho(\nu;\;g_i^J)$
since
$\nu\equiv \mu_i\nu_i \,({\rm mod}\,g_i^J)$
, and the multiplicativity of
$\rho(\nu;\;s)$
. Writing
$r/s=\ell/g^J$
to get
\begin{align*}\sum_{\nu \,({\rm mod}\,g^J)}\frac{\rho(\nu;\;g^J)}{\varphi^2(g^J)} \sum_{c\in \mathcal{A}} \sum_{0\leqslant \ell \lt g^J}e\bigg(\frac{-\ell (\nu-c)}{g^J} \bigg) .\end{align*}
We note that
\begin{align*} \sum_{0\leqslant \ell \lt g^J}e\bigg(\frac{-\ell (\nu-c)}{g^J} \bigg) = \begin{cases} g^J & \text{if } c\equiv \nu \,({\rm mod}\,g^J) \text{ and } \nu=\sum_{i=0}^Ja_ig^i \text{ with } a_i\not=b ,\forall i \\ 0 & \text{otherwise}.\end{cases} \end{align*}
Now, using this identity, we get
\begin{align*} \sum_{\substack{\nu \,({\rm mod}\,g^J) \\ \nu=\sum_{i=0}^{J-1} a_ig^i , a_i\not=b, \forall i}} g^J \cdot \frac{\rho(\nu;\;g^J)}{\varphi^2(g^J)} \sum_{\substack{c\in \mathcal{A} \\ c\equiv \nu \,({\rm mod}\,g^J)}} 1 .\end{align*}
We can count the sum over missing digits in this case as
$(g-1)^{k-J}$
, which gives us at the end
\begin{equation} \frac{\pi}{4} \cdot \sum_{\substack{s| g^J}} \sum_{\substack{1\leqslant r \lt s\\ (r,s)=1}} \frac{1}{\varphi(s)} \sum_{\nu \,({\rm mod}\,s)} \frac{\rho(\nu;\; s)}{\varphi(s)} \sum_{c\in \mathcal{A}}e\bigg(\frac{-r(\nu-c)}{s} \bigg)= \mathfrak{S}(b,g) \cdot \frac{\pi}{4} \#\mathcal{A}(X) ,\end{equation}
where
\begin{align*}\mathfrak{S}(b,g) = \frac{g^J}{(g-1)^J} \cdot \sum_{\substack{\nu \,({\rm mod}\,g^J) \\ \nu=\sum_{i=0}^{J-1} a_ig^i , a_i\not=b,\forall i}} \frac{\rho(\nu;\;g^J)}{\varphi^2(g^J)} &= \frac{1}{(g-1)^J} \cdot \sum_{\substack{\nu \,({\rm mod}\,g^J) \\ \nu=\sum_{i=0}^{J-1} a_ig^i , a_i\not=b,\forall i}} \frac{g \cdot \rho(\nu;\;g)}{\varphi^2(g)} \\[5pt]&= \frac{g}{g-1} \bigg( 1 - \frac{\rho(b;\;g)}{\varphi^2(g)} \bigg),\end{align*}
where we used the fact that
$g^J\rho(\nu;\;g^J)/\varphi^2(g^J)$
is independent of the power of g to get the first line, and noticing that
$\rho(\nu;\;g)$
only depends on the last digit of
$\nu$
in base g, hence if
$\nu=\sum_{i=0}^{J-1} a_i g^i$
, summing over
$0\leqslant a_i\lt g$
for
$0\lt i\leqslant J-1$
, we get a
$(g-1)^{J-1}$
factor. The remaining sum over
$0\leqslant a_0\lt g$
gives the factor with
$\rho(b;\;g)$
.
3·2. Minor arcs
We wish to estimate the sum
By the Dirichlet approximation theorem, if
$a\in \mathfrak{m}$
, write
${a}/{X} = {r}/{s} + {\eta}/{X}$
for
$s\leqslant X^{3/4}$
with
$(\!\log X)^B \leqslant s|\eta| \leqslant \sqrt{X}$
. Also, note that
$s^2 |\eta|\leqslant X$
by Dirichlet’s approximation theorem. Next, we put s and
$\eta$
into dyadic intervals. Hence, we have
$(\!\log X)^B \leqslant DS \lt \sqrt{X}$
with
$S=2^i$
,
$D=2^j$
, and we are studying
\begin{align*} \frac{1}{X} \sum_{\substack{S\lt s\leqslant 2S}}\sum_{\substack{1 \leqslant r \lt s \\ (r,s)=1}} \sum_{\substack{D\lt|\eta| \leqslant 2D \\ Xr/s+\eta\in \mathbb{Z}}} \widehat{1}_{\mathcal{A}}\bigg(\frac{r}{s}+ \frac{\eta}{X}\bigg) S\bigg(\frac{-r}{s} + \frac{-\eta}{X}\bigg). \end{align*}
Now, for
$D\ll 1$
or
$S\gg X^{1/4}$
, we use Lemma 2·5(ii) on
$S(\theta)$
and Lemma 2·7 on the remainder average of the Fourier transform
$\widehat{1}_{\mathcal{A}}(\theta)$
, i.e.
\begin{align*} \sum_{\substack{S\lt s\leqslant 2S}}\sum_{\substack{1 \leqslant r \lt s \\ (r,s)=1}} \sum_{\substack{D\lt|\eta| \leqslant 2D \\ Xr/s+\eta\in \mathbb{Z}}} \bigg| \widehat{1}_{\mathcal{A}}\bigg( \frac{r}{s} + \frac{\eta}{X}\bigg)\bigg| \ll \#\mathcal{A}(X) (DS^2)^{\alpha_g}\!, \end{align*}
to get
For
$D\ll 1$
, we use
$(\!\log X)^B\ll S\ll \sqrt{X}$
to get
\begin{align}&\ll \#\mathcal{A}(X) (\!\log X) \bigg( \frac{1}{S^{1-384\alpha_g}} + \frac{S^{384\alpha_g}}{X^{1/3}} + \frac{S^{384\alpha_g}}{X^{3/2}} \bigg)^{1/192} \nonumber \\[5pt]&\ll \frac{\#\mathcal{A}(X)}{(\!\log X)^{-1+(1-384\alpha_g)B/384}}, \end{align}
since
$\alpha_g \to 0$
as
$g\to \infty$
, we can further bound this by
$\ll \#\mathcal{A}(X) / (\!\log X)^{(B-385)/384}$
for g large enough. In the case of
$S\gg X^{1/4}$
, we use
$DS^2\ll X$
to get
\begin{align}&\ll \#\mathcal{A}(X) (\!\log X) \bigg( \frac{(DS^2)^{192\alpha_g}}{X^{1/4}} + \frac{(DS^2)^{192\alpha_g}}{X^{1/3}} + \frac{(DS^2)^{192\alpha_g}}{X^{3/2}} \bigg)^{1/192} \notag \\[5pt]&\ll \frac{\#\mathcal{A}(X) (\!\log X)}{X^{(1/4-192\alpha_g)/192}},\end{align}
and again since
$\alpha_g\to 0 $
as
$g\to\infty$
, we get that this contributes
$\ll \#\mathcal{A}(X) X^{-1/1000}$
.
For the other cases
$D\gg 1$
and
$S\ll X^{1/4}$
, we use Lemma 2·5(i) instead (with
$\beta=\eta/X$
) to get
\begin{align*}& \frac{1}{X} \sum_{\substack{S\lt s\leqslant 2S}}\sum_{\substack{1 \leqslant r \lt s \\ (r,s)=1}} \sum_{\substack{D\lt|\eta| \leqslant 2D \\ Xr/s+\eta\in \mathbb{Z}}} \widehat{1}_{\mathcal{A}}\bigg(\frac{r}{s}+ \frac{\eta}{X}\bigg) S\bigg(\frac{-r}{s} + \frac{-\eta}{X}\bigg) \\[5pt]&\ll \frac{\#\mathcal{A}(X)}{X} \cdot (DS^2)^{\alpha_g} \bigg(X^{15/16+\varepsilon} + \frac{X}{S^{1/2-\varepsilon}D^{1/2}} \bigg) (\!\log X)^c.\end{align*}
We can bound
$D^{-1/2} \ll D^{-1/2+\varepsilon}$
and
$(DS^2)^{\alpha_g} \leqslant (DS)^{2\alpha_g}$
. These together, along with
$DS^2 \ll X$
, give us
Now, as before, since
$\alpha_g \to 0$
as
$g\to\infty$
, we have for sufficiently large g that
$-1/4 +\varepsilon +2\alpha_g \leqslant -1/3$
and
$-1/16 + \alpha_g/2 \leqslant -1/17$
. Since
$DS\gg (\!\log X)^B$
, we get that we have
$\ll \#\mathcal{A}(X) /(\!\log X)^{(B-3c)/3}$
in this case.
Thus, combining (3·6), (3·7) and (3·8), the minor arc contribution in total can be bounded by
$\ll \#\mathcal{A}(X)/(\!\log X)^{\min\{(B-3c)/3,(B-1153)/384\}}$
.
Finally, combining the error term from the minor arcs with the major arc estimates (3·1), (3·4) and the main term (3·5), we obtain, for any sufficiently large
$B\gt0$
,
\begin{align*} \sum_{n\in \mathcal{A}(X)} r_2(n) = \mathfrak{S}(b,g)\cdot\frac{\pi}{4}\#\mathcal{A}(X) + O_B \left(\frac{\#\mathcal{A}(X)}{(\!\log X)^B}\right)\!, \end{align*}
which completes the proof.
4. Off-diagonal solutions
To understand Theorem 1.4, we first get rid of the following quantity
\begin{align*} \sum_{\substack{n\in \mathcal{A}(X) \\ n\leqslant X^{3/4}}} \big(r_*^2(n) - 2r_*(n)\big) \ll \sum_{n\leqslant X^{3/4}} \tau^2(n) \ll_{\varepsilon} X^{3/4+\varepsilon}, \end{align*}
since
$r_*(n)\leqslant \tau(n)$
. Moreover, the left over sum can be written in the following form
\begin{align*} \sum_{\substack{n\in \mathcal{A}(X) \\ n\gt X^{3/4}}} \big(r_*^2(n)-2r_*(n)\big) = \sum_{\substack{p_1^2+q_1^2 = p_2^2+q_2^2 \in \mathcal{A}(X) \\ p_1^2+q_1^2 \gt X^{3/4} \\ \{p_1,q_1\}\not=\{p_2,q_2\}}} 1. \end{align*}
If one of
$p_i$
or
$q_i$
divides g, then we have the bound
\begin{align*} \leqslant \sum_{\substack{p_1^2+q_1^2 \leqslant X \\ p_1|3g }} r_*\big(p_1^2+q_1^2\big) \ll_{\varepsilon, g} X^{1/2+\varepsilon} ,\end{align*}
since
$r_*(n) \ll_{\varepsilon} n^{\varepsilon}$
. Next, we follow an idea of the author [
Reference Sabuncu17
], which we give here. It starts with the following observation. We want to understand the following sum,
\begin{align*}\sum_{\substack{p_1^2+q_1^2 = p_2^2+q_2^2 \in \mathcal{A}(X) \\ p_1^2+q_1^2 \gt X^{3/4} \\ (p_1p_2q_1q_2,3g)=1 \\ \{p_1,q_1\}\not=\{p_2,q_2\}}} 1. \end{align*}
Hence, we can split
$p_1^2+q_1^2 = p_2^2+q_2^2$
in
$\mathbb{Z}[i]$
to get
up to some unit factors, which we can disregard without loss of generality by just focusing on this case. Hence, using this factorisation, we can get an upper bound
\begin{align*} \sum_{n\in \mathcal{A}(X)} (r_*^2(n)-2r_*(n)) \ll_{\varepsilon} \sum_{\substack{(a^2+b^2)(c^2+d^2) \in \mathcal{A}(X) \\ (a^2+b^2)(c^2+d^2)\gt X^{3/4} \\ (ac-bd), (ac+bd), (ad+bc), (ad-bc) \in \mathcal{P}_g}} 1 + X^{3/4+\varepsilon}, \end{align*}
where
$\mathcal{P}_g$
is the set of primes coprime to 3g. We can further assume without loss of generality that
$(a^2+b^2)\leqslant (c^2+d^2)$
. Thus, we see that the sum on the right-hand side of the above expression is
\begin{align*} \ll \sum_{a^2+b^2 \leqslant \sqrt{X}} \sum_{\substack{X^{3/4}/(a^2+b^2) \lt c^2+d^2 \leqslant X/(a^2+b^2) \\ (a^2+b^2)(c^2+d^2) \in \mathcal{A} \\ (ac-bd), (ac+bd), (ad+bc), (ad-bc) \in \mathcal{P}_g}} 1 .\end{align*}
Next, we use Lemma 2·11 to get rid of the primality condition in the inner sum and bound this by
\begin{equation} \sum_{a^2+b^2 \leqslant \sqrt{X}} \sum_{\substack{h\leqslant H \\ h|P(z)}} \lambda_h \sum_{\substack{v_1,v_2 \,({\rm mod}\,h) \\ (av_1 - bv_2)(av_1 + bv_2)(av_2 + b v_1)(av_2 - bv_1) \equiv 0 \,({\rm mod}\,h)}} \sum_{\substack{X^{3/4}/(a^2+b^2) \lt c^2+d^2 \leqslant X/(a^2+b^2) \\ (a^2+b^2)(c^2+d^2) \in \mathcal{A} \\ (c,d)\equiv (v_1,v_2) \,({\rm mod}\,h) }} 1 ,\end{equation}
where
$z=\exp\!(({c_g^{1/2}}/{3500000})(\!\log X)^{1/2})$
, and
$H=z^{70}$
with
$c_g$
is defined as in Lemma 2·8. Recall that we also have
$(h,g)=1$
since
$P(z)=\prod_{\substack{p\lt z \\ p\nmid g}}p$
. We denote
$M\;:\!=\; a^2+b^2$
, and
\begin{equation*}T(X, h ;\; v_1, v_2) \;:\!=\; \sum_{\substack{X^{3/4}/M \lt c^2+d^2 \leqslant X/M \\ M(c^2+d^2) \in \mathcal{A} \\ (c,d)\equiv (v_1,v_2) \,({\rm mod}\,h) }} 1.\end{equation*}
By the Fourier inversion, we get
\begin{align*}T(X, h ;\; v_1, v_2) = \frac{1}{X} \sum_{\widetilde{a}\leqslant X} \widehat{1}_{\mathcal{A}} \bigg( \frac{\widetilde{a}}{X}\bigg) \widetilde{S}\bigg( \frac{-\widetilde{a}}{X} ;\; v_1,v_2 \bigg) ,\end{align*}
where
\begin{align*} \widetilde{S}(\theta ;\; u,v) \;:\!=\; \sum_{\substack{X^{3/4}/M \lt c^2+d^2\leqslant X/M \\ (c,d)\equiv (u,v)\,({\rm mod}\,h)}} e(M(c^2+d^2) \theta) . \end{align*}
Now, we split into major and minor arcs. We can define for
$\eta_g = c_g^{1/2}/1000$
,
Then, major arcs are defined as
\begin{align*} \mathfrak{M} \;:\!=\; \bigcup_{s\leqslant \exp\!(\eta_g\cdot (\!\log X)^{1/2})}\bigcup_{\substack{ 1 \leqslant r \lt s\\ (r,s)=1}} \mathfrak{M}_{r,s}, \end{align*}
and minor arcs are
Then we have
\begin{align*}T(X, h ;\; v_1, v_2) &= \frac{1}{X} \sum_{s\leqslant \exp\!(\eta_g\cdot (\!\log X)^{1/2})} \sum_{\substack{1 \leqslant r \lt s \\ (r,s)=1}} \sum_{\substack{|\eta| \leqslant \exp\!(\eta_g\cdot (\!\log X)^{1/2}) \\ Xr/s+\eta \in \mathbb{Z}}}\\[5pt]&\qquad \widehat{1}_{\mathcal{A}} \bigg( \frac{\widetilde{r}}{s} + \frac{\eta}{X}\bigg) \widetilde{S}\bigg( \frac{\widetilde{-r}}{s} + \frac{-\eta}{X} ;\; v_1,v_2 \bigg) \\[5pt]&\quad + \frac{1}{X} \sum_{\widetilde{a} \in \mathfrak{m}} \widehat{1}_{\mathcal{A}} \bigg( \frac{\widetilde{a}}{X}\bigg) \widetilde{S}\bigg( \frac{-\widetilde{a}}{X}\bigg)\end{align*}
4·1. Major arcs
For this part, we focus on getting the main term for the inner sum in (4·1). Later on, we will sum it over h, and
$a^2+b^2$
, to get the actual main term.
For the major arcs, we have
${\widetilde{a}}/{X} = {r}/{s} + {\eta}/{X}$
with
$|\eta| \ll \exp\!(\eta_g\cdot (\!\log X)^{1/2}) $
. We again split into 3 cases:
Case 1:
$\exists p|s$
but
$p\nmid g$
. In this case by Lemma 2·8, we get
\begin{align*}&\frac{1}{X} \sum_{\substack{s\leqslant \exp\!(\eta_g\cdot (\!\log X)^{1/2}) \\ \exists p|s, p\nmid g}} \sum_{\substack{1\leqslant r \lt s \\ (r,s)=1}} \sum_{\substack{|\eta|\leqslant \exp\!(\eta_g\cdot (\!\log X)^{1/2}) \\ Xr/s + \eta\in \mathbb{Z}}}\widehat{1}_{\mathcal{A}}\bigg(\frac{r}{s}+ \frac{\eta}{X}\bigg) \widetilde{S}\bigg(\frac{-r}{s} + \frac{-\eta}{X};\; v_1,v_2\bigg) \\[5pt]&\quad \ll \frac{\#\mathcal{A}(X)}{Mh^2} \sum_{\substack{s\leqslant \exp\!(\eta_g\cdot (\!\log X)^{1/2}) \\ \exists p|s, p\nmid g \\ (r,s)=1}}\sum_{\substack{|\eta|\leqslant \exp\!(\eta_g\cdot (\!\log X)^{1/2}) \\ Xr/s + \eta\in \mathbb{Z}}} X^{-c_g/\log s} \\[5pt]&\quad \ll _{\varepsilon}\frac{\#\mathcal{A}(X)}{Mh^2}\cdot \exp\!\big(\!- 100 c_g^{1/2} (\!\log X)^{1/2}\big) ,\end{align*}
by trivially bounding
$\widetilde{S}(\!-r/s-\eta/X;\;v_1,v_2) \ll X/h^2M$
since
$h \leqslant H$
and H is very small.
Case 2:
$\eta\not=0$
. Now, we need to understand
\begin{align*}\widetilde{S}\bigg( \frac{-a}{X} ;\; v_1,v_2 \bigg) &= \sum_{\ell_1,\ell_2 \,({\rm mod}\,s)} e\bigg( \frac{-rM\big(\ell_1^2+\ell_2^2\big)}{s} \bigg) \sum_{\substack{ X^{3/4}/M \lt c^2+d^2 \leqslant X/M \\ (c,d)\equiv (v_1,v_2)\,({\rm mod}\,h) \\ (c,d)\equiv (\ell_1,\ell_2) \,({\rm mod}\,s)}} e\bigg( \frac{-\eta M (c^2+d^2)}{X} \bigg) \\[5pt]&= \sum_{\ell_1,\ell_2 \,({\rm mod}\,s)} e\bigg( \frac{-rM\big(\ell_1^2+\ell_2^2\big)}{s} \bigg) \sum_{\substack{c^2+d^2 \leqslant X/M \\ (c,d)\equiv (C,D)\,({\rm mod}\,[h,s])}} e\bigg( \frac{-\eta M (c^2+d^2)}{X} \bigg)\\[5pt]&\quad + O\bigg( \frac{X^{3/4}}{M} \bigg) ,\end{align*}
where C and D are integers obtained by the Chinese remainder theorem, completing the sum over
$c^2+d^2$
and using Lemma 2·3 with the fact that
$s \leqslant \exp\!(\eta_g \cdot (\!\log X)^{1/2})$
is very small. Next, we split the
$c^2+d^2$
sum into short intervals to get (for
$Y\;:\!=\;\lfloor (X/M)^{1/3}\rfloor$
)
\begin{align*}&\sum_{0\leqslant m\lt Y} \sum_{\substack{mX/YM\lt c^2+d^2 \leqslant (m+1) X/YM \\ (c,d)\equiv (C,D)\,({\rm mod}\,[h,s])}} e\bigg( \frac{-\eta M(c^2+d^2)}{X} \bigg) \\[5pt]&\quad= \sum_{0\leqslant m\lt Y}e\bigg( \frac{-\eta m}{Y} \bigg) \sum_{\substack{mX/YM\lt c^2+d^2 \leqslant (m+1)X/YM \\ (c,d)\equiv (C,D)\,({\rm mod}\,[h,s])}} 1 + O\bigg( \frac{|\eta|\cdot X^{1/3}}{M^{1/3}} \bigg) \\[5pt]&\quad= \frac{1}{[h,s]^2} \frac{X}{YM} \sum_{0\leqslant m\lt Y}e\bigg( \frac{-\eta m}{Y} \bigg) + O\bigg( \frac{X^{5/6}}{M^{5/6}} \bigg) \ll \frac{X^{5/6}}{M^{5/6}},\end{align*}
by Lemma 2·3, and since the sum over m is 0. Hence, bounding the Fourier transform
$\widehat{1}_{\mathcal{A}}(\theta)$
trivially and since
$X^{3/4}/M \leqslant X^{5/6}/M^{5/6}$
, we get
\begin{align*} &\frac{1}{X} \sum_{\substack{s\leqslant \exp\!(\eta_g\cdot (\!\log X)^{1/2}) }} \sum_{\substack{1\leqslant r \lt s \\ (r,s)=1}} \sum_{\substack{0\lt|\eta|\leqslant \exp\!(\eta_g\cdot (\!\log X)^{1/2}) \\ Xr/s + \eta\in \mathbb{Z}}}\widehat{1}_{\mathcal{A}}\bigg(\frac{r}{s}+ \frac{\eta}{X}\bigg) \widetilde{S}\bigg(\frac{-r}{s} + \frac{-\eta}{X};\; v_1,v_2\bigg)\nonumber \\&\quad \ll \frac{\#\mathcal{A}(X)}{X^{1/6-\varepsilon}M^{5/6}} .\end{align*}
Case 3:
$\eta=0$
and
$p|s \implies p|g$
. This part will give us the main term. We have, as in Section 3,
\begin{align*} \frac{1}{X} \sum_{\substack{s\leqslant \exp\!(\eta_g\cdot (\!\log X)^{1/2}) \\ p|s\implies p|g }} \sum_{\substack{1\leqslant r \lt s \\ (r,s)=1}}\widehat{1}_{\mathcal{A}}\bigg(\frac{r}{s}\bigg) \sum_{\ell_1,\ell_2 \,({\rm mod}\,s) } e\bigg( \frac{-rM\big(\ell_1^2+\ell_2^2\big)}{s} \bigg) \sum_{\substack{X^{3/4}/M \lt c^2+d^2\leqslant X/M \\ (c,d)\equiv (C,D)\,({\rm mod}\,hs)}} 1, \end{align*}
since
$(h,g)=1$
and so
$(h,s)=1$
. By Lemma 2·3, we get that this is
\begin{align*} &\frac{\pi}{4}\frac{1}{Mh^2} \sum_{\substack{s\leqslant \exp\!(\eta_g\cdot (\!\log X)^{1/2}) \\ p|s\implies p|g}} \sum_{\substack{1\leqslant r \lt s \\ (r,s)=1}}\widehat{1}_{\mathcal{A}}\bigg(\frac{r}{s}\bigg) \sum_{\ell_1,\ell_2 \,({\rm mod}\,s)}\frac{1}{s^2} e\bigg( \frac{-rM\big(\ell_1^2+\ell_2^2\big)}{s} \bigg)\\ &\quad + O_{\varepsilon}\bigg( \frac{\#\mathcal{A}(X)}{X^{1/2-\varepsilon}\sqrt{M}} + \frac{\#\mathcal{A}(X)}{X^{1/4-\varepsilon} M} \bigg) . \end{align*}
Now, we can write
$\nu=\ell_1^2+\ell_2^2$
to get
\begin{align*} \frac{\pi}{4}\frac{1}{Mh^2} \sum_{\substack{s\leqslant \exp\!(\eta_g\cdot (\!\log X)^{1/2}) \\ p|s\implies p|g}} \sum_{\substack{1\leqslant r \lt s \\ (r,s)=1}}\widehat{1}_{\mathcal{A}}\bigg(\frac{r}{s}\bigg) \sum_{\nu \,({\rm mod}\,s)}\frac{r(\nu ;\;s)}{s^2} e\bigg( \frac{-rM\nu}{s} \bigg) + O_{\varepsilon}\bigg( \frac{\#\mathcal{A}(X)}{X^{1/4-\varepsilon}M} \bigg) , \end{align*}
where
Now, since
$p|s\implies p|g$
, we just need to study the followingFootnote 5 for any choice of
$J\ll_g (\!\log X)^{1/2}$
,
\begin{equation} \sum_{\substack{s|g^J }} \sum_{\substack{1\leqslant r \lt s \\ (r,s)=1}}\widehat{1}_{\mathcal{A}}\bigg(\frac{r}{s}\bigg) \sum_{\nu \,({\rm mod}\,s)}\frac{r(\nu ;\;s)}{s^2} e\bigg( \frac{-rM\nu}{s} \bigg).\end{equation}
Next, we note that for a given
$(a,b)\in (\mathbb{Z}/s\mathbb{Z})^2$
with
$a^2+b^2\equiv \nu \,({\rm mod}\,s)$
, we have
$(g^J/s)^2$
distinct choices for
$(k_1,k_2)$
such that
$(a+k_1s,b+k_2s)\in (\mathbb{Z}/g^J\mathbb{Z})^2$
with
$(a+k_1s)^2+$
$(b+k_2s)^2 \equiv \mu \,({\rm mod}\,g^J)$
for some
$\mu\equiv \nu \,({\rm mod}\,s)$
. Hence, we have
\begin{align*} r(\nu;\;s)= \frac{s^2}{g^{2J}} \sum_{\substack{\mu\,({\rm mod}\,g^J) \\ \mu \equiv \nu \,({\rm mod}\,s)}} r(\mu;\;g^J) .\end{align*}
Putting this in (4·2) and changing the order of summations, we get
\begin{align*} \frac{\pi}{4}\frac{1}{Mh^2} \sum_{\mu \,({\rm mod}\,g^J)} \frac{r(\mu;\;g^J)}{g^{2J}} \sum_{\substack{s|g^J}} \sum_{\substack{1\leqslant r \lt s \\ (r,s)=1}}\widehat{1}_{\mathcal{A}}\bigg(\frac{r}{s}\bigg) e\bigg( \frac{-rM\mu}{s} \bigg) . \end{align*}
Opening up the Fourier transform
$\widehat{1}_{\mathcal{A}}$
and changing the order of summation we get a sum over s of
$e(r(c - M\mu)/s)$
where
$c\in\mathcal{A}(X)$
. Writing
$r/s=\ell/g^J$
, we get the sum
\begin{align*}& \sum_{0\leqslant \ell \lt g^J} e\bigg(\frac{r(c - M\mu)}{s}\bigg) \\&\quad = \begin{cases} g^J & \text{if } c\equiv M\mu \,({\rm mod}\,g^J) \text{ and } M\mu=\sum_{i=0}^{k-1}a_ig^i \text{ with } a_i\not=b ,\forall i\lt J \\ 0 & \text{otherwise}.\end{cases} \end{align*}
Putting this in, we get
\begin{align*} (4\!\cdot\!2) = \frac{\pi}{4} \frac{1}{Mh^2} \frac{1}{g^J}\sum_{\substack{\mu \,({\rm mod}\,g^J) \\ M\mu \equiv \sum_{i=0}^{J-1}a_ig^i \,({\rm mod}\,g^J) \text{ with } a_i\not=b, \forall i}} r(\mu ;\; g^J) \sum_{\substack{c\in \mathcal{A}(X) \\ c\equiv \mu M \,({\rm mod}\,g^J)}} 1 . \end{align*}
Similar to Section 3, the inner sum over c is
$(g-1)^{k-J}$
. Thus, we get that this is
\begin{align*} \frac{\pi}{4} \frac{\#\mathcal{A}(X)}{Mh^2} \frac{1}{g^J(g-1)^J}\sum_{\substack{\mu \,({\rm mod}\,g^J) \\ M\mu = \sum_{i=0}^{k-1}a_ig^i \text{ with } a_i\not=b, \forall i\lt J}} r(\mu ;\; g^J) .\end{align*}
Thus, the major arc contribution in total gives us, for any
$J \ll_g (\!\log X)^{1/2}$
,
\begin{align}\sum_{\substack{\widetilde{a} \in \mathfrak{M}}} \widehat{1}_{\mathcal{A}}\bigg(\frac{\widetilde{a}}{X}\bigg) \widetilde{S}\bigg( \frac{-\widetilde{a}}{X} ;\; v_1 , v_2 \bigg) &= \frac{\pi}{4} \frac{\#\mathcal{A}(X)}{Mh^2} \frac{1}{g^J(g-1)^J}\sum_{\substack{\mu \,({\rm mod}\,g^J) \\ M\mu \equiv \sum_{i=0}^{J-1}a_ig^i \,({\rm mod}\,g^J) \text{ with } a_i\not=b, \forall i}} r(\mu ;\; g^J) \nonumber \\&\quad + O\bigg( \frac{\#\mathcal{A}(X)}{Mh^2} \exp\big(\!- 100 c_g^{1/2} (\!\log X)^{1/2} \big) \bigg), \end{align}
since
$M\leqslant \sqrt{X}$
and summing over
$M=a^2+b^2$
would give us that this is the worst possible error term.
4·2. Minor arcs
We want to bound the following sum on average
Similar to the first part of the paper, by the Dirichlet approximation theorem, we can write
${\widetilde{a}}/{X} = {r}/{s} + {\eta}/{X}$
for
$s\leqslant \sqrt{X}$
with
$\exp\!(\eta_g\cdot (\!\log X)^{1/2}) \leqslant |\eta|s \leqslant \sqrt{X}$
and
$|\eta| s^2 \leqslant X$
. We start by putting s and
$\eta$
into dyadic intervals. This gives us
\begin{align*}&\sum_{a^2+b^2 \leqslant \sqrt{X}} \sum_{h\leqslant H} \lambda_h \sum_{\substack{v_1,v_2 \,({\rm mod}\,h) \\ (av_1 - bv_2)(av_1 + bv_2)(av_2 + b v_1)(av_2 - bv_1) \equiv 0 \,({\rm mod}\,h)}} \\&\quad \times \frac{1}{X} \sum_{\substack{S\lt s\leqslant 2S}} \sum_{\substack{1 \leqslant r \lt s \\ (r,s)=1}} \sum_{\substack{D\lt|\eta|\leqslant 2D \\ Xr/s + \eta\in \mathbb{Z}}} \widehat{1}_{\mathcal{A}}\bigg( \frac{r}{s} + \frac{\eta}{X} \bigg) \widetilde{S}\bigg( \frac{-r}{s} + \frac{-\eta}{X} ;\; v_1,v_2 \bigg) .\end{align*}
Then we put
$a^2+b^2$
into dyadic intervals and change the order of summations to put it inside by forcing a and b into arithmetic progressions, i.e. we have
\begin{align}&\leqslant \sum_{h\leqslant H}\bigg|\sum_{\substack{u_1,u_2,v_1,v_2 \,({\rm mod}\,h) \\ (u_1v_1 - u_2v_2)(u_1v_1 + u_2v_2)(u_1v_2 + u_2v_1)(u_1v_2 - u_2v_1) \equiv 0 \,({\rm mod}\,h)}} \notag \\&\times\frac{1}{X} \sum_{\substack{S\lt s\leqslant 2S}}\sum_{\substack{1 \leqslant r \lt s \\ (r,s)=1}} \sum_{\substack{D\lt|\eta|\leqslant 2D \\ Xr/s + \eta\in \mathbb{Z}}} \widehat{1}_{\mathcal{A}}\bigg( \frac{r}{s} + \frac{\eta}{X} \bigg) \sum_{N=2^i \ll \sqrt{x}} \sum_{\substack{N \lt a^2+b^2 \leqslant 2N \\ (a,b)\equiv (u_1,u_2)\,({\rm mod}\,h) }}S\bigg( \frac{-r}{s} + \frac{-\eta}{X} ;\; v_1,v_2 \bigg) \bigg| . \end{align}
Now, we focus on the (4·4) part only. We open up
$S(\theta;\;u,v)$
, and put (c, d) in dyadic intervals
$(M_1,2M_1]\times (M_2,2M_2]$
for some real numbers
$M_1,M_2$
with
$\#\{M_1, M_2\} \ll (\!\log X)^2$
to get
\begin{align*}&\sum_{\substack{N \lt a^2+b^2 \leqslant 2N \\ (a,b)\equiv (u_1,u_2)\,({\rm mod}\,h) }}\widetilde{S}\bigg( \frac{-r}{s} + \frac{-\eta}{X} ;\; v_1,v_2 \bigg) = \sum_{\substack{M_1 , M_2 \\ M_1^2+M_2^2 \ll X/N}} \sum_{\substack{N \lt a^2+b^2 \leqslant 2N \\ (a,b)\equiv (u_1,u_2)\,({\rm mod}\,h) }} \\&\quad \times\sum_{\substack{M_1\lt c \leqslant 2M_1 \\ M_2 \lt d \leqslant 2M_2 \\ X^{3/4}/(a^2+b^2)\lt c^2+d^2 \leqslant X/(a^2+b^2) \\ (c,d)\equiv (v_1,v_2) \,({\rm mod}\,h)}} e\bigg( \bigg( \frac{-r}{s} + \frac{-\eta}{X} \bigg)(a^2+b^2)(c^2+d^2)\bigg).\end{align*}
Now, we can put
$n=a^2+b^2$
, and this tells us the inner sum is of the form
\begin{align*} \sum_{N\lt n\leqslant 2N} a_n \sum_{\substack{M_1\lt c \leqslant 2M_1 \\ M_2\lt d\leqslant 2M_2 \\ X^{3/4}/(a^2+b^2)\lt c^2+d^2 \leqslant X/(a^2+b^2) \\ (c,d)\equiv (v_1,v_2)\,({\rm mod}\,h)}} e\bigg( \bigg( \frac{-r}{s} + \frac{-\eta}{X} \bigg) (c^2+d^2)n \bigg) ,\end{align*}
which we can bound by Lemma 2·10 with
$\delta=1/8$
since
$c^2+d^2 \gg X^{3/4}/(a^2+b^2) \gg X^{1/4}$
. This, alongside Lemma 2·7, gives us for
$D\gg 1$
,
\begin{align*}(4\!\cdot\!4) &\ll \frac{h^{1/2}}{X} \#\mathcal{A}(X) (S^2 D)^{\alpha_g} \bigg( X^{31/32} + \frac{X}{(SD)^{1/4}} \bigg) (\!\log X)^6 \\&\ll h^{1/2} \#\mathcal{A}(X) \bigg( \frac{(S^2D)^{\alpha_g}}{X^{1/32}} + \frac{(S^2D)^{\alpha_g}}{(SD)^{1/4}} \bigg) (\!\log X)^6 \\&\ll h^{1/2} \#\mathcal{A}(X) ( X^{-1/32 + \alpha_g} + (S D)^{-1/4+2\alpha_g})(\!\log X)^6,\end{align*}
since
$S^2D\ll X$
and
$S^2D\leqslant (S D)^2$
. Next, since
$\alpha_g\to 0$
as
$g\to\infty$
, we get that
$X^{-1/32 +\alpha_g} \ll X^{-1/100}$
and using
$SD\gg \exp\!(\eta_g\cdot (\!\log X)^{1/2})$
, we have
$(SD)^{-1/4+2\alpha_g} \ll \exp\!(\!-({\eta_g}/{5}) (\!\log X)^{1/2})$
.
In the case
$D\ll 1$
, we can use the second bound from Lemma 2·10. In this case, we get
\begin{align*}(4\!\cdot\!4) &\ll \frac{h^{1/2}}{X} \#\mathcal{A}(X) S^{2\alpha_g} \bigg( X^{31/32} + \frac{X}{S^{1/4}}\bigg) (\!\log X)^6 \\[5pt]&\ll h^{1/2} \#\mathcal{A}(X) (S^{2\alpha_g} X^{-1/32} + S^{-1/4+2\alpha_g})(\!\log X)^6.\end{align*}
As before, since
$\alpha_g\to 0$
as
$g\to\infty$
, and
$S\gg \exp\!(\eta_g\cdot (\!\log X)^{1/2})$
, we get that this is
just like the case
$D\gg 1$
. Therefore, putting them together, we got
Summing subsequently over
$u_1,u_2,v_1,v_2 \,({\rm mod}\,h)$
and
$h\leqslant H$
gives a bound of
\begin{align}&\sum_{a^2+b^2\leqslant \sqrt{X}}\sum_{h\leqslant H} \sum_{\substack{v_1,v_2 \,({\rm mod}\,h) \\ (av_1 - bv_2)(av_1 + bv_2)(av_2 + b v_1)(av_2 - bv_1) \equiv 0 \,({\rm mod}\,h)}}\sum_{\substack{\widetilde{a}\in \mathfrak{m}}} \widehat{1}_{\mathcal{A}} \bigg( \frac{\widetilde{a}}{X} \bigg) \widetilde{S}\bigg( \frac{-\widetilde{a}}{X} ;\; v_1,v_2 \bigg) \nonumber \\[5pt]&\quad \ll \#\mathcal{A}(X) H^{11/2} \exp\bigg( -\frac{\eta_g}{5} (\!\log X)^{1/2} \bigg) . \end{align}
Before going to the next part, we note that this error is worse than the error coming from the major arc contributions.
4·3. Putting everything together
In this section, we put together the major arc and the minor arc contributions to get the final bound.
We start by noting that
\begin{align*} \rho(h;\; a,b) \;:\!=\; \sum_{\substack{v_1,v_2 \,({\rm mod}\,h) \\ (av_1 - bv_2)(av_1 + bv_2)(av_2 + b v_1)(av_2 - bv_1) \equiv 0 \,({\rm mod}\,h)}} 1 ,\end{align*}
is a multiplicative function by the Chinese remainder theorem. Moreover, we have at a prime
$p\not=3$
\begin{align*} \rho(p;\;a,b) = \begin{cases} p & \text{if } p=2 \text{ or } p|ab \\[5pt] 4p-3 & \text{otherwise}.\end{cases} \end{align*}
Thus, we get by Lemma 2·11,
\begin{align*} \sum_{h\leqslant H} \frac{\lambda_h \cdot \rho(h;\;a,b)}{h^2} \ll \prod_{\substack{p\leqslant H \\ p\nmid 3g}} \bigg( 1 - \frac{\rho(p;\;a,b)}{p^2}\bigg) = \prod_{\substack{p\leqslant H \\ p|ab \\ p\nmid 3g}} \bigg( 1 - \frac{1}{p} \bigg) \prod_{\substack{3\lt p\leqslant H \\ p\nmid abg}} \bigg( 1 - \frac{4}{p} + \frac{3}{p^2} \bigg) . \end{align*}
We can bound the product over
$p|ab$
by
$\leqslant 1$
. For the product over
$p\nmid abg$
, we complete the product to get
\begin{align*} \sum_{h\leqslant H} \frac{\lambda_h \cdot \rho(h;\;a,b)}{h^2} \ll \prod_{3\lt p\leqslant H} \bigg( 1 - \frac{4}{p} + \frac{3}{p^2} \bigg) \prod_{\substack{p\gt3 \\ p|abg}} \bigg( 1 - \frac{4}{p} + \frac{3}{p^2} \bigg)^{-1} . \end{align*}
Then we have that these products are
\begin{align*} \ll \prod_{3\lt p\leqslant H} \bigg( 1 - \frac{4}{p} \bigg) \exp\!\bigg(\sum_{p|abg} \frac{4}{p} \bigg). \end{align*}
Now, the exponential term can be shown to be
$\ll (\!\log\log X)^4$
since
$abg\ll_g X$
by splitting the sum over p into ranges
$p\gt\log X$
and
$p\leqslant \log X$
. For the first product, it is easy to see that it is
$\ll 1/(\!\log H)^4$
. These together give us
\begin{equation} \sum_{h\leqslant H} \frac{\lambda_h \cdot \rho(h;\;a,b)}{h^2} \ll \frac{(\!\log\log X)^4}{(\!\log H)^4} .\end{equation}
We now can use this to prove our result. We put together the major arc (4·3) and the minor arc (4·5) contributions together to get
\begin{align*} (4\!\cdot\!1) & = \frac{\pi}{4} \#\mathcal{A}(X) \sum_{a^2+b^2 \leqslant \sqrt{X}} \frac{1}{a^2+b^2} \sum_{\substack{\mu \,({\rm mod}\,g^J) \\ (a^2+b^2)\mu \equiv \sum_{i=0}^{J-1}a_ig^i \,({\rm mod}\,g^J) \text{ with } a_i\not=b, \forall i}} \frac{r(\mu ;\; g^J)}{g^J(g-1)^J} \\[5pt]&\qquad \sum_{h\leqslant H} \frac{\lambda_h \cdot \rho(h;\;a,b)}{h^2} + O\bigg( \#\mathcal{A}(X) H^{11/2}\exp\!\bigg( - \frac{c_g^{1/2}}{5} (\!\log X)^{1/2} \bigg) \bigg).\end{align*}
Using (4·6), we can bound the sum over h. Noting that
$H=\exp\!( ({c_g^{1/2}}/{50000})(\!\log X)^{1/2})$
, and putting
$m=a^2+b^2$
we get
\begin{align*}&\ll \frac{\#\mathcal{A}(X)(\!\log\log X)^4}{(\!\log X)^2} \sum_{m\leqslant \sqrt{X}} \frac{r_0(m)}{m} \sum_{\substack{\mu \,({\rm mod}\,g^J) \\ m\mu \equiv \sum_{i=0}^{J-1}a_ig^i \,({\rm mod}\,g^J) \text{ with } a_i\not=b, \forall i}} \frac{r(\mu ;\; g^J)}{g^J(g-1)^J} \\[5pt]&\quad + \#\mathcal{A}(X) \exp\bigg( - \frac{c_g^{1/2}}{100} (\!\log X)^{1/2} \bigg) .\end{align*}
Now, we put
$m\mu$
into arithmetic progressions. To do this, we note that given
$f\,({\rm mod}\,g^J)$
with
$f=\sum_{i=0}^{J-1}a_i g^i$
such that
$a_i\not=b$
for all i, we are looking at
$m\mu\equiv f \,({\rm mod}\,g^J)$
. Hence,
\begin{align*}&\sum_{m\leqslant \sqrt{X}} \frac{r_0(m)}{m} \sum_{\substack{\mu \,({\rm mod}\,g^J) \\ m\mu \equiv \sum_{i=0}^{J-1}a_ig^i \,({\rm mod}\,g^J) \text{ with } a_i\not=b, \forall i}} \frac{r(\mu ;\; g^J)}{g^J(g-1)^J} \\&\quad = \sum_{\substack{f \,({\rm mod}\,g^J) \\ f = \sum_{i=0}^{J-1}a_ig^i \text{ with } a_i\not=b, \forall i}} \sum_{m\leqslant \sqrt{X}} \frac{r_0(m)}{m} \sum_{\substack{\mu\,({\rm mod}\,g^J) \\ m\mu \equiv f \,({\rm mod}\,g^J)}} \frac{r(\mu ;\; g^J)}{g^J(g-1)^J} \\&\quad = \sum_{\substack{f \,({\rm mod}\,g^J) \\ f = \sum_{i=0}^{J-1}a_ig^i \text{ with } a_i\not=b, \forall i}} \sum_{v\,({\rm mod}\,g^J)} \sum_{\substack{\mu\,({\rm mod}\,g^J) \\ v\mu\equiv f \,({\rm mod}\,g^J)}} \frac{r(\mu ;\; g^J)}{g^J(g-1)^J} \sum_{\substack{m\leqslant \sqrt{X} \\ m\equiv v \,({\rm mod}\,g^J)}} \frac{r_0(m)}{m}.\end{align*}
The inner sum is
$\ll ({r(v;\;g^J)}/{g^{2J}}) \log X$
by partial summation and by suming Lemma 2·3 over the representations of v as sum of two squares
$\,({\rm mod}\,g^J)$
, and since
$g^J \ll_{\varepsilon} X^{\varepsilon}$
. Hence, we get that this is in total
\begin{align*} \ll (\!\log X) \bigg( \frac{g^J}{(g-1)^J} \sum_{\substack{f \,({\rm mod}\,g^J) \\ f = \sum_{i=0}^{J-1}a_ig^i \text{ with } a_i\not=b, \forall i}} \frac{1}{g^{4J}} \sum_{\substack{v , \mu\,({\rm mod}\,g^J) \\ v\mu\equiv f \,({\rm mod}\,g^J)}} r(\mu ;\; g^J) r(v ;\; g^J) \bigg) . \end{align*}
Finally, we want to understand the part with J. We expect it to converge to a constant as
$J\to\infty$
. To see this, we will do some local analysis. Firstly, we factorise
$g=p_1^{e_1}\cdots p_{\ell}^{e_{\ell}}$
. Then, by the Chinese remainder theorem, we have
\begin{align*}&\frac{g^J}{(g-1)^J} \sum_{\substack{f \,({\rm mod}\,g^J) \\ f = \sum_{i=0}^{J-1}a_ig^i \text{ with } a_i\not=b, \forall i}} \frac{1}{g^{4J}} \sum_{\substack{v , \mu\,({\rm mod}\,g^J) \\ v\mu\equiv f \,({\rm mod}\,g^J)}} r(\mu ;\; g^J) r(v ;\; g^J) \\&\quad = \frac{g^J}{(g-1)^J} \sum_{\substack{f \,({\rm mod}\,g^J) \\ f = \sum_{i=0}^{J-1}a_ig^i \text{ with } a_i\not=b, \forall i}} \prod_{i=1}^{\ell} \bigg( \frac{1}{p_i^{4Je_i}} \sum_{\substack{v_i,\mu_i \,({\rm mod}\,p_i^{Je_i}) \\ v_i \mu_i \equiv f \,({\rm mod}\,p_i^{Je_i})}} r\big(\mu_i ;\; p_i^{Je_i}\big) r\big(v_i ;\; p_i^{Je_i}\big) \bigg) .\end{align*}
Now, we use the trivial bound
$r(\nu;\;p^k) \leqslant 2 p^k$
for p prime and
$k\geqslant 1$
. This gives us
\begin{align*} \ll_g \frac{g^J}{(g-1)^J} \sum_{\substack{f \,({\rm mod}\,g^J) \\ f = \sum_{i=0}^{J-1}a_ig^i \text{ with } a_i\not=b, \forall i}} \prod_{i=1}^{\ell} \bigg( \frac{1}{p_i^{2Je_i}} \sum_{\substack{v_i,\mu_i \,({\rm mod}\,p_i^{Je_i}) \\ v_i \mu_i \equiv f \,({\rm mod}\,p_i^{Je_i})}} 1 \bigg), \end{align*}
and we can bound the inner sum by
$\leqslant p^{Je_i}$
since it is either 0 or
$p^{Je_i}$
. Therefore, taking the product, we get
\begin{align*} \ll_g \frac{1}{(g-1)^J} \sum_{\substack{f \,({\rm mod}\,g^J) \\ f = \sum_{i=0}^{J-1}a_ig^i \text{ with } a_i\not=b, \forall i}} 1 = 1, \end{align*}
since the sum over f is
$(g-1)^J$
. Therefore, we get
\begin{align*} \sum_{n\in \mathcal{A}(X)} (r_*^2(n) - 2 r_*(n)) \ll_g \frac{\#\mathcal{A}(X)(\!\log\log X)^4}{\log X} , \end{align*}
which proves Theorem 1.4.
Acknowledgements
The author is grateful to Fei Xue for his discussion concerning missing digits and explaining some basic ideas behind them. He would also like to thank Valentin Blomer, Pieter Moree, Kunjakanan Nath and Alisa Sedunova for their comments and suggestions. Furthermore, he wishes to thank Jeremy Schlitt for reading an earlier version of the manuscript.


