Pair correlations of logarithms of integers

We study the correlations of pairs of logarithms of positive integers at various scalings, either with trivial weigths or with weights given by the Euler function, proving the existence of pair correlation functions. We prove that at the linear scaling, the pair correlations exhibit level repulsion, as it sometimes occurs in statistical physics. We prove total loss of mass phenomena at superlinear scalings, and Poissonian behaviour at sublinear scalings. The case of Euler weights has applications to the pair correlation of the lengths of common perpendicular geodesic arcs from the maximal Margulis cusp neighborhood to itself in the modular curve $\operatorname{PSL}_2(\mathbb Z)\backslash\mathbb H^2_{\mathbb R}$.


Introduction
When studying the asymptotic distribution of a sequence of finite subsets of R, finer information is sometimes given by the statistics of the spacing (or gaps) between pairs or k-tuples of elements, seen at an appropriate scaling. This problematic is largely developped in quantum chaos, including energy level spacings or clusterings, and in statistical physics, including molecular repulsion or interstitial distribution. The general setting of such a study may be described as follows. Let F " p pF N q N PN , ωq be a nondecreasing sequence of finite subsets F N of a finite dimensional Euclidean space E, endowed with a multiplicity function ω : Ť N PN F N Ñ s 0,`8 r (or weight function). Let ψ : N Ñ s 0,`8 r be a nondecreasing scaling function. The pair correlation measure of F at time N with scaling ψpN q is the measure on E with finite support where ∆ z denotes the unit Dirac mass at z. When the sequence of measures pR F ,ψ N q N PN , appropriately renormalized, weak-star converges to a measure g Leb E absolutely continuous with respect to the Lebesgue measure Leb E of E, the Radon-Nikodym derivative g " g F ,ψ is called the asymptotic pair correlation function of F for the scaling ψ. When g F ,ψ vanishes on a neighbourhood of 0 in E, we say that the pair pF , ψq exhibits level repulsion.
If the family F consists of subsets of the unit interval r0, 1s, then it is customary to use the cardinality of the finite set F N as the scaling function. See for example [BocZ], where F N " t p q : p, q P N, p ď q, pp, qq " 1, 0 ă q ď N u is the set of Farey fractions of order N in r0, 1s (without multiplicities, hence ω " 1), so that ψpN q " 3N 2 π`O pN ln N q. Montgomery studied (under the Riemann hypothesis) the pair correlations of the imaginary parts of the zeros (with their multiplicity as zeros) of the Riemann zeta function ζ in the seminal paper [Mon]. The number of zeros 1 2`i t of ζ with imaginary part t in the interval r0, N s is asymptotic to N ln N 2π as N Ñ`8 and the scaling used in [Mon] is, analogously to the unit interval case of [BocZ], by the inverse of the average gap : ψpN q " p N ln N 2π q{N " ln N 2π . In Sections 2 and 3, we study the pair correlations of the family of the logarithms of positive integers L N "`pL N " tln n : 0 ă n ď N uq N PN , ω " 1w ithout multiplicities. In order to simplify the statements in this introduction, we only consider power scalings ψ : N Þ Ñ N α for α ě 0, and we denote these scaling functions by id α .
Theorem 1.1 Let α ě 0. As N Ñ`8, the normalized pair correlation measures 1 N 2´α R L N , id α N on R weak-star converge to a measure g L N , id α Leb R with pair correlation function given by We refer to Theorems 2.1 and 3.1, for more complete versions of Theorem 1.1, with congruence restrictions and with more general scaling functions, as well as for error terms. These error terms, as well as the ones in Theorems 4.1 and 5.1, constitute the main technical parts of this paper.
The renormalisation by 1 N 2´α in Theorem 1.1 is naturally chosen in order for the pair correlation function to be finite. As the finite set L N , whose order is N , is contained in the minimal interval r0, ln N s, the average gap in L N is ln N N . Scaling by the inverse ψpN q " N ln N of the average gap (as in a particular case of Theorem 3.1), as well as by id α for 0 ă α ă 1 (as in the above statement) gives a pair correlation function which is constant nonzero, a characteristic of a Poissonian distribution. As in the above result for α ą 1 and more generally by Theorem 3.1, if the scaling function ψ grows faster than linearly, then the pair correlation function vanishes : the empirical measures R L N , ψ N have a total loss of mass at infinity, actually whatever the renormalisation is (the support of the measure itself converges to infinity). The transition from Poissonian to zero correlation occurs at linear scalings, where a more exotic pair correlation function appears (see for instance [RS] for Poissonian and [HK, LS] for non-Poissonian pair correlation phenomena). Since g L N , id vanishes on s´1, 1r, the pair pL N , idq exhibits a level repulsion.
The figure below gives the graph of the pair correlation function g L N , id of L N at the linear scaling ψ " id : N Þ Ñ N in the interval r´15, 15s compared with the graph of the constant function 1 2 . The graph is similar to certain radial distribution functions in statistical physics, see for example [ZP, Sect. II], [SdH,Fig. 7], [Cha,page 199] or [Boh,page 18]. Instead of the pair correlations, one can study the gaps between consecutive elements in the subsets F N of the real line or, most often, of the unit interval. Marklof and Strömbergsson [MaS] have computed the gap distribution of the fractional parts of the family L N (with a linear scaling and linear renormalisation) and showed that the limiting gap distribution has two jump discontinuities.
In Section 6, we prove that the pair correlation measures of the lengths of the common perpendiculars between the maximal Margulis cusp neighbourhood and itself in the modular curve PSL 2 pZqzH 2 R are (up to a factor 2) the pair correlation measures of the weighted family L ϕ N "`pL N " tln n : 0 ă n ď N uq N PN , ω " ϕ˝expȏ f logarithms of integers, with weights given by the Euler function ϕ : n Þ Ñ CardpZ{nZqˆ, see Proposition 6.1. See [PS1,PS2] for results on the pair correlation of the lengths of closed geodesics in negatively curved manifolds.
We study the pair correlations of the arithmetically defined family L ϕ N in Sections 4 and 5, where we find the pair correlation function without scaling and with linear scaling. Theorem 1.2 (1) As N Ñ`8, the pair correlation measures R L ϕ N ,1 N on R, renormalized to be probability measures, weak-star converge to the probability measure g L ϕ N ,1 Leb R , with pair correlation function g L ϕ N ,1 : s Þ Ñ e´2 |s| . (2) As N Ñ`8, the normalized pair correlation measures 1 We refer to Theorems 4.1 and 5.1 for more complete versions of Theorem 1.2 with congruence restrictions, and for error terms. When the congruences are nontrivial, the proof of the second claim of Theorem 1.2 uses a generalization of Mirsky's formula (see [Mir]) that is proved in Appendix A by Étienne Fouvry.
The figure below gives the graph of the pair correlation function g L ϕ N , id compared with the graph of the constant function with value 1 4 ź p prime`1´2 p 2˘`1`1 p 2 pp 2´2 q˘» 0.09239, which is the limit of the pair correlation function g L ϕ N , id at˘8 by Proposition 5.5. 3 Theorems 4.1 and 5.1 imply pair correlation results for the common perpendiculars of cusps neighborhoods in the modular curve and on quotients of the hyperbolic plane by Hecke congruence subgroups of PSLpZq, see Corollary 6.2 for precise statements.
Further directions. It would be interesting, given a discrete subgroup Γ of PSL 2 pRq, to study the asymptotic of the pair correlation measures of the complex translation lengths C pγq with absolute value at most N of the elements γ P Γ, and given a discrete subgroup Γ of a semi-simple connected real Lie group G with finite center and without compact factor, of the Cartan projections µpγq with Killing norm at most N of the elements γ P Γ. See Section 6 for the problem of the asymptotic of the pair correlation measures of common perpendiculars in negative curvature, which will be studied more completely in subsequent works of the authors.
When the finite-dimensional Euclidean space E (where the family of finite sets pF N q N PN sits) is replaced by a locally compact metric space pX, dq, we may also consider the positive measure on s0,`8r with finite support R F ,ψ N " ř x,yPF N : x‰y ωpxq ωpyq ∆ ψpN qdpx,yq .
Acknowledgements: The authors thank a lot Etienne Fouvry for his proofs of Lemma 4.2, Proposition 5.5 and Theorem A.1 and for the agreeing to contribute the appendix to this paper. This research was supported by the French-Finnish CNRS IEA BARP.
Notation. We introduce here some of the notation used throughout the paper. The pushforward of a measure µ by a mapping f is denoted by f˚µ. We denote by sg : R Ñ R the change of sign map t Þ Ñ´t.
For every interval I in R, we denote by Leb I the Lebesgue measure on I and by 1 I the characteristic function of I. We denote by BVpIq the vector space of measurable functions f : I Ñ R with finite total variation Varpf q. For every k P t0, 1u, we denote by C k c pIq the real vector space of C k -smooth functions f : I Ñ C with compact support in I. We denote by }f } 8 " sup xPI |f pxq| the uniform norm of f P C 0 c pIq. In addition to the above, more or less standard, notation, we will use the following indexing sets in Sections 2, 3, 4 and 5. Let us fix throughout the paper a, b P N´t0u with a ď b. For every N P N´t0u, let I N " I N,a,b " tpm, nq P N 2 : 0 ă m, n ď N, m ‰ n, m, n " a mod bu , IŃ " tpm, nq P N 2 : 0 ă m ă n ď N, m, n " a mod bu IǸ " tpm, nq P N 2 : 0 ă n ă m ď N, m, n " a mod bu , so that I N " IŃ \ IǸ is the disjoint union of IŃ and IǸ .

4
Except in the proof of Lemma 4.2, of Proposition 5.5, and in the whole Appendix A, for every function g of a variable in N´t0u, possibly depending on parameters (including a and b), we will denote by Opgq (or O b pgq when we want to insist on the possible dependence on the parameter b) any function f on N´t0u such that there exists a constant C 1 depending only on the parameter b and a constant N 0 possibly depending on the parameters such that for every N ě N 0 , we have |f pN q| ď C |gpN q|.

Pair correlations without weights nor scaling
For every N P N´t0u, the (not normalised) pair correlation measure of the logarithms of integers congruent to a modulo b at time N , with trivial multiplicities and with trivial scaling function, is If we consider the following nondecreasing sequence of finite subsets of R with trivial multiplicity L a,b N "`pL a,b N " tln n : 0 ă n ď N, n " a mod buq N PN , ω " 1˘, then, with the notation of the introduction, we have L 1,1 N " L N and ν N " R L a,b N ,1 N . Theorem 2.1 As N Ñ`8, the measures ν N on R, renormalized to be probability measures, weak-star converge to the measure absolutely continuous with respect to the Lebesgue measure on R, with Radon-Nikodym derivative the function g L a,b N ,1 : s Þ Ñ 1 2 e´| s| : Furthermore, for every f P C 0 c pRq X BVpRq, we have When a " b " 1, this result implies the case α " 0 of Theorem 1.1 in the introduction, with pair correlation function g L N ,1 " g L 1,1 N ,1 . Proof. For every q P N´t0u with q " a mod b, let q 1 P N be such that q " a`q 1 b and J q " tp P N : 0 ă p ă q, p " a mod bu " ta`kb : 0 ď k ă q 1 u . (2) Let which is a finitely supported measure on r0, 1s, with total mass }ω q } " q 1 . When q 1 ‰ 0, we hence have }ω q } " q b`O p1q and 1 }ωq} " b q`O p 1 q 2 q. When q 1 ‰ 0, we denote by ω q " ωq }ωq} the renormalisation of ω q to a probability measure on r0, 1s. By well known Riemann sum arguments, we have, as q Ñ`8, Let f P BVpr0, 1sq, and note that f is bounded, with }f } 8 ď f p0q`Varpf q. Denoting by M k and m k the maximum and minimum respectively of f on r a`kb q , a`pk`1qb q s for 0 ď k ă q 1 , we haveˇˇˇż When q 1 ‰ 0, since | ω q pf q | ď }ω q } }f } 8 , we hence have which is a finitely supported measure on r0, 1s. Its total mass is equal to Notice that ln is an increasing homeomorphism from r0, 1s to r´8, 0s. For every element N P N´t0u, let us define νN " ÿ pm, nqPIN ∆ ln m n , so that νŃ " ln˚µŃ " ν N | s´8,0s , and }νŃ } " }µŃ }. We have, for every f P BV ps´8, 0sq, Since ν N " νŃ`νǸ , since νǸ " sg˚νŃ , we have }νN } " 1 2 }ν N } and the result follows. l Let us give some numerical illustrations of Theorem 2.1 when a " b " 1. For every N P N´t0u, let which is the cumulative distribution function at time N of the differences of pairs of logarithms of integers, that is, for all s, s 1 P R with s ă s 1 , we have The above theorem says that the function D N converges pointwise as N Ñ`8 to the C 1 (but not C 2 ) function , which is the asymptotic cumulative distribution function of the differences of pairs of logarithms of integers. This is illustrated by the figure below, which shows D 15 in green.

Pair correlations without weights and with scaling
In this section, we study the pair correlations of logarithms of integers at various scaling, now assumed to converge to`8. We fix two nondecreasing positive functions, respectively ψ : N´t0u Ñ s0,`8r and ψ 1 : N´t0u Ñ s0,`8r, which will give the scaling factors on the difference of pairs of logarithms and the renormalizing factors on their distribution. For every N P N´t0u, the (not normalised) pair correlation measure of the logarithms of integers congruent to a modulo b at time N with trivial multiplicities and with scaling ψpN q is the (Borel, positive) measure with finite support in R defined by N " λ ψ P r0,`8s. As N Ñ`8, the measures R L N ,ψ N on R, normalized by ψ 1 pN q as given below, weak-star converge to a measure g L N ,ψ Leb R absolutely continuous with respect to the Lebesgue measure on R, with Radon-Nikodym derivative the function Furthermore, if λ ψ ‰ 0,`8, for every f P C 1 c pIq with support contained in r´A, As, we have The pair correlation function g L N ,ψ depends on b but it is independent of a. The above result shows in particular that renormalizing to probability measures (taking ψ 1 pN q " N 2´N ) is inappropriate, as the limiting measure would always be 0.
When α " 0, a " b " 1 and ψ " id α : N Ñ N α , the measure 1 ψ 1 pN q R L N ,ψ N corresponds to the one denoted by 1 N 2´α R L N , id α N in the introduction. The above result thus implies the cases α ą 0 of Theorem 1.1 in the introduction, as well as the comment about the scaling by the inverse of the average gap ψpN q " N ln N , for which λ ψ " 0. The fact that g L N ,ψ vanishes when λ ψ "`8 means that the sequence of measures 1 ψ 1 pN q R L N ,ψ N˘N PN on R has a total loss of mass at infinity. For error terms when λ ψ "`8 and λ ψ " 0, see respectively Equation (6) and Equation (8).
Proof. Note that the change of variables pm, nq Þ Ñ pn, mq in I N proves that we have We will thus only study the convergence of the measures 1 ψ 1 pN q R L N ,ψ N on r0,`8r, and deduce the global result by the symmetry of g L N ,ψ .
For every N P N´t0u and for every p P N with p " 0 mod b and 0 ă p ă N , let and let ω p, N " Then ω p, N is a measure on r0,`8r, with finite support contained in r ψpN q N´p p, ψpN qps, and with total mass }ω p, N } " N p`1 . When this total mass is not 0, which occurs if and only if N ě p`a, we denote by ω p, N " ω p, N }ω p, N } the renormalisation of ω p, N to a probability measure on s0,`8r . The support of the measure µǸ on s0,`8r is contained in r ψpN q N , ψpN qN s. The motivation for the definition of the measure µǸ comes from the following lemma.
Lemma 3.2 For every A ą 0 and for every f P C 1 c pRq with compact support contained in r0, As, we have, as N Ñ`8,ˇR In particular, if 1 ψ 1 pN q`N ψpN q˘2 tends to 0 as N Ñ`8, the measures 1 ψ 1 pN q R L N ,ψ N | r0,`8s and 1 ψ 1 pN q µǸ on r0,`8s are asymptotic for the weak-star convergence of measures on r0,`8s, and we will study the weak-star convergence of the latter one.
Proof. By the change of variable pp, qq Þ Ñ pm " p`q, n " qq, we have Since the support of f is contained in r0, As, if a pair pp, qq occurs in the index of the sum defining either For all x, y P r0,`8r , we have |∆ x pf q´∆ y pf q| " |f pxq´f pyq| ď }f 1 } 8 |x´y| .
Recall that | lnp1`tq´t| " Opt 2 q as t Ñ 0. Hence, by a uniform majoration of the terms of the sum below,ˇR Let us now study the convergence properties of the (renormalized) measures ω p, N and of their sums µǸ as N Ñ`8.
Let ι : s0,`8r Ñ s0,`8r be the involutive diffeomorphism t Þ Ñ 1 t . We have As q varies in J p, N , the above Dirac masses are taken on the distribution of points given by the following picture. As in the proof of Theorem 2.1, for every C 1 function f : s0,`8r Ñ R with compact support, we havěˇˇż Hence for every C 1 function f : s0,`8r Ñ R with compact support, since ι is a diffeomorphism, we have For every t ą 0, let In particular, we have θ N ptq " 0 if and only if t P r0, b ψpN q N´b r . Thus, if the support of f is contained in the interval r0, As, since ψpN qp N´p ď A if and only if p ď AN ψpN q`A , we have, Case 1. Assume first that λ ψ "`8, that is, lim N Ñ`8 N ψpN q " 0. Then for every A ě 1, if N is large enough, then for every t P r0, As, we have θ N ptq " 0. Thus, whatever the normalizing function ψ 1 is, we have a total loss of mass at infinity : More precisely, for every C 1 function f : s0,`8r Ñ R with compact support contained in r0, As, we have Case 2. Now assume that λ ψ " 0, that is, lim Since θ N vanishes on r0, b ψpN q N´b " , this proves that ψpN q 2 N 2 θ N is bounded on any compact subset of r0,`8r, and pointwise converges to the constant function 1 2 b 2 . Hence by the Lebesgue dominated convergence theorem, we have ψpN q N 2 µǸá 1 2 b 2 Leb r0,`8r .
More precisely, for every A ě 3, for every C 1 function f : s0,`8r Ñ R with compact support contained in r0, As, by Equations (5) and (7) and since ψpN q ď N for N large enough, we have ψpN q N 2 µǸ pf q " Let ψ 1 pN q " N 2 ψpN q . By Lemma 3.2, we hence have Futhermore, for every C 1 function f : R Ñ R with compact support contained in r´A, As, we have Case 3. Let us finally assume that lim N Ñ`8 ψpN q N " λ ψ belongs to s0,`8r . Let us consider the map θ 8 : r0,`8rÑ R defined by It vanishes on r0, b λ ψ r , is uniformly bounded, tends to 1 2 b 2 λ 2 ψ as t Ñ`8, and is piecewise continous, with discontinuities at b λ ψ N´t0u. See the first picture in the introduction when a " b " λ ψ " 1. By Equation (4), the sequence of uniformly bounded maps pθ N q N PN converges almost everywhere to θ 8 (more precisely, it converges at least at every point of r0,`8r´b λ ψ N ). Hence by Equation (5) and by the Lebesgue dominated convergence theorem, we have 1 ψpN q µǸá θ 8 Leb r0,`8r .
Let A ě 1 and k P N. Note that bλ ψ k ď A implies that k ď A bλ ψ ď 2A bλ ψ . If N is large enough so that ψpN q N ě λ ψ 2 , then ψpN qbk N´bk ď A implies that k ď AN bpψpN q`Aq ď 2A bλ ψ . Hence for every t P r0, As, we have For every continuous function f : r0,`8r Ñ R with compact support in r0, As, we therefore haveˇˇˇż`8 By Equation (5), for every C 1 function f : r0,`8r Ñ R with compact support in r0, As, we thus have With g L N ,ψ : R Ñ R given by t Þ Ñ θ 8 p|t|q, by Lemma 3.2, it follows that Futhermore, for every A ě 1 and every C 1 function f : R Ñ R with compact support contained in r´A, As, we have This concludes the proof of Theorem 3.1. l Let us give a numerical illustration of Theorem 3.1 when a " b " 1 and ψpN q " N . The following figure shows in red an approximation of the pair correlation function g L N ,ψ computed using R L N ,ψ 2000 , and in blue the pair correlation function g L N ,ψ in the interval r´4, 4s.

Pair correlations with Euler weights without scaling
In this section, we study the weighted family The (not normalised) pair correlation measure of the logarithms of integers congruent to a modulo b at time N with multiplicities given by the Euler function ϕ, for the trivial scaling function, is r ν N " ÿ pm, nqPI N ϕpnq ϕpmq ∆ ln m´ln n .
With the notation of the introduction, we have L 1,1,ϕ Theorem 4.1 As N Ñ`8, the measures r ν N on R, renormalized to be probability measures, weak-star converge to the measure absolutely continuous with respect to the Lebesgue measure on R, with Radon-Nikodym derivative the function g L ϕ,a,b N ,1 : s Þ Ñ e´2 |s| : Furthermore, for all f P C 1 c pRq and α P r 1 2 , 1r, we have When a " b " 1, the measure r ν N corresponds to the one denoted by R L ϕ N ,1 N in the introduction. The above result gives the first assertion of Theorem 1.2 in the introduction, with pair correlation function g L ϕ N ,1 " g L ϕ,1,1 N ,1 . Proof. The first assertion of Theorem 4.1 follows from the second one, by taking for instance α " 1 2 and by the density of C 1 -smooth functions with compact support in the space of continuous functions with compact support on R.
For every q P N´t0u with q " a mod b, let q 1 P N be such that q " a`q 1 b and let J q be given by Equation (2). We now define which is a finitely supported measure on r0, 1s, and nonzero if and only if q 1 ‰ 0. In order to compute its total mass, we will use the following elementary adaptation of Mertens' formula (see for example [HaW,Thm. 330]). We have not found its proof in the literature, hence we provide one, due to Fouvry.
Let pa, bq P N´t0u be the greatest common divisor of a and b. Let and note that c a,b ą 0 is uniformly bounded from above when a and b vary in N´t0u, and tends to 0 as b Ñ`8. When a " b " 1, we have c a,b " 1, and the following result is exactly Mertens' formula.
Lemma 4.2 There exists C ą 0 such that for all integers a, b ě 1 and real numbers x ě 1, we haveˇˇˇÿ 1ďnďx, n"a mod b ϕpnq´3 c a,b π 2 x 2ˇď C x lnp2xq .
Proof. (Fouvry) In this proof, for every function g of a variable in r1,`8r , possibly depending on parameters, we use the notation Opgq in order to denote any function f on r1,`8r such that there exists a constant C, independent of the variable and of all the parameters, such that |f | ď C|g|. We do not need a more precise error term. Let Spx, a, bq be the above sum. We refer for instance to [HaW] for the definition of the Möbius function µ : N´t0u Ñ t´1, 0, 1u, of the Dirichlet convolution f˚g of two maps f, g : N´t0u Ñ R and for the Möbius inversion formula, which in particular gives that ϕ " µ˚id. Hence Spx, a, bq " Let us fix d ě 1. Let us consider the congruence equation m d " a mod b with unknown m. It has no solution if the greatest common divisor pb, dq of b and d does not divide a. If pb, dq does divide a, let a 1 " a pb,dq , b 1 " b pb,dq and d 1 " d pb,dq , so that the congruence equation is equivalent to m d 1 " a 1 mod b 1 . Since d 1 is coprime with b 1 , it is invertible modulo b 1 , and we denote its inverse by d 1 . The congruence equation becomes m " a 1 d 1 mod b 1 . The classical formula ÿ 1ďmďy, m " a 1 d 1 mod b 1 1 " y b 1`O p1q gives, by a summation by parts, the Using the Eulerian product formula of the zeta function, giving ź p prime p1´1 p 2 q " 1 ζp2q " 6 π 2 , and the expression ϕpnq " n ź p prime, p | n p1´1 p q of the Euler function in terms of the prime factors, we have, by decomposing d into prime powers and using the definition of the Möbius function, This proves Lemma 4.2. l Lemma 4.2 says that if q 1 ‰ 0 (that is, when q ą a), then and in particular 1 } r ωq} " π 2 Lemma 4.3 We have as q Ñ`8, r ω q } r ω q }á 2 t d Leb r0,1s ptq .
More precisely, for all f P C 1 pr0, 1sq and α P r 1 2 , 1 r , we have Proof. The first assertion follows from the second one, by taking for instance α " 1 2 and by the density of C 1 -smooth functions in the space of continuous functions on r0, 1s.
Let Q " tq α u P N´t0u. For all n P t0, . . . , Q´1u and t P s n q´α, pn`1qq´αs, we have by the mean value theorem f ptq " f pn q´αq`Opq´α }f 1 } 8 q .
Using twice Equation (11) and the formula for 1 } r ωq} following it, we have ÿ p P s n q 1´α , pn`1qq 1´α sXJq f`p q˘1 } r ω q } ϕppq "`f pn q´αq`Opq´α }f 1 } 8 q˘π 2 3 c a,b q 2`1`O`l n q q˘3 c a,b ppn`1q 2´n2 q π 2 q 2´2α`O`p n`1qq 1´α lnppn`1qq 1´α q˘" Again using Equation (11), we have By cutting the sum defining r ω q and the integral from 0 to 1, by using (12), (13) and (14), since Q ď q α and |1´Q q´α| " Opq´αq, we have (using α ě 1 2 for the last equality)ˇˇr This proves Lemma 4.3. l For every N P N´t0u, let us define which is a finitely supported measure on r0, 1s. By Lemma 4.2, its total mass is For f P C 1 pr0, 1sq, by Lemma 4.3, since q 1`α pln qq ď N 1`α pln N q and q 2´α ď N 2´α when q occurs in the summations below, we have For every N P N´t0u, let us define so that r νŃ " ln˚r µŃ " r ν N | s´8, 0s , and }r νŃ } " }r µŃ }. We have, for every f P C 1 c ps´8, 0sq, Since r ν N " r νŃ`r νǸ , since r νǸ " sg˚r νŃ , we have }r νN } " 1 2 }r ν N } and Theorem 4.1 follows. l Let us give some numerical illustrations of Theorem 4.1 with a " b " 1. For every N P N´t0u, let This is the cumulative distribution function at time N of the unscaled differences of the logarithms of natural numbers weighted by the Euler function, that is, for all s, s 1 P R with s ă s 1 , we have R Theorem 4.1 with a " b " 1 says that the function r D N pointwise converges as N Ñ`8 to the C 1 (but not C 2 ) function ). This is illustrated by the figure below, which shows r D 15 in red.

Pair correlations with Euler weights and linear scaling
In this section, we study the pair correlations of the family L ϕ,a,b N defined at the beginning of Section 4, now with a linear scaling. We leave to the reader the study of a general scaling ψ, assumed to converge to`8. For every N P N´t0u, the (not normalised) pair correlation measure of the logarithms of integers, congruent to a modulo b, at time N with multiplicities given by the Euler function and with scaling N is the (Borel, positive) measure with finite support in R defined by r R N " ÿ pm, nqPI N ϕpmq ϕpnq ∆ N pln m´ln nq .
With the notation of the introduction, we have r For every k P N´t0u, we consider the arithmetic constant c a,b,k defined in Equation (21) of Appendix A. Note that c a,b,k ą 0 is uniformly bounded from above when a, b, k vary in N´t0u, and has a positive lower bound on a and k when b is fixed, by Equation (22) of Appendix A.
Theorem 5.1 As N Ñ`8, the family`1 N 3 r R N˘N PN of measures on R weak-star converges to the measure absolutely continuous with respect to the Lebesgue measure on R, with Radon-Nikodym derivative the function Furthermore, for all f P C 1 pRq with compact support contained in r´A, As, where A ě 1, and for any α P r 1 2 , 1 r , we have When a " b " 1, the measure r R N corresponds to the one denoted by R L ϕ N , id N in the introduction. The above result gives the second assertion of Theorem 1.2 in the introduction, with pair correlation function g L ϕ N , id " g L ϕ,1,1 N , id , using Mirsky's value of c 1,1,k given by Equation (23), as explained in Remark A.6 of Appendix A.
Note that, as the proof below shows, the total mass of r R N is equivalent to c N 4 as N Ñ`8, for some constant c ą 0, hence renormalising r R N to be a probability measure makes it weak-star converge to the zero measure on the noncompact space R (a total loss of mass phenomenon).
Proof. The first assertion of Theorem 5.1 follows from the second one, by taking for instance α " 1 2 and by the density of C 1 -smooth functions with compact support in the space of continuous functions with compact support on R.
The change of variables pm, nq Þ Ñ pn, mq in I N gives r R N | s´8,0s " sg˚`r R N | r0,`8r˘. We will thus only study the convergence of the measures 1 N 3 r R N on r0,`8r, and deduce the global result by the symmetry of g L ϕ,a,b N , id . For every N P N´t0u and for every p P N with p " 0 mod b and 0 ă p ă N , let J p, N be given par Equation (3). We now define the key auxiliary measure by Then r ω p, N is a measure on r0,`8r, with finite support contained in r 1 N p , N´p N p s, hence in r0, 1s. The measure r ω p, N is nonzero if and only if N ě a`p. In order to compute its total mass, we use an adaptation with congruences of a formula by Mirsky (see [Mir,Thm. 9]) proved in the appendix by Fouvry. Theorem A.1 says that if N ě a`p, then and in particular 1 The next result implies that the measures r ω p,N , once normalized to be probability measures, weak-star converge to the measure dµptq " 3`N p N´p˘3 t 2 d Leb r 1 N p , N´p N p s , which is absolutely continuous with respect to the Lebesgue measure on the interval r 1 N p , N´p N p s.
Lemma 5.2 For every p P N with 0 ă p ă N and p " 0 mod b, for every α P s 0, 1 r and for every f P C 1 c ps0, 1sq, we have Proof. As in the proof of Lemma 4.3, we will estimate the difference of the main terms in the above centered formula by cutting the sum defining the renormalized measure r ω p,N and by cutting similarly the integral from 1 N p to N´p N p . Let Q " tpN pq α N´p N p u P N. For all n P t0, . . . , Q´1u, we thus define S n " ÿ q P s n pN pq 1´α , pn`1qpN pq 1´α sXJ p,N f`q N p˘1 } r ω p,N } ϕpqq ϕpq`pq and I n " Let us also define the following remaining terms For all t P s n pN pq´α, pn`1qpN pq´αs, we have by the mean value theorem f ptq " f pn pN pq´αq`OppN pq´α }f 1 } 8 q .
l Now, let us introduce the sum where as previously ι : t Þ Ñ 1 t (noting that the measures r ω p, N are supported in s0,`8r ).
Lemma 5.3 For every f P C 1 pr0,`8rq with compact support contained in r0, As, where A ě 1, we haveˇˇr R N pf q´r µ N pf qˇˇ" OpA 3 N 2 }f 1 } 8 q .
Proof. Using the change of variables pp, qq Þ Ñ pm " p`q, n " qq, we have As in the proof of Lemma 3.2, since the support of f is contained in r0, As, if a pair pp, qq occurs in the index of the sum defining either r R N pf q or r µǸ pf q with nonzero corresponding summand, then p q " O`A N˘a nd p " OpAq. By the mean value theorem, we then havěˇf`N p q˘´f`N lnp1`p q q˘ˇˇď }f 1 } 8ˇN p q´N lnp1`p q qˇ" Thus, using Theorem A.1 and Equation (22) in Appendix A, we havěˇr This proves Lemma 5.3. l Lemma 5.4 For all α P r 1 2 , 1r and f P C 1 pr0,`8rq with compact support contained in r0, As, where A ě 1, we have, as N Ñ`8, Proof.
Let A and f be as in the statement. Since the support of r ω p, N is contained in r 1 N p , N´p N p s, the support of ι˚r ω p, N is contained in r N p N´p , N ps. In particular the measures r µ N and g L ϕ,a,b N , id psq ds both vanish on r0, 1s. Hence we may assume that the support of f is contained in r1,`8r , so that the support of f˝ι is contained in s0, 1s.
By the definition of r µǸ , by Equation (15) and Lemma 5.2, since N´p ď N and by the restriction on p, explained in the proof of Lemma 5.3, in the summation defining r µǸ pf q due to the support of f , we have Noting that }f } 8˘, we therefore have, for N large compared to A, This proves Lemma 5.4, using that A 4 N α " Op A 7 ln 2 pN q N 1´α q if α ě 1 2 . l Theorem 5.1 now follows from Lemmas 5.3 and 5.4, as explained in the beginning of the proof. l We close this section with a numerical illustration of Theorem 5.1 when a " b " 1. The following figure shows in red an approximation of the pair correlation function g L ϕ N , id " g L ϕ,1,1 N , id computed using r R 2000 in the interval r´10, 10s, to be compared with the graph of g L ϕ N , id in the introduction. The fact that the graph of g L ϕ N , id has a horizontal asymptote near˘8 follows from the following result.
Proof. (Fouvry) In this proof, we use the same convention concerning Op¨q as in the beginning of the proof of Lemma 4.2.
We consider the multiplicative 2 function f : n Þ Ñ Let us prove that uniformly in x ě 1, we have By Equation (1), this proves Proposition 5.5. Let g " f˚µ be the Dirichlet convolution of f with the Möbius function µ. Then g is multiplicative. For every prime p, we have gppq " f ppq µp1q`f p1q µppq " 1 ppp 2´2 q and gpp k q " f pp k q µp1q`f pp k´1 q µppq " 0 for every k ě 2. Therefore, for every m ě 1, we have gpmq " µpmq 2 Lemma 5.6 For every m ě 1, we have 0 ď gpmq ď m´3 Proof. This is immediate if µpmq " 0. Otherwise, m " p 1 . . . p k with p 1 , . . . , p k pairwise distinct primes, and 0 ď m 3 gpmq " Therefore, using the Möbius inversion formula f " g˚1 for the first equality, Lemma 5.6 for the fifth equality and an Eulerian product (since g is multiplicative and vanishes on integers divisible by a nontrivial square) for the sixth equality, we have, with Spxq " ř 1ďkďx f pkq, By summation by parts, we hence have This proves Equation (20) and concludes the proof of Proposition 5.5. l 6 Pair correlations of common perpendiculars in the modular curve PSL 2 pZqzH 2

R
In this section, we give a geometric motivation for the introduction of the Euler function as multiplicities in the family L ϕ N of logarithms of natural numbers. We refer to [PP, BPP] for more information.
Let Y be a nonelementary geodesically complete connected proper locally CATp´1q good orbispace, so that the underlying space of Y is Γz r Y with r Y a geodesically complete proper CATp´1q space and Γ a discrete group of isometries of r Y preserving no point nor pair of points in r Y X B 8 r Y . Let D´and D`be connected proper nonempty properly immersed locally convex closed subsets of Y , that is, D´and D`are the Γ-orbits of proper nonempty closed convex subsets r D´and r D`of r Y . A common perpendicular α between D´and D`is the Γ-orbit of the unique shortest arc r α between r D´and γ r D`for some γ P Γ such that dp r D´, γ r D`q ą 0. The multiplicity multpαq of α is the ratio A{B where ‚ A is the number of elements pγ´, γ`q P pΓ{Γ D´qˆp Γ{Γ γD`q such that r α is the unique shortest arc between γ´r D´and γ`γ r D`, and ‚ B is the cardinality of the pointwise stabilizer of r α in Γ. The length λpαq of the common perpendicular α is the length of the geodesic segment r α in r Y . For every in the set OL 6 pD´, D`q of lengths of common perpendiculars, the length multiplicity of is the sum of the multiplicities of the common perpendiculars between D´, D`having the length : ωp q " ÿ α common perpendicular beween D´and D`with λpαq" multpαq .
If PerppD´, D`q is the set of all common perpendiculars from D´to D`with multiplicities, then pλpαqq αPPerppD´, D`q is the marked ortholength spectrum from D´to D`, and the set OLpD´, D`q " pOL 6 pD´, D`q, ωq of the lengths of the common perpendiculars endowed with the length multiplicity ω is the ortholength spectrum from D´to D`.
The pair correlation measure of the common perpendiculars from D´to D`is the pair correlation measure of F D´,D`"`p F N " OL 6 pD´, D`q X r0, 2 ln N sq N PN , ω˘.
We will study the asymptotic properties of the pair correlation measures R F D´,D`, ψ N for appropriate scalings ψ in a subsequent paper, and we only consider in this paper the following example. Let r Y " H 2 R "`tz P C : Im z ą 0u, ds 2 " dpRe zqdpIm zq pIm zq 2b e the upper halfspace model of the real hyperbolic plane with constant curvature´1. For every b P N´t0u, let Γ 0 rbs be Hecke's congruence subgroup modulo b of the modular group PSL 2 pZq, which is the preimage of the upper triangular subgroup PSLpZ{bZq under the reduction morphism PSL 2 pZq Ñ PSLpZ{bZq. It acts faithfully by homographies on H 2 R , and is a lattice in the isometry group of H 2 R . Let Y b " Γ 0 rbszH 2 R , which is a finite (ramified) cover of the modular curve PSL 2 pZqzH 2 R . Let r D´" r D`be the horoball H 8 " tz P C : Im z ě 1u in H 2 R , whose image D´" D`in Y b is a Margulis neighbourhood of a cusp of Y b . If b " 1, then D´" D`is actually the maximal Margulis neighbourhood of the unique cusp of Y b . To emphasize the dependence on the integer b, we will use the notation F b D´,D`" F D´,D`f or the family of lengths of common perpendiculars between D´and DT he following result says that the pair correlation measures of the common perpendiculars from this Margulis cusp neighbourhood to itself are, up to the homothety of factor 2, the pair correlation measures of the logarithms of the natural numbers congruent to 0 modulo b, with multiplicities given by the Euler function ϕ.
We use in the following result the notation R L ϕ,b,b N , ψ N of the introduction with L ϕ,b,b N " p pL N " tln n : 0 ă n ď N, n " 0 mod buq N PN , ω " ϕ˝expq . Proof. The orbit of H 8 under Γ 0 rbs consists, besides H 8 itself, of the Euclidean disks H p q of Euclidean radius 1 2q 2 tangent to the horizontal line at the rational numbers p q with q ą 0, q " 0 mod b and pp, qq " 1.
Every common perpendicular between Dá nd D`has a unique representative which starts from the Euclidean segment ri, i`1r on the boundary of H 8 and ends on the boundary of H p q with p q P Q X r0, 1r and q " 0 mod b. Its hyperbolic length is 2 ln q. In particular, we have OL 6 pD´, D`q " t2 ln q : q ě 2, q " 0 mod bu. Since PSL 2 pRq acts simply transitively on the unit tangent bundle of H 2 R , the multiplicities of the common perpendiculars are equal to 1. Hence the length multiplicity of 2 ln q is exactly the number of elements p P Z{qZ coprime with q, that is, ωp2 ln qq " ϕpqq. l The following results, computing the pair correlation functions at trivial or linear scaling of the lengths of the common perpendiculars from the Margulis cusp neighbourhood at infinity to itself in Hecke's modular curve Γ 0 rbszH 2 R , follow immediately from Theorems 4.1 and 5.1 with a " b, which also give an error term, using Proposition 6.1. l