One of the basic problems in analytic number theory is to obtain bounds and asymptotics for sums of the form

\displaystyle  \sum_{n \leq x} f(n)

in the limit {x \rightarrow \infty}, where {n} ranges over natural numbers less than {x}, and {f: {\bf N} \rightarrow {\bf C}} is some arithmetic function of number-theoretic interest. (It is also often convenient to replace this sharply truncated sum with a smoother sum such as {\sum_n f(n) \psi(n/x)}, but we will not discuss this technicality here.) For instance, the prime number theorem is equivalent to the assertion

\displaystyle  \sum_{n \leq x} \Lambda(n) = x + o(x)

where {\Lambda} is the von Mangoldt function, while the Riemann hypothesis is equivalent to the stronger assertion

\displaystyle  \sum_{n \leq x} \Lambda(n) = x + O(x^{1/2+o(1)}).

It is thus of interest to develop techniques to estimate such sums {\sum_{n \leq x} f(n)}. Of course, the difficulty of this task depends on how “nice” the function {f} is. The functions {f} that come up in number theory lie on a broad spectrum of “niceness”, with some particularly nice functions being quite easy to sum, and some being insanely difficult.

At the easiest end of the spectrum are those functions {f} that exhibit some sort of regularity or “smoothness”. Examples of smoothness include “Archimedean” smoothness, in which {f(n)} is the restriction of some smooth function {f: {\bf R} \rightarrow {\bf C}} from the reals to the natural numbers, and the derivatives of {f} are well controlled. A typical example is

\displaystyle  \sum_{n \leq x} \log n.

One can already get quite good bounds on this quantity by comparison with the integral {\int_1^x \log t\ dt}, namely

\displaystyle  \sum_{n \leq x} \log n = x \log x - x + O(\log x),

with sharper bounds available by using tools such as the Euler-Maclaurin formula (see this blog post). Exponentiating such asymptotics, incidentally, leads to one of the standard proofs of Stirling’s formula (as discussed in this blog post).

One can also consider “non-Archimedean” notions of smoothness, such as periodicity relative to a small period {q}. Indeed, if {f} is periodic with period {q} (and is thus essentially a function on the cyclic group {{\bf Z}/q{\bf Z}}), then one has the easy bound

\displaystyle  \sum_{n \leq x} f(n) = \frac{x}{q} \sum_{n \in {\bf Z}/q{\bf Z}} f(n) + O( \sum_{n \in {\bf Z}/q{\bf Z}} |f(n)| ).

In particular, we have the fundamental estimate

\displaystyle  \sum_{n \leq x: q|n} 1 = \frac{x}{q} + O(1). \ \ \ \ \ (1)

This is a good estimate when {q} is much smaller than {x}, but as {q} approaches {x} in magnitude, the error term {O(1)} begins to overwhelm the main term {\frac{n}{q}}, and one needs much more delicate information on the fractional part of {\frac{n}{q}} in order to obtain good estimates at this point.

One can also consider functions {f} which combine “Archimedean” and “non-Archimedean” smoothness into an “adelic” smoothness. We will not define this term precisely here (though the concept of a Schwartz-Bruhat function is one way to capture this sort of concept), but a typical example might be

\displaystyle  \sum_{n \leq x} \chi(n) \log n

where {\chi} is periodic with some small period {q}. By using techniques such as summation by parts, one can estimate such sums using the techniques used to estimate sums of periodic functions or functions with (Archimedean) smoothness.

Another class of functions that is reasonably well controlled are the multiplicative functions, in which {f(nm) = f(n) f(m)} whenever {n,m} are coprime. Here, one can use the powerful techniques of multiplicative number theory, for instance by working with the Dirichlet series

\displaystyle  \sum_{n=1}^\infty \frac{f(n)}{n^s}

which are clearly related to the partial sums {\sum_{n \leq x} f(n)} (essentially via the Mellin transform, a cousin of the Fourier and Laplace transforms); for this post we ignore the (important) issue of how to make sense of this series when it is not absolutely convergent (but see this previous blog post for more discussion). A primary reason that this technique is effective is that the Dirichlet series of a multiplicative function factorises as an Euler product

\displaystyle  \sum_{n=1}^\infty \frac{f(n)}{n^s} = \prod_p (\sum_{j=0}^\infty \frac{f(p^j)}{p^{js}}).

One also obtains similar types of representations for functions that are not quite multiplicative, but are closely related to multiplicative functions, such as the von Mangoldt function {\Lambda} (whose Dirichlet series {\sum_{n=1}^\infty \frac{\Lambda(n)}{n^s} = -\frac{\zeta'(s)}{\zeta(s)}} is not given by an Euler product, but instead by the logarithmic derivative of an Euler product).

Moving another notch along the spectrum between well-controlled and ill-controlled functions, one can consider functions {f} that are divisor sums such as

\displaystyle  f(n) = \sum_{d \leq R; d|n} g(d) = \sum_{d \leq R} 1_{d|n} g(d)

for some other arithmetic function {g}, and some level {R}. This is a linear combination of periodic functions {1_{d|n} g(d)} and is thus technically periodic in {n} (with period equal to the least common multiple of all the numbers from {1} to {R}), but in practice this periodic is far too large to be useful (except for extremely small levels {R}, e.g. {R = O(\log x)}). Nevertheless, we can still control the sum {\sum_{n \leq x} f(n)} simply by rearranging the summation:

\displaystyle  \sum_{n \leq x} f(n) = \sum_{d \leq R} g(d) \sum_{n \leq x: d|n} 1

and thus by (1) one can bound this by the sum of a main term {x \sum_{d \leq R} \frac{g(d)}{d}} and an error term {O( \sum_{d \leq R} |g(d)| )}. As long as the level {R} is significantly less than {x}, one may expect the main term to dominate, and one can often estimate this term by a variety of techniques (for instance, if {g} is multiplicative, then multiplicative number theory techniques are quite effective, as mentioned previously). Similarly for other slight variants of divisor sums, such as expressions of the form

\displaystyle  \sum_{d \leq R; d | n} g(d) \log \frac{n}{d}

or expressions of the form

\displaystyle  \sum_{d \leq R} F_d(n)

where each {F_d} is periodic with period {d}.

One of the simplest examples of this comes when estimating the divisor function

\displaystyle  \tau(n) := \sum_{d|n} 1,

which counts the number of divisors up to {n}. This is a multiplicative function, and is therefore most efficiently estimated using the techniques of multiplicative number theory; but for reasons that will become clearer later, let us “forget” the multiplicative structure and estimate the above sum by more elementary methods. By applying the preceding method, we see that

\displaystyle  \sum_{n \leq x} \tau(n) = \sum_{d \leq x} \sum_{n \leq x:d|n} 1

\displaystyle  = \sum_{d \leq x} (\frac{x}{d} + O(1))

\displaystyle  = x \log x + O(x). \ \ \ \ \ (2)

Here, we are (barely) able to keep the error term smaller than the main term; this is right at the edge of the divisor sum method, because the level {R} in this case is equal to {x}. Unfortunately, at this high choice of level, it is not always possible to always keep the error term under control like this. For instance, if one wishes to use the standard divisor sum representation

\displaystyle  \Lambda(n) = \sum_{d|n} \mu(d) \log \frac{n}{d},

where {\mu} is the Möbius function, to compute {\sum_{n \leq x} \Lambda(n)}, then one ends up looking at

\displaystyle  \sum_{n \leq x} \Lambda(n) = \sum_{d \leq x} \mu(d) \sum_{n \leq x:d|n} \log \frac{n}{d}

\displaystyle  = \sum_{d \leq x} \mu(d) ( \frac{n}{d} \log \frac{n}{d} - \frac{n}{d} + O(\log \frac{n}{d}) )

From Dirichlet series methods, it is not difficult to establish the identities

\displaystyle  \lim_{s\rightarrow 1^+} \sum_{n=1}^\infty \frac{\mu(n)}{n^s} = 0

and

\displaystyle  \lim_{s \rightarrow 1^+} \sum_{n=1}^\infty \frac{\mu(n) \log n}{n^s} = -1.

This suggests (but does not quite prove) that one has

\displaystyle  \sum_{n=1}^\infty \frac{\mu(n)}{n} = 0 \ \ \ \ \ (3)

and

\displaystyle  \sum_{n=1}^\infty \frac{\mu(n)\log n}{n} = -1 \ \ \ \ \ (4)

in the sense of conditionally convergent series. Assuming one can justify this (which, ultimately, requires one to exclude zeroes of the Riemann zeta function on the line {\hbox{Re}(s)=1}, as discussed in this previous post), one is eventually left with the estimate {x + O(x)}, which is useless as a lower bound (and recovers only the classical Chebyshev estimate {\sum_{n \leq x} \Lambda(n) \ll x} as the upper bound). The inefficiency here when compared to the situation with the divisor function {\tau} can be attributed to the signed nature of the Möbius function {\mu(n)}, which causes some cancellation in the divisor sum expansion that needs to be compensated for with improved estimates.

However, there are a number of tricks available to reduce the level of divisor sums. The simplest comes from exploiting the change of variables {d \mapsto \frac{n}{d}}, which can in principle reduce the level by a square root. For instance, when computing the divisor function {\tau(n) = \sum_{d|n} 1}, one can observe using this change of variables that every divisor of {n} above {\sqrt{n}} is paired with one below {\sqrt{n}}, and so we have

\displaystyle  \tau(n) = 2 \sum_{d \leq \sqrt{n}: d|n} 1 \ \ \ \ \ (5)

except when {n} is a perfect square, in which case one must subtract one from the right-hand side. Using this reduced-level divisor sum representation, one can obtain an improvement to (2), namely

\displaystyle  \sum_{n \leq x} \tau(n) = x \log x + (2\gamma-1) x + O(\sqrt{x}).

This type of argument is also known as the Dirichlet hyperbola method. A variant of this argument can also deduce the prime number theorem from (3), (4) (and with some additional effort, one can even drop the use of (4)); this is discussed at this previous blog post.

Using this square root trick, one can now also control divisor sums such as

\displaystyle  \sum_{n \leq x} \tau(n^2+1).

(Note that {\tau(n^2+1)} has no multiplicativity properties in {n}, and so multiplicative number theory techniques cannot be directly applied here.) The level of the divisor sum here is initially of order {x^2}, which is too large to be useful; but using the square root trick, we can expand this expression as

\displaystyle  2 \sum_{n \leq x} \sum_{d \leq n: d | n^2+1} 1

which one can rewrite as

\displaystyle  2 \sum_{d \leq x} \sum_{d \leq n \leq x: n^2+1 = 0 \hbox{ mod } d} 1.

The constraint {n^2+1=0 \hbox{ mod } d} is periodic in {n} with period {d}, so we can write this as

\displaystyle  2 \sum_{d \leq x} ( \frac{x}{d} \rho(d) + O(\rho(d)) )

where {\rho(d)} is the number of solutions in {{\bf Z}/d{\bf Z}} to the equation {n^2+1 = 0 \hbox{ mod } d}, and so

\displaystyle  \sum_{n \leq x} \tau(n^2+1) = 2x \sum_{d \leq x} \frac{\rho(d)}{d} + O(\sum_{d \leq x} \rho(d)).

The function {\rho} is multiplicative, and can be easily computed at primes {p} and prime powers {p^j} using tools such as quadratic reciprocity and Hensel’s lemma. For instance, by Fermat’s two-square theorem, {\rho(p)} is equal to {2} for {p=1 \hbox{ mod } 4} and {0} for {p=3 \hbox{ mod } 4}. From this and standard multiplicative number theory methods (e.g. by obtaining asymptotics on the Dirichlet series {\sum_d \frac{\rho(d)}{d^s}}), one eventually obtains the asymptotic

\displaystyle  \sum_{d \leq x} \frac{\rho(d)}{d} = \frac{3}{2\pi} \log x + O(1)

and also

\displaystyle  \sum_{d \leq x} \rho(d) = O(x)

and thus

\displaystyle  \sum_{n \leq x} \tau(n^2+1) = \frac{3}{\pi} x \log x + O(x).

Similar arguments give asymptotics for {\tau} on other quadratic polynomials; see for instance this paper of Hooley and these papers by McKee. Note that the irreducibility of the polynomial will be important. If one considers instead a sum involving a reducible polynomial, such as {\sum_{n \leq x} \tau(n^2-1)}, then the analogous quantity {\rho(n)} becomes significantly larger, leading to a larger growth rate (of order {x \log^2 x} rather than {x\log x}) for the sum.

However, the square root trick is insufficient by itself to deal with higher order sums involving the divisor function, such as

\displaystyle \sum_{n \leq x} \tau(n^3+1);

the level here is initially of order {x^3}, and the square root trick only lowers this to about {x^{3/2}}, creating an error term that overwhelms the main term. And indeed, the asymptotic for such this sum has not yet been rigorously established (although if one heuristically drops error terms, one can arrive at a reasonable conjecture for this asymptotic), although some results are known if one averages over additional parameters (see e.g. this paper of Greaves, or this paper of Matthiesen).

Nevertheless, there is an ingenious argument of Erdös that allows one to obtain good upper and lower bounds for these sorts of sums, in particular establishing the asymptotic

\displaystyle  x \log x \ll \sum_{n \leq x} \tau(P(n)) \ll x \log x \ \ \ \ \ (6)

for any fixed irreducible non-constant polynomial {P} that maps {{\bf N}} to {{\bf N}} (with the implied constants depending of course on the choice of {P}). There is also the related moment bound

\displaystyle  \sum_{n \leq x} \tau^m(P(n)) \ll x \log^{O(1)} x \ \ \ \ \ (7)

for any fixed {P} (not necessarily irreducible) and any fixed {m \geq 1}, due to van der Corput; this bound is in fact used to dispose of some error terms in the proof of (6). These should be compared with what one can obtain from the divisor bound {\tau(n) \ll n^{O(1/\log \log n)}} and the trivial bound {\tau(n) \geq 1}, giving the bounds

\displaystyle  x \ll \sum_{n \leq x} \tau^m(P(n)) \ll x^{1 + O(\frac{1}{\log \log x})}

for any fixed {m \geq 1}.

The lower bound in (6) is easy, since one can simply lower the level in (5) to obtain the lower bound

\displaystyle  \tau(n) \geq \sum_{d \leq n^\theta: d|n} 1

for any {\theta>0}, and the preceding methods then easily allow one to obtain the lower bound by taking {\theta} small enough (more precisely, if {P} has degree {d}, one should take {\theta} equal to {1/d} or less). The upper bounds in (6) and (7) are more difficult. Ideally, if we could obtain upper bounds of the form

\displaystyle  \tau(n) \ll \sum_{d \leq n^\theta: d|n} 1 \ \ \ \ \ (8)

for any fixed {\theta > 0}, then the preceding methods would easily establish both results. Unfortunately, this bound can fail, as illustrated by the following example. Suppose that {n} is the product of {k} distinct primes {p_1 \ldots p_k}, each of which is close to {n^{1/k}}. Then {n} has {2^k} divisors, with {\binom{n}{j}} of them close to {n^{j/k}} for each {0 \ldots j \leq k}. One can think of (the logarithms of) these divisors as being distributed according to what is essentially a Bernoulli distribution, thus a randomly selected divisor of {n} has magnitude about {n^{j/k}}, where {j} is a random variable which has the same distribution as the number of heads in {k} independently tossed fair coins. By the law of large numbers, {j} should concentrate near {k/2} when {k} is large, which implies that the majority of the divisors of {n} will be close to {n^{1/2}}. Sending {k \rightarrow \infty}, one can show that the bound (8) fails whenever {\theta < 1/2}.

This however can be fixed in a number of ways. First of all, even when {\theta<1/2}, one can show weaker substitutes for (8). For instance, for any fixed {\theta > 0} and {m \geq 1} one can show a bound of the form

\displaystyle  \tau(n)^m \ll \sum_{d \leq n^\theta: d|n} \tau(d)^C \ \ \ \ \ (9)

for some {C} depending only on {m,\theta}. This nice elementary inequality (first observed by Landreau) already gives a quite short proof of van der Corput’s bound (7).

For Erdös’s upper bound (6), though, one cannot afford to lose these additional factors of {\tau(d)}, and one must argue more carefully. Here, the key observation is that the counterexample discussed earlier – when the natural number {n} is the product of a large number of fairly small primes – is quite atypical; most numbers have at least one large prime factor. For instance, the number of natural numbers less than {x} that contain a prime factor between {x^{1/2}} and {x} is equal to

\displaystyle  \sum_{x^{1/2} \leq p \leq x} (\frac{x}{p} + O(1)),

which, thanks to Mertens’ theorem

\displaystyle  \sum_{p \leq x} \frac{1}{p} = \log\log x + M+o(1)

for some absolute constant {M}, is comparable to {x}. In a similar spirit, one can show by similarly elementary means that the number of natural numbers {m} less than {x} that are {x^{1/m}}-smooth, in the sense that all prime factors are at most {x^{1/m}}, is only about {m^{-cm} x} or so. Because of this, one can hope that the bound (8), while not true in full generality, will still be true for most natural numbers {n}, with some slightly weaker substitute available (such as (7)) for the exceptional numbers {n}. This turns out to be the case by an elementary but careful argument.

The Erdös argument is quite robust; for instance, the more general inequality

\displaystyle  x \log^{2^m-1} x \ll \sum_{n \leq x} \tau(P(n))^m \ll x \log^{2^m-1} x

for fixed irreducible {P} and {m \geq 1}, which improves van der Corput’s inequality (8) was shown by Delmer using the same methods. (A slight error in the original paper of Erdös was also corrected in this latter paper.) In a forthcoming revision to my paper on the Erdös-Straus conjecture, Christian Elsholtz and I have also applied this method to obtain bounds such as

\displaystyle  \sum_{a \leq A} \sum_{b \leq B} \tau(a^2 b + 1) \ll AB \log(A+B),

which turn out to be enough to obtain the right asymptotics for the number of solutions to the equation {\frac{4}{p}= \frac{1}{x}+\frac{1}{y}+\frac{1}{z}}.

Below the fold I will provide some more details of the arguments of Landreau and of Erdös.

— 1. Landreau’s argument —

We now prove (9), and use this to show (7).

Suppose first that all prime factors of {n} have magnitude at most {n^{c/2}}. Then by a greedy algorithm, we can factorise {n} as the product {n = n_1 \ldots n_r} of numbers between {n^{c/2}} and {n^c}. In particular, the number {r} of terms in this factorisation is at most {2/c}. By the trivial inequality {\tau(ab) \leq \tau(a) \tau(b)} we have

\displaystyle  \tau(n) \leq \tau(n_1) \ldots \tau(n_r)

and thus by the pigeonhole principle one has

\displaystyle  \tau(n)^m \leq \tau(n_j)^{2m/c}

for some {j}. Since {n_j} is a factor of {n} that is at most {n^c}, the claim follows in this case (taking {C := 2m/c}).

Now we consider the general case, in which {n} may contain prime factors that exceed {n^c}. There are at most {1/c} such factors (counting multiplicity). Extracting these factors out first and then running the greedy algorithm again, we may factorise {n = n_1 \ldots n_r q} where the {n_i} are as before, and {q} is the product of at most {1/c} primes. In particular, {\tau(q) \leq 2^{1/c}} and thus

\displaystyle  \tau(n) \leq 2^{1/c} \tau(n_1) \ldots \tau(n_r).

One now argues as before (conceding a factor of {2^{1/c}}, which is acceptable) to obtain (9) in full generality. (Note that this illustrates a useful principle, which is that large prime factors of {n} are essentially harmless for the purposes of upper bounding {\tau(n)}.)

Now we prove (7). From (9) we have

\displaystyle  \tau(P(n))^m \ll \sum_{d \leq x: d|P(n)} \tau(d)^{O(1)}

for any {n \leq x}, and hence we can bound {\sum_{n \leq x} \tau(P(n))^m} by

\displaystyle  \ll \sum_{d \leq x} \tau(d)^{O(1)} \sum_{n \leq x: d|n; P(n) = 0 \hbox{ mod } d} 1.

The inner sum is {\frac{x}{d} \rho(d) + O(\rho(d)) = O( \frac{x}{d} \rho(d) )}, where {\rho(d)} is the number of roots of {P \hbox{ mod } d}. Now, for fixed {P}, it is easy to see that {\rho(p) = O(1)} for all primes {p}, and from Hensel’s lemma one soon extends this to {\rho(p^j)=O(1)} for all prime powers {p}. (This is easy when {p} does not divide the discriminant {\Delta(P)} of {p}, as the zeroes of {P \hbox{ mod } p} are then simple. There are only finitely many primes that do divide the discriminant, and they can each be handled separately by Hensel’s lemma and an induction on the degree of {P}.) Meanwhile, from the Chinese remainder theorem, {\rho} is multiplicative. From this we obtain the crude bound {\rho(d) \ll \tau(d)^{O(1)}}, and so we obtain a bound

\displaystyle  \sum_{n \leq x} \tau(P(n))^m \ll x \sum_{d \leq x} \frac{\tau(d)^{O(1)}}{d}.

This sum can easily be bounded by {x \log^{O(1)}x} by multiplicative number theory techniques, e.g. by first computing the Dirichlet series

\displaystyle  \sum_{d=1}^\infty \frac{\tau(d)^{O(1)}}{d^{1+\frac{1}{\log x}}}

via the Euler product. This proves (7).

— 2. Erdös’ argument —

Now we prove (6). We focus on the upper bound, as the proof of the lower bound has already been sketched.

We first make a convenient observation: from (7) (with {m=2}) and the Cauchy-Schwarz inequality, we see that we have

\displaystyle  \sum_{n \in E} \tau(P(n)) \ll x \log x

whenever {E} is a subset of the natural numbers less than {x} of cardinality {O( x \log^{-C} x )} for some sufficiently large {C}. Thus we have the freedom to restrict attention to “generic” {n}, where by “generic” we mean “lying outside of an exceptional set of cardinality {O(x \log^{-C} x)} for the {C} specified above”.

Let us now look at the behaviour of {P(n)} for generic {n}. We first control the total number of prime factors:

Lemma 1 For generic {n \leq x}, {P(n)} has {O( \log \log x )} distinct prime factors.

This result is consistent with the Hardy-Ramanujan and Erdös-Kac theorems, though it does not quite follow from these results (because {P(n)} lives in quite a sparse set of natural numbers).

Proof: If {P(n)} has more than {A \log_2 \log x} prime factors for some {A}, then {P(n)} has at least {\log^A x} divisors, thus {\tau(P(n)) \geq \log^A X}. The claim then follows from (7) (with {m=1}) and Markov’s inequality, taking {A} large enough. \Box

Next, we try to prevent repeated prime factors:

Lemma 2 For generic {n \leq x}, the prime factors of {P(n)} between {\log^{C} x} and {x^{1/2}} are all distinct.

Proof: If {p} is a prime between {\log^{C} x} and {x^{1/2}}, then the total number of {n \leq x} for which {p^2} divides {P(n)} is

\displaystyle \rho(p^2) \frac{x}{p^2} + O( \rho(p^2) ) = O( \frac{x}{p^2} ),

so the total number of {x} that fail the above property is

\displaystyle  \ll \sum_{\log^C x \leq p \leq x^{1/2}} \frac{x}{p^2} \ll \frac{x}{\log^C x}

which is acceptable. \Box

It is difficult to increase the upper bound here beyond {x^{1/2}}, but fortunately we will not need to go above this bound. The lower bound cannot be significantly reduced; for instance, it is quite likely that {P(n)} will be divisible by {2^2} for a positive fraction of {n}. But we have the following substitute:

Lemma 3 For generic {n \leq x}, there are no prime powers {p^j} dividing {P(n)} with {p < x^{1/(\log \log x)^2}} and {p^j \geq x^{1/(\log \log x)^2}}.

Proof: By the preceding lemma, we can restrict attention to primes {p} with {p < \log^C x}. For each such {p}, let {p^j} be the first power of {p} exceeding {x^{1/(\log \log x)^2}}. Arguing as before, the total number of {n \leq x} for which {p^j} divides {P(n)} is

\displaystyle  \ll \frac{x}{p^j} \ll \frac{x}{x^{1/(\log\log x)^2}};

on the other hand, there are at most {\log^C x} primes {p} to consider. The claim then follows from the union bound. \Box

We now have enough information on the prime factorisation of {P(n)} to proceed. We arrange the prime factors of {P(n)} in increasing order (allowing repetitions):

\displaystyle  P(n) = p_1 \ldots p_J.

Let {0 \leq j \leq J} be the largest integer for which {p_1 \ldots p_j \leq x}. Suppose first that {J=j+O(1)}, then as in the previous section we would have

\displaystyle  \tau(P(n)) \ll \tau(p_1 \ldots p_j) \leq \sum_{d \leq x: d | P(n)} 1

which is an estimate of the form (8), and thus presumably advantageous.

Now suppose that {J} is much larger than {j}. Since {P(n) = O(x^{O(1)})}, this implies in particular that {p_{j+1} \leq x^{1/2}} (say), which forces

\displaystyle  x^{1/2} \leq p_1 \ldots p_j \leq x \ \ \ \ \ (10)

and {p_j \leq x^{1/2}}.

For generic {n}, we have at most {O(\log \log x)} distinct prime factors, and each such distinct prime less than {x^{1/(\log \log x)^2}} contributes at most {x^{1/(\log \log x)^2}} to the product {p_1 \ldots p_j}. We conclude that generically, at least one of these primes {p_1,\ldots,p_j} must exceed {x^{1/(\log \log x)^2}}, thus we generically have

\displaystyle  x^{1/(\log \log x)^2} \leq p_j \leq x^{1/2}.

In particular, we have

\displaystyle  x^{1/(r+1)} \leq p_j \leq x^{1/r}

for some {2 \leq r \leq (\log \log x)^2}. This makes the quantity {p_1 \ldots p_j} {x^{1/r}}-smooth, i.e. all the prime factors are at most {x^{1/r}}. On the other hand, the remaining prime factors {p_{j+1}, \ldots, p_J} are at least {x^{1/(r+1)}}, and {P(n) = O(x^{O(1)})}, so we have {J = j + O(r)}. Thus we can write {P(n)} as the product of {p_1 \ldots p_j} and at most {O(r)} additional primes, which implies that

\displaystyle  \tau(P(n)) \ll \exp(O(r)) \tau(p_1 \ldots p_j)

\displaystyle  = \exp(O(r)) \sum_{d: d | p_1 \ldots p_j} 1.

The exponential factor looks bad, but we can offset it by the {x^{1/r}}-smooth nature of {p_1 \ldots p_j}, which is inherited by its factors {d}. From (10), {d} is at most {x}; by using the square root trick, we can restrict {d} to be at least the square root of {p_1 \ldots p_j}, and thus to be at least {x^{1/4}}. Also, {d} divides {P(n)}, and as such inherits many of the prime factorisation properties of {P(n)}; in particular, {O(\log\log x)} distinct prime factors, and {d} has no prime powers {p^j} dividing {d} with {p < x^{1/(\log \log x)^2}} and {p^j \geq x^{1/(\log \log x)^2}}.

To summarise, we have shown the following variant of (8):

Lemma 4 (Lowering the level) For generic {n \leq x}, we

\displaystyle  \tau(P(n)) \ll \exp(O(r)) \sum_{d \in S_r: d | P(n)} 1

for some {1 \leq r \leq (\log \log x)^2}, where {S_r} is the set of all {x^{1/r}}-smooth numbers {d} between {x^{1/4}} and {x} with {O(\log\log x)} distinct prime factors, and such that there are no prime powers {p^j} dividing {d} with {p < x^{1/(\log \log x)^2}} and {p^j \geq x^{1/(\log \log x)^2}}.

Applying this lemma (and discarding the non-generic {n}), we can thus upper bound {\sum_{n \leq x} \tau(P(n))} (up to acceptable errors) by

\displaystyle  \ll \sum_{1 \leq r \leq (\log \log x)^2} \exp(O(r)) \sum_{n \leq x} \sum_{d \in S_r: d | P(n)} 1.

The level is now less than {x} and we can use the usual methods to estimate the inner sums:

\displaystyle  \sum_{n \leq x} \sum_{d \in S_r: d | P(n)} 1 \ll x \sum_{d \in S_r} \frac{\rho(d)}{d}.

Thus it suffices to show that

\displaystyle  \sum_{1 \leq r \leq (\log \log x)^2} \exp(O(r)) \sum_{d \in S_r} \frac{\rho(d)}{d} \ll \log x. \ \ \ \ \ (11)

It is at this point that we need some algebraic number theory, and specifically the Landau prime ideal theorem, via the following lemma:

Proposition 5 We have

\displaystyle  \sum_{d \leq x} \frac{\rho(d)}{d} \ll \log x. \ \ \ \ \ (12)

Proof: Let {k} be the number field formed by extending the rationals by adjoining a root {\alpha} of the irreducible polynomial {P}. The Landau prime ideal theorem (the generalisation of the prime number theorem to such fields) then tells us (among other things) that the number of prime ideals in {k} of norm less than {x} is {x/\log x + O( x/\log^2 x)}. Note that if {p} is a prime with a simple root {P(n)=0 \hbox{ mod } p} in {{\bf Z}/p{\bf Z}}, then one can associate a prime ideal in {k} of norm {p} defined as {(p,\alpha-n)}. As long as {p} does not divide the discriminant, one has {\rho(p)} simple roots; but there are only {O(1)} primes that divide the discriminant. From this we see that

\displaystyle  \sum_{p \leq x} \rho(p) \leq \frac{x}{\log x} + O( \frac{x}{\log^2 x} ).

(One can complement this upper bound with a lower bound, since the ideals whose norms are a power of a (rational) prime rather than a prime have only a negligible contribution to the ideal count, but we will not need the lower bound here). By summation by parts we conclude

\displaystyle  \sum_{p \leq x} \frac{\rho(p)}{p} \leq \log\log x + O(1)

and (12) follows by standard multiplicative number theory methods (e.g. bounding {\sum_{d \leq x} \frac{\rho(d)}{d^{1+1/\log x}}} by computing the Euler product, noting that {\rho(p^j) = \rho(p)} whenever {p} does not divide the discriminant of {P}, thanks to Hensel’s lemma). \Box

This proposition already deals with the bounded {r} case. For large {r} we need the following variant:

Proposition 6 For any {2 \leq r \leq (\log \log x)^2}, one has

\displaystyle  \sum_{d \in S_r} \frac{\rho(d)}{d} \ll r^{-cr} \log x

for some absolute constant {c>0}.

The bound (11) then follows as a corollary of this proposition. In fact, one expects the {x^{1/r}}-smoothness in the definition of {S_r} to induce a gain of about {\frac{1}{r!}}; see this survey of Granville for extensive discussion of this and related topics.

Proof: If {d \in S_r}, then we can write {d = p_1 \ldots p_j} for some primes {p_1,\ldots,p_j \leq x^{1/r}}. As noted previously, the primes in this product that are less than {x^{1/(\log\log x)^2}} each contribute at most {x^{1/(\log\log x)^2}} to this product, and there are at most {O(\log\log x)} of these primes, so their total contribution is at most {x^{O(1/\log\log x)}}. Since {d \geq x^{1/2}}, we conclude that the primes that are greater than {x^{1/(\log\log x)^2}} in the factorisation of {d} must multiply to at least {x^{1/4}} (say). By definition of {S_r}, these primes are distinct. By the pigeonhole principle, we can then find {t \geq 1} such that there are distinct primes {q_1,\ldots,q_m} between {x^{1/2^{t+1} r}} and {x^{1/2^tr}} which appear in the prime factorisation of {d}, where {m := \lfloor \frac{rt}{100}\rfloor} (say); by definition of {S_r}, all these primes are distinct and can thus be ordered as {q_1 < \ldots < q_m}, and we can write {d = q_1 \ldots q_m u} for some {u \leq x}. As the {\rho(q_j)} are bounded, we have

\displaystyle  \rho(d) \ll O(1)^m \rho(u) \ll O(1)^{rt} \rho(u)

and so we can upper bound {\sum_{d \in S_r} \frac{\rho(d)}{d}} by

\displaystyle  \sum_{t \ll (\log \log x)^2} O(1)^{rt} \sum_{x^{1/2^{t+1} r} \leq q_1 < \ldots < q_m \leq x^{1/2^t r}} \frac{1}{q_1 \ldots q_m} \sum_{u<x} \rho(u).

Using (12) and symmetry we can bound this by

\displaystyle  \sum_{t \ll (\log \log x)^2} O(1)^{rt} \frac{1}{m!} (\sum_{x^{1/2^{t+1} r} \leq q \leq x^{1/2^t r}} \frac{1}{q})^m \log x.

By the prime number theorem (or Mertens’ theorem) we have

\displaystyle  \sum_{x^{1/2^{t+1} r} \leq q \leq x^{1/2^t r}} \frac{1}{q} \ll 1.

Inserting this bound and summing the series using Stirling’s formula, one obtains the claim. \Box