Residue races of the number of prime divisors function

We investigate the distribution of the function $\omega(n)$, the number of distinct prime divisors of $n$, in residue classes modulo $q$ for natural numbers $q$ greater than 2. In particular we ask `prime number races' style questions, as suggested by Coons and Dahmen in their paper `On the residue class distribution of the number of prime divisors of an integer'.

Seeing no reason why ω(n) should favour any particular residue class, we expect that for all a, In fact, it was proved in [1] that with c(q) = 1 − cos( 2π q ). It was also proved that for q > 2 the error term here is best possible, since it was also determined that for q > 2 This is in stark contrast to the case q = 2 for which we expect "square-root cancellation". Indeed, (1) ) for a = 0 and 1 is equivalent to the Riemann Hypothesis. For q = 2, it is well known that (1) is equivalent to the prime number theorem.
In [2], the authors suggest that, in the spirit of prime number races, it would be interesting to investigate the sign changes of N a,q (x) − N b,q (x). The traditional prime number races concern the popularity of residue classes for prime numbers rather than for the values of ω, that is, sign changes of π(x; a, q) − π(x; b, q) where π(x; a, q) is the number of primes less than or equal to x which are congruent to a modulo q. Rubinstein and Sarnak [5] proved under certain reasonable assumptions that the set {x ∈ N : π(x; 3, 4) < π(x; 1, 4)}, for example, does not have a natural density in the integers but does have a logarithmic density, defined for a subset E ⊂ N, if the limit exists, to be lim X→∞ 1 log X x X x∈E 1 x . Loosely speaking, the reason for this is that the difference π(x; 3, 4) − π(x; 1, 4) can be written as a sum of terms of the form sin(γ log x)/γ, where γ ranges over the imaginary parts of the zeros of certain Dirichlet L-functions. For an introduction to this topic see [3].
For our investigations it is natural to consider mean values of the multiplicative functions n → z ω(n) where z is taken to be a complex q-th root of unity. By applying a classical result first due to Selberg concerning such mean values we will establish an asymptotic formula for N a,q (x) with main term and next highest order term in the case q > 2. This will be used to prove our main theorem. The formula will contain an expression of the form cos(A log log x + B) and so in our case we have neither natural nor logarithmic density, but instead need to go further and define the notion of loglog density. We say a subset E ⊂ N has loglog density δ if With this we can now state our main theorems.
has no natural density, in fact Theorem 2. The set E a,b , defined in Theorem 1, has no natural or logarithmic density, but has loglog density equal to 1/2.
Given a complete ordering on the residue classes, we can also ask how often the different 'competitors' in our race are in that order.
Theorem 3. Let q > 2 be an integer and a ∈ {0, 1, . . . , q − 1}. Each of the following sets has Therefore, since there are 2q of them, these are the only permutations which appear with non-zero loglog densities.
Theorem 1 follows easily from the proofs of Proposition 6 and Theorem 3. Theorem 2 follows from Theorem 3 because, of the 2q permutations with non-zero loglog density, there are 1/q in which N a,q (x) < N b,q (x).
We also prove that certain orderings can occur only a finite number of times. is infinite is such that σ(0) = σ(1) ± 1 mod q.
Notice that there are 2q!/(q−1) such permutations so if q is large, a vanishingly small proportion of the possible permutations occur infinitely often.
Example 2. If q = 4 then only 16 out of the 24 orderings can occur for arbitrarily large x. There is a point after which, if "0 is in the lead", then 2 cannot be second and vice versa. Similarly, they cannot simultaneously hold positions 3rd and 4th, and the same goes for the pair of residue classes 1 and 3.
Let us look at the start of the mod 4 race before moving on to the proofs. For a better view, the mean has been subtracted and the points are plotted on a loglog scale. Figure 1. ω mod 4 race The plotted points along with their colours are as follows: ) log x : 10 x 10 8 }, ) log x : 10 x 10 8 }, ) log x : 10 x 10 8 }, This data strongly suggests, at least for the q = 4 race, that any ordering not of the form stated in Theorem 4 can never occur. It may not be unreasonable to conjecture that this is the case for all q.
We remark that similar results can be proved for the sets where Ω(n) = p k |n 1 counts prime divisors with multiplicities.

Preliminaries
To save space, we will use log 2 x and e 2 (x) to denote log log x and exp(exp(x)) respectively. We start by proving an asymptotic formula for N a,q (x).
Proof. The main result we will make use of is [1, Theorem 2] from which it follows that for z a complex variable bounded in absolute value by 1, and g(z) defined as in the proposition we have These mean values satisfy We can isolate the N a,q (x) as follows Substituting (2) into the line above gives For sufficiently large x, the terms in this sum with largest absolute value are those with j = 1 and Combining this observation with the fact that g(z) = g(z) we get Notice that if q = 2 then φ = −1 and g(−1) = 0. It is for this reason we cannot say any more in this most interesting case. Indeed we actually suspect a much stronger error term of O(x 1/2+o(1) ) in this case. For q > 2 though, g(φ) = 0, as Γ has no pole there and the product has only non-zero terms.
From this, we see immediately that and also .
Before trying to understand when N a,q (x) is less than this average value of x/q, we start with the simpler, but related, question of when the secondary term is negative. That is, when Now cosine is negative "about half the time" which might suggest that N a,q (x) is less than its average value "about half the time" too. To be precise, the set {n ∈ N : cos n < 0} has natural density It is not true though that {n ∈ N : cos(log 2 n) < 0} has natural density 1/2. In fact this set has no natural density, as we shall see below. The presence of the cos(log 2 x) type term is why we ought to be looking at the log log density.
The property of possessing a natural density is stronger than that of possessing a logarithmic density, which is stronger still than having a loglog density. In fact, a straightforward application of partial summation proves that if a set E ⊂ N has a natural density then it also has a logarithmic density and the two are equal, and if E has a logarithmic density then it has a loglog density and the two are equal. The following lemma, which we do not prove here, reassures us that our notions of logarithmic and loglog density are sound. Lemma 1. There exist constants γ, µ such that has loglog density 1/2 but no natural or logarithmic densities.
Writing [α] for the largest integer at most α, we therefore have so E certainly doesn't have a natural density. When we look at the logarithmic density, we get, since log y N = e π/A log x N , 1 log x N n x N n∈E 1 n = e π/A log y N n y N n∈E 1 n , so for the limit to exist as N → ∞ we would need e π/A = 1 which is impossible.
When we look at the loglog density however, we get, using Lemma 1 lim sup A similar calculation shows that lim inf x→∞ 1 log 2 x n x n log n∈E 1 n log n = 1 2 and the result follows.
It is tempting to conclude that the set has no natural or logarithmic densities but has loglog density 1/2. Unfortunately, to prove this rigorously we will need to account for the error introduced by the terms we have left out. We will do this shortly. If we forget about error terms for the moment though (which we can only really do when sin(2π/q) log 2 x+θ − 2πa q is not too close to a zero of cos), then asking "for which value of a is N a,q (x) largest" is tantamount to asking "for which value of a is 2π q q 2π (sin(2π/q) log 2 x + θ) − a closest to some 2nπ ∈ 2πZ". The answer is the closest integer to q 2π (sin(2π/q) log 2 x + θ) modulo q which clearly depends on x. Any given a will therefore produce the most values of n x such that ω(n) ≡ a mod q when there exists some m ∈ Z such that, a − 1 2 < q 2π (sin(2π/q) log 2 x + θ) + mq < a + 1 2 .
A similar calculation to that in the proof of Proposition 6 shows that for each a, the set of such x values has loglog density 1/q.
We end this section with a picture of the curves cos sin 2π 6 log 2 x + θ − 2πa 6 for a = 0, 1, . . . , 5 plotted on a scale which makes the oscillations visible.

Figure 2. Shifted sinusoidal curves
Although this picture isn't to be taken too seriously it serves as a useful illustration to have in mind for comparing the secondary terms.
Let > 0 be small and define First let us see how, for small , these sets approximate U a,q . Our formula for N a,q (x) gives as x → ∞ and for q 3 we have g(φ) = 0. Therefore, for all > 0 there exists some X 0 ( ) such that for x X 0 and for each a, b ∈ {0, . . . , q − 1}, . We will use this fact to prove that for x X 0 and sufficiently small we have (3) x ∈ U − a,q ⇒ x ∈ U a,q and (4) x ∈ U a,q ⇒ x ∈ U + a,q .
It follows that After showing that each of U ± a,q has loglog density 1 2q + o (1) for arbitrarily small , where o (1) is a quantity that tends to 0 as → 0, we will have shown that U a,q has loglog density 1 2q . The result for V a,q is proved in much the same way.

Proof of (3) and (4).
Suppose x X 0 and x ∈ U − a,q and is small enough so that sin( π q ) sin( √ ) > . For example, < 1/q 2 will do. In order to show that x ∈ U a,q (x) we need to show To do so we will use the identity For (a), let i ∈ {1, 2, . . . , or [ q−1 2 ]}, then where again ξ ∈ − π q + √ , − √ which is again > . This proves (b) and that x ∈ U a,q (x).
Now suppose x X 0 and x ∈ U a,q . To show that x ∈ U + a,q we need to find some n ∈ Z such that Suppose this is not the case. Then either we can find some n such that In which case for some ξ ∈ − π − √ , − π q − √ . This is then > and so N a−1,q (x) > N a,q (x), contrary to our assumption on x. Or else we can find some n such that In which case for some ξ ∈ ( √ , π − √ ). Again making the difference > and so N a+1,q (x) > N a−1,q (x), again contrary to our assumption on x. We must therefore have x ∈ U + a,q .
It remains to calculate the loglog densities of U − a,q and U + a,q . This is similar to the proof of Proposition 6. For N ∈ N define x N := e 2 ((2N π + 2aπ/q − θ − π/q + √ )/ sin(2π/q)) and y N := e 2 ((2N π + 2aπ/q − θ − √ )/ sin(2π/q)), then for x X 0 we have x ∈ U − a,q if and only if x ∈ (x N , y N ) for some N and we therefore have Also, lim sup Hence the loglog density of U − a,q exists and is equal to 1 2q − √ π . A very similar calculation shows that the loglog density of U + a,q is 1 2q + √ π and so by (4) and the fact that can be taken arbitrarily small we can conclude that U a,q has loglog density 1 2q .

Proof of Theorem 4
As in the previous proof, let be small enough and X 0 large enough so that sin( π q ) sin( and that for x X 0 we have cos sin( 2π q ) log 2 x + θ − 2πa q − cos sin( 2π q ) log 2 x + θ − 2πb q > ⇒ N a,q (x) > N b,q (x) and x ∈ U − a,q ⇒ x ∈ U a,q and x ∈ U a,q ⇒ x ∈ U + a,q . We will show that only the permutations stated in Theorem 4 can occur for x X 0 . Suppose that we have some x X 0 for which N a,q (x) is leading, that is, max c mod q N c,q (x) = N a,q (q). It follows that x ∈ U + a,q ∪ V + a,q since otherwise there would be some integer n such that π q + √ sin( 2π q ) log 2 x + θ − 2πa q + 2nπ 2π − π q − √ and hence cos sin( 2π q ) log 2 x + θ − 2πb q − cos sin( 2π q ) log 2 x + θ − 2πa q = −2 sin( π(a − b) q ) sin(ξ + π(a − b) q ) for some ξ ∈ ( π q + √ , 2π − π q − √ ). But then this is > for either b = a + 1 mod q or b = a − 1 mod q contradicting the assumption that N a,q (x) was leading.