Is there an asymptotic formula that describes the correlation of multiplicative inverses in Farey sequences?

Added 14/04/17: So I am placing a bounty on this question because I am very interested in knowing about strategies for calculating the asymptotic behaviour of this sum. I have calculated $S(X)$ for $X<10^8$ and I am fairly confident that we have $S(X)\sim X/2$. Alas this doesn't prove anything yet though. Can this be proved? Due to the lack of answers, I suppose this is a hard problem, so I would also accept answers that can make this clear in some way. For instance, if solutions to this sort of problem depend on the solution of some open problem or the resolution of a conjecture which lies deep, then an explanation would be welcome.

It is not clear to me what the level of difficulty of this problem is but it appears to involve questions about notions of randomness in number theory, and so it seems like a reasonable MO question.

The motivation here comes from considering the Dirichlet series $$\sum_1^{\infty}\frac{d(n)}{n^s}\sum_{q|n-1:q\leq X}1,$$ and looking at the value of (the analytic continuation of-) this function at $s=0$. Such Dirichlet series are related to questions about the autocorrelation of the divisor function, for which the asymptotics were worked out by Ingham and Estermann in the 1920's and 1930's.

The objective is to obtain an asymptotic formula for the sum

$$S(X)=\sum_{q\leq X}\frac{1}{\phi(q)}\sum_{\chi}L^2(0,\chi),$$ and it can easily be shown that determining this is equivalent to knowing something interesting about Farey fractions.

It is fairly elementary that

\begin{eqnarray}\label{} S(X)=\sum_{q\leq X}\frac{1}{\phi(q)}\sum_{\chi} \left( \sum_{a\leq q} \chi(a)\zeta\left(0 ,\frac{a}{q}\right) \right)^2 \end{eqnarray}

where $\zeta(s,a)$ is the Hurwitz zeta function so, denoting by $a^*$ the multiplicative inverse of $a$ modulo $q$, expanding out the square and using the orthogonality relations for the Dirichlet characters one obtains

$$S(X)=\sum_{q\leq X}\sum_{(a,q)=1}\left(\frac{a}{q}-\frac{1}{2}\right)\left(\frac{a^*}{q}-\frac{1}{2}\right).$$

Noting that the mean value of the non-trivial Farey fractions ($0$ and $1$ being trivial) is $1/2$ for all $X$, at this point one probably realises that $S(X)/X^2$ is proportional (by a factor of $3/\pi^2$) to the correlation of the non-trivial Farey fractions of order $X$ with their multiplicative inverses modulo their denominators.

Since one would expect the values of $a/q$ and $a^*/q$ to be independent as $q\rightarrow\infty$, one would expect that $$S(X)=O(X^{1+\epsilon})$$ and so I would like to pose the following question:

Can an asymptotic formula for $S(X)$ be determined, or just a non-trivial upper or lower bound, via the Farey fractions or the Dirichlet L-functions?

Potentially, one way to proceed is to multiply out the product and use the symmetry about $1/2$ to obtain

$$S(X)=-\frac{1}{2}+\sum_{q\leq X}\sum_{(a,q)=1}\left(\frac{aa^{*}}{q^2}-\frac{1}{4}\right).$$ Using the fact that $aa^{*}-k(a)q=1$, where $k(a)$ is the greatest number of integer multiples of $q$ less than $aa^{*}$, and $k(a)/q$ is another non-trivial Farey fraction, one obtains

$$S(X)=-\frac{1}{2}+\sum_{q\leq X}\sum_{(a,q)=1}\left(\frac{k(a)}{q}-\frac{1}{4}\right) +O(\log X).$$ However, the mapping $a\rightarrow k(a)$ is not an automorphism of the multiplicative group of integers modulo $q$, and the behaviour of $k$ seems to be quite complex.

Added 14/04/17: I should also mention that it appears that even the strongest conjectures on bounds on sums of Kloosterman sums (e.g. of Selberg type) seem to be of little utility here.

• You could also try the functional equation: for even characters $L(0,\chi)$ vanishes, while for odd characters $L(0,\chi) = -\frac i{\sqrt\pi} \tau(\chi) L(1,\bar\chi)$. Indeed, I think this gives $O(X^{1+\varepsilon})$ right away, and there's even some hope for an asymptotic formula. – Greg Martin Apr 9 '17 at 19:02
• Not sure if this can be useful but I find it sort of amusing - the denominator of $S(X)$ is$$\prod_{\text{prime p\leqslant X}}p^{\lfloor\log_p(n)\rfloor+1}$$ – მამუკა ჯიბლაძე Apr 9 '17 at 19:03
• @GregMartin: Please would you include a little more on how to proceed with the summation as indicated in your comment? – Kevin Smith Apr 9 '17 at 19:19
• Isn't the conjectured asymptotics moreorless equivalent to GRH ? – Sylvain JULIEN Apr 17 '17 at 14:31
• I have no idea! If it is then an explanation of how this is so would be a welcome answer. – Kevin Smith Apr 17 '17 at 15:07

Finding asymptotic for $S(X)$ amounts to estimation of $\sum_{(a,q)=1} aa^*$ for any given $q$.

From the rearrangement inequality, it follows that $$\frac{1}{2}q^2\varphi(q) - T = \sum_{(a,q)=1} a(q-a) \le \sum_{(a,q)=1} aa^* \le \sum_{(a,q)=1} a^2 = T,$$ where $$T = \sum_{(a,q)=1} a^2 = \sum_{d\mid q} \mu(d) d^2 \frac{q/d(q/d+1)(2q/d+1)}{6} = \frac{1}3 q^2\varphi(q) + O(q^2).$$ Hence, $$\frac{1}6 q^2\varphi(q) \lesssim \sum_{(a,q)=1} aa^* \lesssim\frac{1}3 q^2\varphi(q).$$

UPDATE. Notice that the assumption of independent $a$ and $a^*$ essentially suggests that $\sum_{(a,q)=1} aa^* \sim\frac{1}4 q^2\varphi(q)$, which deviates from the asymptotic bounds above by constant factors. However, these asymptotic bounds are not tight enough to obtain the anticipated asymptotic formula for $S(X)$.

• Thank you for your answer Max - this is a nice way to show that $\sum_{(a,q)=1}a a^*\sim Cq^2\varphi(q)$ for a constant $1/6\leq C\leq 1/3$. Perhaps I am missing something here but, even if $C=1/4$, this establishes only that $S(X)=o(X^{2})$ right? Of course one gets $O(X^{1+\epsilon})$ under the assumption of independence, but that is the reason behind expecting such cancellation (also that numerical data suggests the asymptotic is actually $\sim X/2$). – Kevin Smith Apr 17 '17 at 12:58
• @KevinSmith: You are correct, there is no cancellation of the highest-order term under these bounds. I've removed the misleading statement from my answer. – Max Alekseyev Apr 17 '17 at 14:11