A WEIGHTED VERSION OF THE ERDOS-KAC˝ THEOREM

RIZWANUR KHAN, MICAH B. MILINOVICH, AND UNIQUE SUBEDI

Abstract. Let ω(n) denote the number of distinct prime factors of n and let τk(n) denote the k-fold . We evaluate the centralized moments of ω(n), weighted by τk(n), and deduce a weighted version of the Erd˝os-KacTheorem.

1. Introduction Let ω(n) denote the number of distinct prime factors of n. That is, X ω(n) = 1. p|n

The celebrated Erd˝os–Kactheorem [6] from 1940 states that for each α ∈ R, we have Z α 1 X 1 2 (1.1) 1 −→ √ e−t /2 dt x 2π −∞ n≤x √ ω(n)−log log x≤α log log x as x → ∞. In other words, since the log log function grows very slowly, the quantity ω(n) − log log n (1.2) √ log log n

follows a Gaussian distribution law with mean 0 and variance√ 1. R´enyi and Tur´an[17] provided a (best possible) quantitative version of the theorem with O(1/ log log x) as the rate of convergence in (1.1). Although the Erd˝os–Kac theorem is a classical result, it has remained a source of great research interest even in modern times. Many notable mathematicians have revisited the theorem and pro- vided different proofs of it, e.g. [6, 14, 17, 10, 1, 9, 13, 11]. We highlight a couple of these approaches in particular. Generalizing the prime counting function π(x), let πk(x) denote the number of integers n ≤ x with ω(n) = k. One approach to the Erd˝os–Kactheorem, related to the proof of R´enyi and Tur´an[17] and the√ Selberg–Delange Method [16, Chapter 7.4], is to use asymptotics for πk(x) with k ≤ log log x + α log log x to evaluate the left hand side of (1.1). Such a proof is rather involved, requiring complex analysis and the theory of the , and it is at least as deep as the theorem. Another approach is to asymptotically evaluate the moments of the quantity (1.2) and show that they match the moments of a standard Gaussian random variable. Since a Gaussian distribution is completely characterized by its moments [2, Theorem 30.1], this implies the Erd˝os–KacTheorem. The moments approach was first accomplished by Halberstam [10] in 1955, although his proof was rather complicated. About a decade later, Billingsley [1] gave a much simpler demonstration. In 2007, Granville and Soundararajan [9] provided an even more transparent and flexible treatment. Their approach remains one of the most direct and elementary ways to prove the Erd˝os-Kactheorem.

2020 Mathematics Subject Classification. 11N60. Key words and phrases. Erd˝os–Kactheorem, prime omega function, divisor function, central limit theorem, moments. 1 2 RIZWANUR KHAN, MICAH B. MILINOVICH, AND UNIQUE SUBEDI

This paper is concerned with a generalization of the Erd˝os-Kactheorem in which the distribution of ω(n) is studied, but counting is weighted by the divisor function. Elliott [4, 5] proved that1  −1 Z α X X 1 2 (1.3) τ(n) τ(n) −→ √ e−t /2 dt, 2π −∞ n≤x n≤x √ ω(n)−2 log log x≤α 2 log log x P where τ(n) = d|n 1 is the divisor function. Thus, when weighted by the divisor function, ω(n) still follows a Gaussian distribution as in the Erd˝os–Kactheorem, but with double the mean and double the variance. Such a result can be predicted by the following heuristic. Recall that τ(n) = 2ω(n) for square-free n. So, roughly speaking, we are studying the Gaussian distributed ω(n), tilted by its exponential. Consider a Gaussian random variable with mean 0 and variance 1, so that its distribution function is α 1 Z −x2 √ e 2 dx. 2π −∞ If we weight the measure by ex, the distribution function becomes √ Z α 2 Z α 2 1 −x x e −(x−1) √ e 2 e dx = √ e 2 dx, 2π −∞ 2π −∞ where equality is obtained by completing the square. Thus, the resulting distribution with the weighted measure is still Gaussian but with altered mean and variance. In Probability theory, this phenomenon is a simple case of Girsanov’s Theorem [12, Chapter 3.5]. We also mention that Elliott’s P result in (1.3) was generalized to short interval sums x≤n≤x+y, where y is a small power of x, by Liu and Wu [15], using similar methods. Weighted central limit theorems are also of current interest in other parts of number theory. For 1 instance, there is a famous and classical result of Selberg which establishes that log |ζ( 2 + it)| has a Gaussian distribution for t ∈ [T, 2T ] as T → ∞, where ζ(s) denotes the Riemann zeta-function. Recently, Fazzari [7, 8] has proved weighted versions of Selberg’s central limit theorem assuming the Riemann hypothesis. Our paper, which was mostly written before we were aware of Elliot’s previous work, was inspired by Fazzari’s results for the Riemann zeta-function. Elliott’s proof of (1.3) is essentially based on a Selberg–Delange type approach to the Erd˝os–Kac theorem, and thus is quite deep. The goal of this paper is to give a relatively simple proof of Elliott’s result using a moments approach. Having a moments result to this weighted problem is natural, given the historical development of the Erd˝os–Kactheorem. This was lacking in the literature prior to our work. Also, while Elliott’s weighting was by the divisor function, we generalize this result to weighting by the k-fold divisor function, τk(n). We compute the centralized moments of ω(n) weighted by τk(n) by generalizing a method of Granville and Soundararajan [9]. Although the foundation of our approach was laid out elegantly in [9], our proof requires a number of nontrivial modifications. It was not clear, a priori, whether the Granville-Soundararajan approach would work in this case and our generalization requires a careful set-up. We now state our main theorem. Let X τk(n) = 1

n1···nk=n be the k-fold divisor function. In Section 2.2, we show that, as n ranges over the integers below x, the mean of ω(n) with respect to the weighted measure τk(n) is asymptotic to k log log x. Thus we centralize by k log log x and evaluate the following m-th moment for (ω(n) − k log log x), weighted by τk(n).

1Elliott more generally proved (1.3) with τ(n)α for any α > 0. A WEIGHTED VERSION OF THE ERDOS-KAC˝ THEOREM 3

Theorem 1.1. Let k and m be fixed natural numbers. For x > 3, we have X m ω(n) − k log log x τk(n) n≤x X τk(n) (1.4) n≤x ( m/2  m−1  (m − 1)!! k log log x + O (log log x) 2 , if m is even, = m−1  O (log log x) 2 , if m is odd, where (m − 1)!! denotes the product of all odd integers up to and including (m − 1). Dividing both sides by (k log log x)m/2, this gives that the weighted m-th moment of ω(n) − k log log x √ k log log x is (m − 1)!! + o(1) if m is even and is o(1) if m is odd. Recall that the m-th moment of a standard Gaussian random varriable is (m − 1)!! if m is even and is 0 if m is odd. Thus, Theorem 1.1 implies the following weighted version of the Erd˝os–KacTheorem.

Corollary 1.2. Fix k, m ∈ N. For any α ∈ R, we have  −1 Z α X X 1 −t2/2 (1.5) τk(n) τk(n) −→ √ e dt 2π −∞ n≤x n≤x √ ω(n)−k log log x≤α k log log x as x → ∞. Throughout this paper, we will follow the ε-convention, where ε will always denote an arbitrarily small positive constant, but not necessarily the same one from one occurrence to the next. Our error terms are allowed to depend on ε.

2. Preliminaries 2.1. Averages of the k-fold divisor function. A well known result, due to Voronoi and Landau (see [19, Theorem 12.2]), states that for s X x k   k−1 +ε (2.1) τk(n) = Res ζ (s) + O x k+1 s=1 s n≤x for x ≥ 1 and k ≥ 2. The leading order term of the residue is x (log x)k−1 , (k − 1)! while the lower order terms are proportional to x(log x)k−1−c for integers c with 1 ≤ c ≤ k − 1. We will need to sum τk(n) with n divisible by a fixed a ∈ N. We prove such a result with a weaker error term than (2.1). This suffices for our application, as we only require a power savings in x/a below.

Lemma 2.1. For a ∈ N and x ≥ a, we have  s   k+3  X x k x k+6 +ε ω(a) (2.2) τk(n) = Res ζ (s)F (s, a) + O τk(a) M , s=1 s a n≤x a|n where υ −1 k p m Y   1  X τk(p ) (2.3) F (s, a) := 1 − 1 − ps pms pυp ||a m=0 4 RIZWANUR KHAN, MICAH B. MILINOVICH, AND UNIQUE SUBEDI

and √  2 + 16 (2.4) M := √ . 2 − 1 Though the function F (s, a) depends on k, we suppress this in the notation since k is assumed to be fixed. Partial sums of divisor functions over arithmetic progressions have been extensively studied. In particular, Chace [3] has provided an asymptotic for the left hand side of (2.2). The form of our asymptotic, though it has a weaker error term, is better suited for our purposes. We postpone the proof of Lemma 2.1 to the end of this paper (see Section 5). xs k Let us look at the main term in (2.2). Writing out the Laurent series expansion of s ζ (s)F (s, a)  s  around s = 1, we obtain that the leading term of Res x ζk(s) F (s, a) is s=1 s x (log x)k−1 (2.5) F (1, a) , (k − 1)! while the lower order terms are proportional to dj n o (2.6) x (log x)k−1−c F (s, a) dsj s=1 for integers j and c with 1 ≤ c ≤ k − 1 and 0 ≤ j ≤ c. To study the behavior of F (s, a) and its higher derivatives at s = 1, we use its multiplicativity. For a = p, a prime, the expression in (2.3) takes the simpler form  1 k F (s, p) = 1 − 1 − . ps When s = 1, we can use binomial expansion to obtain the estimates

k X k−1k k  1  (2.7) F (1, p) = 1 − = + O ` p p p2 `=0 and, dj n o (log p)j (2.8) F (s, p)  dsj s=1 p for j ≥ 0. Additionally, we also use Merten’s estimates [16, Theorem 2.7], which are weaker than the prime number theorem, several times throughout the paper: for x ≥ 3, we have X 1 (2.9) = log log x + O(1) p p≤x and, for j ≥ 1, we have X (log p)j (2.10)  (log x)j. p p≤x

2.2. Weighted average of ω(n). We want to show that, as n ranges over the integers below x, the average of ω(n) with respect to the weighted measure τk(n) is asymptotically k log log x. More precisely, we aim to prove that X ω(n) τk(n) n≤x (2.11) X = k log log x + O(1). τk(n) n≤x A WEIGHTED VERSION OF THE ERDOS-KAC˝ THEOREM 5

With the rearrangement X X  X  X X ω(n) τk(n) = 1 τk(n) = τk(n), n≤x n≤x p|n p≤x n≤x p|n followed by an application of Lemma 2.1, the left-hand side of (2.11) is

−1  s k+3 +ε   X  X x k  x k+6 ω(p) (2.12) τk(n) Res ζ (s)F (s, p) + O τk(p) M . s=1 s p n≤x p≤x Using the estimate (2.1) and recalling the leading order term for the residue stated in (2.5), we see that the main term in (2.12) equals X X k F (1, p) = + O(1) = k log log x + O(1), p p≤x p≤x where we have used (2.7) and Merten’s result in (2.9). Now, it suffices to show that the remaining terms in (2.12) are O(1). First, to handle the error ω(p) term, since k is fixed, we trivially have τk(p) = k = O(1) and M = M = O(1). Using the estimate (2.1), the contribution of error term in (2.12) is

k+3 +ε 1 X x k+6   1. x(log x)k−1 p p≤x Next, we handle the contribution of non-leading terms of the residue in (2.12). In view of (2.6), the remaining contribution of the residue is proportional to

1 X dj n o x (log x)k−1−c F (s, p) x (log x)k−1 dsj s=1 p≤x for 1 ≤ c ≤ k − 1 and 0 ≤ j ≤ c. Using the estimate (2.8) followed by (2.10), the above expression is

1 X (log p)c   1. (log x)c p p≤x This completes the proof that (2.11) follows from Lemma 2.1.

3. Reduction of Theorem 1.1 We will deduce Theorem 1.1 from the following technical proposition.

Proposition 3.1. Define ( −F (1, p), if p - n, fp(n) = 1 − F (1, p), if p|n. Let k and m be fixed natural numbers, and 3 < z ≤ x. We have X  X m fp(n) τk(n) ( m/2 m−1  n≤x p≤z (m − 1)!! k log log z + O (log log z) 2 , if m is even, (3.1) X = m−1  τk(n) O (log log z) 2 , if m is odd, n≤x where (m − 1)!! denotes the product of all odd integers up to and including (m − 1). 6 RIZWANUR KHAN, MICAH B. MILINOVICH, AND UNIQUE SUBEDI

1 3.1. Deducing Theorem 1.1 from Proposition 3.1. Let z = x (k+6)m . Recalling the estimate P p≤x F (1, p) = k log log x + O(1), we can write X X ω(n) − k log log x = 1 − F (1, p) + O(1) p|n p≤x X X X X = 1 + 1 − F (1, p) − F (1, p) + O(1) p≤z p>z p≤z zz zz p|n because n can have at most (k + 6)m prime divisors between z and x, lest n will be larger than x. Furthermore, X F (1, p) = k log log x − k log log z + O(1) = O(1), z

1 1 m−1   m−2  2   m  2 X X X X X X fp(n) τk(n) ≤ fp(n) τk(n) fp(n) τk(n) . n≤x p≤z n≤x p≤z n≤x p≤z

m−1 Again using (3.1), we see that the error term in (3.2) is  (log log z) 2 . Combining the above estimates, this shows that Theorem 1.1 is a consequence of Proposition 3.1.

4. Proof of Proposition 3.1 Q α For fp(n) defined in Proposition 3.1 and r ∈ N, define fr(n) := pα||r fp(n) . Thus fr(n) is totally multiplicative in r. Then, we can write X  X m X X fp(n) τk(n) = fp1p2···pm (n) τk(n),

n≤x p≤z p1,p2,...,pm≤z n≤x A WEIGHTED VERSION OF THE ERDOS-KAC˝ THEOREM 7

which allows us to write the left-hand side of (3.1) as P X n≤x fp1p2···pm (n) τk(n) (4.1) P . n≤x τk(n) p1,p2,...,pm≤z We now evaluate (4.1) to prove Proposition 3.1. P Writing r = p1p2 ··· pm, let us consider n≤x fr(n) τk(n). Since there are m primes pi and each 1 1 pi ≤ z, where z = x (k+6)m , we only need to consider the range r ≤ x k+6 . Let R denote the square-free Q part of r. That is, R = pα||r p. Notice that, by definition, if a = (n, R), then fr(n) = fr(a). Thus, we can write X X X X X fr(n) τk(n) = fr(a) τk(n) = fr(a) τk(n). n≤x a|R n≤x a|R n≤x (n,R)=a a|n (R/a,n/a)=1 P Using the identity b|n,b|m µ(b) = 1 if (n, m) = 1 and equals 0 otherwise, it follows that X X X X fr(a) τk(n) = fr(a) µ(b) τk(n) a|R n≤x ab|R n≤x a|n ab|n (R/a,n/a)=1

s  k+3 +ε ! X x k   x  k+6 ω(ab) = fr(a) µ(b) Res ζ (s)F (s, ab) + O τk(ab) M , s=1 s ab ab|R

ω(ab) ε where the last equality follows from Lemma 2.1. Since M ≤ τdMe(ab) ≤ (ab) , which uses that ε k+3 +ε ab is square-free, and τk(ab)  (ab) , the error term above is O(x k+6 ). When this error term is summed for all ab|R, the total contribution is

X k+3 +ε k+4 +ε  x k+6  x k+6 . 1 r≤x k+6 Thus, using the estimate (2.1), we deduce that X fr(n) τk(n) s ! n≤x (k − 1)! X x k  −2 +ε (4.2) = fr(a) µ(b) Res ζ (s) F (s, ab) + O(x k+6 ). X x(log x)k−1 s=1 s τk(n) ab|R n≤x

4.1. Main Term of (4.1). Recalling the leading order term of the residue stated in (2.5), we will P see that the main term in (4.2) is ab|R fr(a)µ(b)F (1, ab). For convenience, let us give this main term a name by defining X G(r) := fr(a) µ(b) F (1, ab). ab|R It is easy to see that G(r) is multiplicative in r and therefore Y G(r) = G(pα). pα||r Notice that for any prime p, we have G(p) = (contribution of ab = 1) + (contribution of a = p, b = 1) + (contribution of a = 1, b = p) = −F (1, p) + (1 − F (1, p)) F (1, p) − (−F (1, p)) F (1, p) = 0. 8 RIZWANUR KHAN, MICAH B. MILINOVICH, AND UNIQUE SUBEDI

This is an important observation because it implies that G(r) is supported on square-full integers. We also note that for α = 2, we have 2 2 G(p2) = F (1, p) + (1 − F (1, p))2F (1, p) − − F (1, p) F (1, p) = F (1, p)1 − F (1, p) ≥ 0 as 0 < F (1, p) < 1. For α ≥ 2, using the estimate (2.7), we get k  1  (4.3) G(pα) = + O . p p2 Since G(r) is supported over square-full integers r, the contribution to (4.2) from the leading term of the residue (2.5) is X G(p1p2 ··· pm).

p1,p2,...,pm≤z p1p2···pm square-full Denote q1 < q2 < . . . < qt to be the distinct primes in the list p1, p2, . . . , pm. Thus p1p2 ··· pm = α1 α2 αt q1 q2 ··· qt . Since p1p2 ··· pm is square-full, we have αi ≥ 2 and t ≤ m/2. By multiplicativity, the expression above can be written as

X X X m! α1 αt G(q1 ) ··· G(qt ). α1! . . . αt! t≤m/2 q1

When m is even, we have a term t = m/2, where all αi = 2, that yields the expected Gaussian moment for the following reason. Using the estimate (4.3), the contribution of this term is m/2 ! m! X Y k  1  + O m/2 2 2 qi qi q1

Dropping the condition that the primes qi need to be distinct, we note that the sum is clearly bounded from above by  m/2 X k  1  m/2  m −1 + O = k log log z + O (log log z) 2 . q q2 q≤z

If we consider q1, . . . , qm/2−1 as given, then the sum over qm/2 is at least X k  1  + O , q q2 πm/2≤q≤z

where πn denotes the n-th prime. This is because qm/2 must be distinct from the other m/2 − 1 primes, and to get this lower bound we don’t allow it to be any of the smallest m/2 − 1 primes, for k 1 q + O( q2 ) increases as q decreases. By the same argument we get a lower bound for the sum over each qi. In this way, we see that the sum over q1, q2, . . . , qm/2 distinct is bounded from below by  m/2 X k  1  m/2  m −1 + O = k log log z + O (log log z) 2 . q q2 πm/2≤q≤z To derive the second expression from the first, keep in mind that m = O(1). Thus, the upper and lower bounds are the same up to a m/2 − 1 power of log log z. So we can conclude that the contribution of the term with t = m/2 is

m! m/2  m −1 (4.4) k log log z + O (log log z) 2 . 2m/2(m/2)! A WEIGHTED VERSION OF THE ERDOS-KAC˝ THEOREM 9

Notice that the main term above is the main term in (3.1), as desired.

4.2. Error terms in (4.1). Continuing with the notation above, we first consider the contribution αi of the terms with t < m/2. We use G(qi )  1/qi and get that the contribution of such terms are  t X 1 X 1 t m −1 (4.5)    (log log z)  (log log z) 2 . q1 . . . qt q q1

p1,p2,...,pm≤z

1 1 where π(z) is the prime counting function. Recalling that z = x m(k+6) , we get π(z)m  zm = x k+6 . So, the error term above is −1 +ε (4.6)  x k+6  1. Next we handle the contribution of the non-leading terms of the residue. In view of (2.6), the contribution of such terms is bounded by

X 1 X dj n o (4.7) G(s, p1p2 ··· pm) , (log x)c dsj s=1 1≤c≤k−1 p1,p2,...,pm≤z 0≤j≤c where we define X G(s, r) := fr(a) µ(b) F (s, ab). ab|R

α1 α1 αt Note that G(1, r) = G(r). As before, let p1p2 ··· pm = q1 q1 ··· qt for distinct primes q1 < q2 < . . . < qt in the list p1, p2, . . . , pm and, using multiplicativity, write the expression within absolute values above as 1 X X X m! dj n o α1 αt c j G(s, q1 ) ··· G(s, qt ) . (log x) α1! ··· αt! ds s=1 t≤m q1

αi Here, the sum over βis counts all possible ways the G(s, qi ) terms can be differentiated using the αi product rule. Some βi values can be 0, which represents G(s, qi ) that are not differentiated. If we have a case where βi = 0 and αi = 1, then the whole sum collapses to 0 because we will have a factor G(1, qi) = 0 in the product (recall that G(r) is supported on square-full r). Therefore, every α 1 occurrence of G(s, qi) needs to be differentiated. Recall by (4.3) that G(s, q )  q and observe that (2.8) implies that dβi n o (log q)βi G(s, qα)  . dsβi s=1 q Using these estimates, we obtain that (4.7) is i=t X X 1 X Y  X (log q)βi   . (log x)c q 1≤c≤k−1 t≤m β1,β2,...,βt≥0 i=1 q≤z 0≤j≤c β1+β2+...+βt=j 10 RIZWANUR KHAN, MICAH B. MILINOVICH, AND UNIQUE SUBEDI

Using (2.10), we get that this is bounded by X X 1 (4.8) (log z)j (log log z)|{1≤i≤t: βi=0}| (log x)c 1≤c≤k−1 t≤m 0≤j≤c

αi Here, |{1 ≤ i ≤ t : βi = 0}| is the number of terms G(s, qi ) which are not differentiated. Since all αi G(s, qi ) that remain undifferentiated have αi ≥ 2, lest the entire expression vanishes, and not all αi = 2, since those terms were treated in the previous section. Hence, we must have m − 1 |{1 ≤ i ≤ t : β = 0}| ≤ . i 2 m−1 Therefore, we get that the expression in (4.8) is bounded by (log log z) 2 . This completes the proof of Proposition 3.1.

5. Proof of Lemma 2.1 Our proof of Lemma 2.1 involves a standard application of Perron’s formula applied to the Dirich- let series associated with the sum on the left-hand side of (2.2). Making the substitution n = ab, we can express this associated as ∞ ∞ ∞ ! ∞ ! m+υp m X τk(n) 1 X τk(ab) 1 Y X τk(p ) Y X τk(p ) (5.1) = = , ns as bs as pms pms n=1 b=1 pυp ||a m=0 p a m=0 a|n - where the second equality follows from using the multiplicativity of τk(n) to express the sum as an . Using the well-known Dirichlet series of ζk(s) and its corresponding Euler product, ∞ ∞ m X τk(n) Y X τk(p ) ζk(s) = = , ns pms n=1 p m=0 we can complete the product over primes in (5.1) to obtain Euler product of ζk(s) and write ∞ ∞ ∞ ! k m+υp m X τk(n) ζ (s) Y X τk(p ). X τk(p ) (5.2) = . ns as pms pms n=1 pυp ||a m=0 m=0 a|n Now, writing the sum in numerator on the right-hand side as

∞ ∞ υp−1 m+υp m m X τk(p )  X τk(p ) X τk(p ) = psυp − pms pms pms m=0 m=0 m=0 and using the identity

∞ m s k X τk(p )  p  (5.3) = , pms ps − 1 m=0 we can reduce (5.2) to υ −1 ∞ k p m X τk(n) Y   1  X τk(p ) = ζk(s) 1 − 1 − . ns ps pms n=1 pυp ||a m=0 a|n With the definition of F (s, a) stated in (2.3), this can be expressed as ∞ X τk(n) = ζk(s) F (s, a). ns n=1 a|n Note this Dirichlet series converges absolutely for Re(s) > 1. A WEIGHTED VERSION OF THE ERDOS-KAC˝ THEOREM 11

An application of Perron’s formula (see [18, Part II. §2.1]) gives

Z c+iT c ! X 1 ds X  x  τk(n) (5.4) τ (n) = ζ(s)k F (s, a) xs + O , k 2πi s n T | log x | n≤x c−iT n=1 n a|n a|n where we choose c and T such that c > 1 and T is large. First, let us handle the error term in (5.4). Making the substitution n = ab and using inequality τk(ab) ≤ τk(a)τk(b), we can write the expression in the error term as

c ∞ x τk(a) X τk(b) . a T c x/a  b=1 b | log b | x/a We estimate this error by splitting the range of summation into two pieces. The terms where b < 2 3x/a or b > 2 contribute an amount that is bounded by c c ∞ c k c x τk(a) X τk(b) x τk(a) X τk(b) x ζ (c) τk(a) x τk(a)  =  . a T c x/a  a T bc a T a T (c − 1)k x/a b | log b | b=1 b< 2 3x/a b> 2 −1 x/a 3x/a c c Here we used the fact that ζ(c)  (1 − c) for c > 1. When 2 ≤ b ≤ 2 , we have b  (x/a) ε/2 ε/2 and τk(b)  b  (x/a) . So, the size of error is c ε/2 x X τk(b) τk(a)x X 1 (5.5) τk(a)  . a c x/a  T a x/a  x/a 3x/a b T | log b | x/a 3x/a | log b | 2

x  x ε/2 using the estimate log a  a . Letting c = 1 + ε, we conclude that Z c+iT  1+ε X 1 ds τk(a)x (5.6) τ (n) = ζ(s)k F (s, a) xs + O . k 2πi s T a n≤x c−iT a|n Next we evaluate the integral on the right-hand side of (5.6) using the residue theorem. Observing that the only singularity of the integrand inside the (positively oriented) rectangle R with vertices 1 1 c − iT , c + iT , 2 + iT , and 2 − iT is at s = 1, the calculus of residues gives 1 Z ds xs  ζ(s)k F (s, a) xs = Res ζk(s)F (s, a) . 2πi R s s=1 s The integral along the right-hand edge of R corresponds to the integral in (5.6), so it suffices to estimate the contribution of the integrals along the left-hand edge and horizontal portions of the contour. To bound these integrals, we recall the classical (subconvexity) estimate

1 1  6 (5.7) ζ 2 + it  (|t|+1) , for t > 0. This estimate and the Phragm´en–Lindel¨ofprinciple imply that 1 (c−σ)/(c− 1 ) (5.8) ζ(σ + it)  (|t|+1) 6 2 12 RIZWANUR KHAN, MICAH B. MILINOVICH, AND UNIQUE SUBEDI

1 uniformly for σ ∈ [ 2 , c] and t ∈ [−T,T ]. We also need an estimate of F (s, a) in this region. Notice that F (s, a) can be expressed as the right-hand side of (5.2) divided by ζk(s). Thus, we have ∞ ∞ m+υp m 1 Y  X τk(p ). X τk(p ) |F (s, a)| = , aσ pms pms pυp ||a m=0 m=0

m+υp m υp where σ = Re(s). Using the inequality τk(p ) ≤ τk(p ) τk(p ) and (5.3), we derive that ∞ ∞ m+υp m σ k X τk(p ) X τk(p )  p  ≤ τ (pυp ) = τ (pυp ) . pms k pmσ k pσ − 1 m=0 m=0 The identity (5.3) gives the bound of remaining sum as well, namely

∞ m −1 s k σ k  X τk(p ) p − 1 p + 1 = ≤ . pms ps pσ m=0 √ √ σ σ k k k/6 1 Notice that (p + 1)/(p − 1) ≤ ( 2 + 1)/( 2 − 1) = M for σ ≥ 2 , where M was defined in (2.4). So, combining these inequalities yields

σ k k ω(a) 1 Y p + 1 τk(a) M 6 (5.9) |F (s, a)| ≤ τ (pυp ) ≤ , for σ ≥ 1 . aσ k pσ − 1 aσ 2 pυp ||a Now, using the estimates for ζ(s) and F (s, a) stated in (5.7), (5.8), and (5.9), respectively, the integrals along the horizontal edges of R can be estimated as

Z c±iT Z c σ ! 1 k s ds k ω(a) x k (c−σ)/(c− 1 )−1 ζ (s) F (s, a) x = O τk(a) M 6 T 6 2 dσ 2πi 1 s 1 a 2 ±iT 2 c 1  −1x k ω(a)  k −1x 2 k ω(a) = O T τ (a)M 6 + O T 6 τ (a)M 6 , a k a k since the maximum of the integrand occurs at one of the endpoints. Similarly, the integral along the left-hand side of R can be estimated as 1 +iT  1 T  1 Z 2 ds x 2 k Z dt k s 6 ω(a) 1  k ζ (s) F (s, a) x = O τk(a) M |ζ 2 + it | 2πi 1 s a |t|+1 2 −iT −T  1 Z T  x 2 k ω(a) k −1 = O τk(a) M 6 (|t|+1) 6 dt a −T  1  x 2 k k ω(a) = O T 6 τ (a) M 6 . a k Collecting estimates, we have shown that 1 Z c+iT ds xs  ζ(s)k F (s, a) xs = Res ζk(s)F (s, a) 2πi c−iT s s=1 s  k ω(a) c 1 τk(a) M 6 x  k x 2 k ω(a) + O + O T 6 τ (a) M 6 T a a k Inserting this estimate into (5.6) and recalling that c = 1 + ε, we find that

s  k ω(a) 1+ε 1 X x k  τk(a) M 6 x  k x 2 k ω(a) τk(n) = Res ζ (s)F (s, a) + O + O T 6 τk(a) M 6 . s=1 s T a a n≤x a|n Up to a factor of ε, the error terms are (essentially) minimized by choosing

3 x k+6 −k ω(a) T = M k+6 , a A WEIGHTED VERSION OF THE ERDOS-KAC˝ THEOREM 13

which finishes the proof of Lemma 2.1. Remark. Although we used the subconvexity estimate (5.7), we do not actually need anything 1 A nontrivial. Instead, we could have used any estimate of the form ζ( 2 + it)  (|t| + 1) for a fixed A > 0. This would lead to a weaker result, albeit still a power savings in x/a. Moreover, it is likely that a version of Lemma 2.1 can be proved in an elementary manner with a power savings in x/a and perhaps a different formula for the main term. We chose to use Perron’s formula for simplicity.

Acknowledgements. We thank Jeremy Clark and Maksym Radziwil l for helpful comments and pointing out useful references. We also thank Kannan Soundararajan for encouragement in the early stages of this project. This project evolved out of a senior honors thesis for the Sally M. Barksdale Honors College at the University of Mississippi. We thank the college for their support. RK was supported by the Simons Foundation (award 630985) and the National Science Foundation (grant DMS-2001183). MBM was supported by the Simons Foundation (award 712898) and the National Science Foundation (grant DMS-2101912). Any opinions, findings and conclusions or recommenda- tions expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation.

References [1] P. Billingsley. On the central limit theorem for the prime divisor functions. Amer. Math. Monthly, 76:132–139, 1969. [2] P. Billingsley. Probability and measure. Wiley Series in Probability and Mathematical Statistics: Probability and Mathematical Statistics. John Wiley & Sons, Inc., New York, second edition, 1986. [3] C. E. Chace. The divisor problem for arithmetic progressions with small modulus. Acta Arith., 61(1):35–50, 1992. [4] P. D. T. A. Elliott. Central limit theorems for classical cusp forms. Ramanujan J., 36(1-2):81–98, 2015. [5] P. D. T. A. Elliott. Corrigendum: Central limit theorems for classical cusp forms. Ramanujan J., 36(1-2):99–102, 2015. [6] P. Erd˝osand M. Kac. The Gaussian law of errors in the theory of additive number theoretic functions. Amer. J. Math., 62:738–742, 1940. [7] A. Fazzari. A weighted central limit theorem for log |ζ(1/2 + it)|. Mathematika, 67(2):324–341, 2021. [8] A. Fazzari. Weighted value distributions of the Riemann zeta function on the critical line. Forum Math., 33(3):579– 592, 2021. [9] A. Granville and K. Soundararajan. Sieving and the Erd˝os-Kactheorem. In Equidistribution in number theory, an introduction, volume 237 of NATO Sci. Ser. II Math. Phys. Chem., pages 15–27. Springer, Dordrecht, 2007. [10] H. Halberstam. On the distribution of additive number-theoretic functions. J. London Math. Soc., 30:43–53, 1955. [11] A. J. Harper. Two new proofs of the Erd˝os-Kactheorem, with bound on the rate of convergence, by Stein’s method for distributional approximations. Math. Proc. Cambridge Philos. Soc., 147(1):95–114, 2009. [12] I. Karatzas and S. E. Shreve. Brownian motion and stochastic calculus, volume 113 of Graduate Texts in Math- ematics. Springer-Verlag, New York, second edition, 1991. [13] R. Khan. On the distribution of ω(n). In Anatomy of integers, volume 46 of CRM Proc. Lecture Notes, pages 199–207. Amer. Math. Soc., Providence, RI, 2008. [14] W. J. LeVeque. On the size of certain number-theoretic functions. Trans. Amer. Math. Soc., 66:440–463, 1949. [15] K. Liu and J. Wu. Weighted Erd˝os-Kactheorem in short intervals. Ramanujan J., 55(1):1–12, 2021. [16] H. L. Montgomery and R. C. Vaughan. Multiplicative number theory. I. Classical theory, volume 97 of Cambridge Studies in Advanced Mathematics. Cambridge University Press, Cambridge, 2007. [17] A. R´enyi and P. Tur´an.On a theorem of Erd˝os-Kac. Acta Arith., 4:71–84, 1958. [18] G. Tenenbaum. Introduction to analytic and probabilistic number theory, volume 163 of Graduate Studies in Mathematics. American Mathematical Society, Providence, RI, third edition, 2015. Translated from the 2008 French edition by Patrick D. F. Ion. [19] E. C. Titchmarsh. The theory of the Riemann zeta-function. The Clarendon Press, Oxford University Press, New York, second edition, 1986. Edited and with a preface by D. R. Heath-Brown.

Department of Mathematics, University of Mississippi, University, MS 38677 USA Email address: [email protected]

Department of Mathematics, University of Mississippi, University, MS 38677 USA Email address: [email protected] 14 RIZWANUR KHAN, MICAH B. MILINOVICH, AND UNIQUE SUBEDI

Department of Mathematics, University of Mississippi, University, MS 38677 USA Email address: [email protected]