Open Access

Triangles with prime hypotenuse

Research in Number Theory20173:21

Received: 3 April 2017

Accepted: 27 June 2017

Published: 9 October 2017


The sequence \(3, 5, 9, 11, 15, 19, 21, 25, 29, 35,\ldots \) consists of odd legs in right triangles with integer side lengths and prime hypotenuse. We show that the upper density of this sequence is zero, with logarithmic decay. The same estimate holds for the sequence of even legs in such triangles. We expect our upper bound, which involves the Erdős–Ford–Tenenbaum constant, to be sharp up to a double-logarithmic factor. We also provide a nontrivial lower bound. Our techniques involve sieve methods, the distribution of Gaussian primes in narrow sectors, and the Hardy–Ramanujan inequality.


Gaussian primes Pythagorean triples

Mathematics Subject Classification

Primary 11N25 Secondary 11N05 11N36

1 Background

The sequence OEIS A281505 concerns odd legs in right triangles with integer side lengths and prime hypotenuse. By the parametrisation of Pythagorean triples, these are positive integers of the form \(x^2 - y^2\), where \(x,y \in \mathbb N\) and \(x^2 + y^2\) is prime. Even legs are those of the form 2xy, where \(x, y \in \mathbb N\) and \(x^2 + y^2\) is an odd prime. Let \(\mathcal A\) be the set of odd legs, and \(\mathcal B\) the set of even legs that occur in such triangles. Consider the quantities
$$\begin{aligned} \mathcal A(N) = \left\{ n \in \mathcal A: n \leqslant N \right\} , \qquad \mathcal B(N) = \left\{ n \in \mathcal B: n \leqslant N \right\} \end{aligned}$$
as \(N \rightarrow \infty \).
Let \(\mathcal P\) denote the set of primes. By a change of variables, observe that
$$\begin{aligned} \mathcal A(N) = \# \left\{ ab \leqslant N: \frac{1}{2} (a^2+b^2) \in \mathcal P\right\} . \end{aligned}$$
Additionally, note that
$$\begin{aligned} \mathcal B(2N) = \mathcal C(N), \end{aligned}$$
$$\begin{aligned} \mathcal C(N) = \# \left\{ 1< ab \leqslant N: a^2+b^2 \in \mathcal P\right\} . \end{aligned}$$
We estimate \(\mathcal C(N)\), which is equivalent to estimating \(\mathcal B(N)\) and similar to estimating \(\mathcal A(N)\).
$$\begin{aligned} \eta = 1 - \frac{1 + \log \log 2}{\log 2} \approx 0.086 \end{aligned}$$
be the Erdős–Ford–Tenenbaum constant. This constant is related to the number of distinct products in the multiplication table, and also arises in other contexts, for example, see [3, 4, 11, 12].

Theorem 1.1

We have
$$\begin{aligned} \mathcal C(N) \leqslant \frac{N}{(\log N)^\eta } (\log \log N)^{O(1)}. \end{aligned}$$

Since every prime \(p\equiv 1\pmod 4\) is representable as \(a^2+b^2\) with ab integral, we have \(\mathcal C(N)\) unbounded. In fact, using the maximal order of the divisor function, we have \(\mathcal C(N) \geqslant N^{1-o(1)}\) as \(N\rightarrow \infty \). We obtain a strengthening of this lower bound.

Theorem 1.2

We have, as \(N\rightarrow \infty \),
$$\begin{aligned} \mathcal C(N) \geqslant \frac{N}{(\log N)^{\log 4-1+o(1)}}. \end{aligned}$$

Note that \(\log 4-1\approx 0.386\). Since \(\mathcal B(2N) = \mathcal C(N)\), we obtain the same bounds for \(\mathcal B(N)\). By essentially the same proofs, one can also deduce these bounds for \(\mathcal A(N)\).

To motivate the outcome, consider the following heuristic. There are typically \(\approx (\log n)^{\log 2}\) divisors of n, which follows from the normal number of prime factors of n, a result of Hardy and Ramanujan [8]. Moreover, given a factorisation \(n=ab\), the “probability” of \(a^2+b^2\) being prime is roughly \((\log n)^{-1}\). Since \(\log 2 < 1\), we expect the proportion to decay logarithmically. In the presence of biases and competing heuristics, this prima facie prediction should be taken with a few grains of salt. We use Brun’s sieve and the Hardy–Ramanujan inequality to formally establish our bounds. In addition, for Theorem 1.2 we use a result of Harman and Lewis [9] on the distribution of Gaussian primes in narrow sectors of the complex plane.

We write for the set of primes. We use Vinogradov and Bachmann–Landau notation. As usual, we write for the number of distinct prime divisors of n, and for the number of prime divisors of n counted with multiplicity. The symbols p and \(\ell \) are reserved for primes, and N denotes a large positive real number.

2 An upper bound

In this section, we establish Theorem 1.1. The Hardy–Ramanujan inequality [8] states that there exists a positive constant \(c_0\) such that uniformly for \(i \in \mathbb N\) and \(N\geqslant 3\) we have
$$\begin{aligned} \# \left\{ n \leqslant N: \omega (n) = i \right\} \ll \frac{N}{\log N} \frac{(\log \log N + c_0)^{i-1}}{(i-1)!}. \end{aligned}$$
By Mertens’s theorem and the fact that the sum of the reciprocals of prime powers higher than the first power converges, there is a positive constant \(c_1\) such that
$$\begin{aligned} \sum _{p^\nu \leqslant N}p^{-\nu }\leqslant \log \log N+c_1 \qquad (N \geqslant 3). \end{aligned}$$
Let \({\alpha }\) be a parameter in the range \(1< {\alpha }< 2\), to be specified in due course. We begin by bounding the size of the exceptional set
$$\begin{aligned} \mathcal E_1 := \{ n \leqslant N: \omega (n) > L \}, \end{aligned}$$
$$\begin{aligned} L = \lfloor {\alpha }\log \log N \rfloor . \end{aligned}$$
By the Hardy–Ramanujan inequality, we have
$$\begin{aligned} \# \mathcal E_1 \ll \frac{N}{\log N} \sum _{i > L} \frac{(k+c_0)^{i-1}}{(i-1)!}= \frac{N}{\log N}\sum _{j\geqslant L}\frac{(k+c_0)^j}{j!}, \end{aligned}$$
where \(k= \log \log N\), and therefore
$$\begin{aligned} \frac{\log N}{N} \# \mathcal E_1 \ll \frac{(k+c_0)^{L}}{L!} <\left( \frac{(k+c_0)e}{L}\right) ^L=\left( \frac{e}{{\alpha }}+O\left( \frac{1}{k}\right) \right) ^L. \end{aligned}$$
Note that we have used here the elementary inequality \(1/L!<(e/L)^L\), which holds for all positive integers L and follows instantly from the Taylor series for \(e^L\). Thus,
$$\begin{aligned} \# \mathcal E_1 \ll \frac{N }{(\log N)^{1-{\alpha }+ {\alpha }\log {\alpha }}}. \end{aligned}$$
For an integer \(n\geqslant 2\), write \(P^+(n)\) for the largest prime factor of n, and let \(P^+(1)=1\). By de Bruijn [1, Eq. (1.6)] we may bound the size of the exceptional set
$$\begin{aligned} \mathcal E_2 := \left\{ n \leqslant N: P^+(n) \leqslant N^{1/\log \log N}\right\} \end{aligned}$$
by \(N/(\log N)^2\) for all sufficiently large numbers N. (Actually, the denominator may be taken as any fixed power of \(\log N\)).
Next, we estimate
$$\begin{aligned} \mathcal C^*(N):= \# \left\{ ab \leqslant N: ab \notin (\mathcal E_1 \cup \mathcal E_2),~ a^2+b^2 \in \mathcal P\right\} . \end{aligned}$$
For n counted by \(\mathcal C^*(N)\), we see by symmetry that we have \(n = ab_0 \ell \) for some \(a,b_0, \ell \in \mathbb N\) with \(\ell > N^{1/\log \log N}\) prime and \(a^2 + b_0^2 \ell ^2\) prime. Thus
$$\begin{aligned} \mathcal C^*(N) \leqslant 2 \sum _{\begin{array}{c} {ab_0 \leqslant N^{1- 1/\log \log N} }\\ \omega (ab_0) \leqslant L \end{array}} S(a, b_0), \end{aligned}$$
$$\begin{aligned} S(a,b_0) = \sum _{\begin{array}{c} N^{1/\log \log N} < \ell \leqslant \frac{N}{ab_0} \\ \ell ,\;a^2 + b_0^2 \ell ^2 \in \mathcal P \end{array}}1. \end{aligned}$$
We turn our attention to \(S(a,b_0)\). We may assume that \(ab_0\) is even and \(\gcd (a,b_0) = 1\), for otherwise \(S(a,b_0)= 0\). Observe that
$$\begin{aligned} S(a, b_0) \leqslant \# \left\{ m \in (z,X]: \gcd (m(a^2+b_0^2 m^2), P(z)) = 1 \right\} , \end{aligned}$$
$$\begin{aligned} z = N^{(\log \log N)^{-3}}, \quad P(z) = \prod _{p < z} p, \quad X = \frac{N}{ab_0}. \end{aligned}$$
To bound this from above, we apply Brun’s sieve [6, Corollary 6.2] with
$$\begin{aligned} \mathcal A= \Bigl \{ m(a^2+b_0^2 m^2): 1 \leqslant m \leqslant X \Bigr \} \end{aligned}$$
and with the completely multiplicative density function g defined by
$$\begin{aligned} g(p) = {\left\{ \begin{array}{ll} 1/p, &{} \text {if } p \mid ab_0 \text { or } p \not \equiv 1 {\,\,{\mathrm{mod}}\,\,4}\\ 3/p, &{} \text {if } p \not \mid a b_0, ~p \equiv 1 {\,\,{\mathrm{mod}}\,\,4}. \end{array}\right. } \end{aligned}$$
For this to be valid, we need to check that
$$\begin{aligned} |r_d(\mathcal A)| \leqslant g(d) d \quad (d \mid P(z)), \end{aligned}$$
$$\begin{aligned} r_d(\mathcal A) = |\mathcal A_d| - Xg(d), \quad \mathcal A_d = \{ n \in \mathcal A: n \equiv 0 {\,\,{\mathrm{mod}}\,\,d} \}. \end{aligned}$$
We begin by noting that if \(p \in \mathcal P\) then the congruence
$$\begin{aligned} m (a^2 + b_0^2 m^2) \equiv 0 {\,\,{\mathrm{mod}}\,\,p} \end{aligned}$$
has g(p)p solutions \(m {\,\,{\mathrm{mod}}\,\,p}\). Observe that any divisor d of P(z) must be squarefree; thus, by the Chinese remainder theorem, the congruence
$$\begin{aligned} m (a^2 + b_0^2 m^2) \equiv 0 {\,\,{\mathrm{mod}}\,\,d} \end{aligned}$$
has g(d)d solutions \(m {\,\,{\mathrm{mod}}\,\,d}\). By periodicity, we now have
$$\begin{aligned} r_d(\mathcal A) = \# \{ m \leqslant M: m(a^2 + b_0^2 m^2) \equiv 0 {\,\,{\mathrm{mod}}\,\,d} \} - Mg(d), \end{aligned}$$
where \(M = X - d \lfloor X/d \rfloor \). This confirms (2.5), since \(0 \leqslant M < d\) and \(0 < g(d) \leqslant 1\).
We also need to check that
$$\begin{aligned} \log z \leqslant \frac{\log X}{c \log ( V(z)^{-1} \log X)}, \end{aligned}$$
where \(V(z) = \prod _{p < z} (1- g(p))\), and where
$$\begin{aligned} (c/e)^c = e, \qquad c \approx 3.59. \end{aligned}$$
This follows from the inequalities
$$\begin{aligned} X \geqslant N^{1/\log \log N}, \quad V(z) \gg (\log z)^{-2}. \end{aligned}$$
Now [6, Corollary 6.2] tells us that
$$\begin{aligned} S(a,b_0) \leqslant X^{3/4} + 2XV(z) \leqslant \frac{N(\log \log N)^{O(1)}}{(\log N)^2 ab_0}. \end{aligned}$$

Remark 2.1

Note that we might equally well have used the version of Brun’s sieve from [7, p. 68], which is less precise, but somewhat easier to utilise. In fact, as kindly suggested by one of the referees, one could accomplish the same result using Brun’s pure sieve [6, Eq. (6.1)], which is nothing more than a strategic truncation of the inclusion-exclusion principle.

Substituting this into (2.4) yields
$$\begin{aligned} \mathcal C^*(N) \leqslant \frac{N(\log \log N)^{O(1)}}{(\log N)^2} I, \end{aligned}$$
$$\begin{aligned} I = \sum _{j+k \leqslant L} \sum _{\begin{array}{c} a \leqslant N \\ \omega (a)=j \end{array}} a^{-1} \sum _{\begin{array}{c} b_0 \leqslant N \\ \omega (b_0)=k \end{array}} b_0^{-1}. \end{aligned}$$
It follows from the multinomial theorem that
$$\begin{aligned} I&\leqslant \sum _{j+k \leqslant L} j!^{-1} \Bigl (\sum _{p^v \leqslant N} p^{-v}\Bigr )^j k!^{-1} \Bigl (\sum _{p^v \leqslant N} p^{-v}\Bigr )^k \\&= \sum _{j+k \leqslant L} (j+k)!^{-1} {j+k \atopwithdelims ()j} \Bigl ( \sum _{p^v \leqslant N} p^{-v} \Bigr )^{j+k}. \end{aligned}$$
Letting \(m=j+k\), the binomial theorem now gives
$$\begin{aligned} I \leqslant \sum _{m \leqslant L} m!^{-1} \Bigl ( 2 \sum _{p^v \leqslant N} p^{-v} \Bigr )^m \leqslant \sum _{m \leqslant L} \frac{(2 \log \log N + 2c_1)^m}{m!}, \end{aligned}$$
where \(c_1\) is as in (2.1). In view of (2.2), we now have
$$\begin{aligned} I&\ll L!^{-1} (2 \log \log N + 2c_1)^L<\left( \frac{2e\log \log N+2ec_1}{L}\right) ^L\\&=\left( \frac{2e}{{\alpha }}+O\left( \frac{1}{L}\right) \right) ^L\ll (\log N)^{{\alpha }(1+\log 2- \log {\alpha })}. \end{aligned}$$
Substituting this into (2.6) yields
$$\begin{aligned} \mathcal C^*(N) \leqslant N(\log \log N)^{O(1)} (\log N)^{{\alpha }(1+\log 2 - \log {\alpha }) - 2}. \end{aligned}$$
By (2.3), our estimate for \(\#\mathcal E_2\), and (2.7), we have
$$\begin{aligned} \mathcal C(N) \leqslant \mathcal C^*(N) + \# \mathcal E_1 + \# \mathcal E_2 \leqslant N (\log \log N)^{O(1)} (\log N)^{-\mathcal M}, \end{aligned}$$
$$\begin{aligned} \mathcal M= \min \left\{ 1 - {\alpha }+ {\alpha }\log {\alpha }, ~ 2 ,~ 2 - {\alpha }- {\alpha }\log 2 + {\alpha }\log {\alpha }\right\} . \end{aligned}$$
We now choose \(1< {\alpha }< 2\) so as to maximise \(\mathcal M\). One might guess that this \({\alpha }\) solves
$$\begin{aligned} 1- {\alpha }+ {\alpha }\log {\alpha }= 2 - {\alpha }- {\alpha }\log 2 + {\alpha }\log {\alpha }, \end{aligned}$$
and indeed \({\alpha }= (\log 2)^{-1}\) does maximise \(\mathcal M\) on the interval (1, 2). With this choice of \({\alpha }\), we have
$$\begin{aligned} \mathcal M= 1 - \frac{1 + \log \log 2}{\log 2} = \eta , \end{aligned}$$
completing the proof of Theorem 1.1.

3 A lower bound

In this section, we establish Theorem 1.2. Let
$$\begin{aligned} \mathcal L_0 = \left\{ (a,b) \in \mathbb N^2:1< ab \leqslant N,~ a^2 + b^2 \in \mathcal P\right\} . \end{aligned}$$
Writing \(P^+(n)\) for the largest prime factor of \(n>1\), and \(P^+(1) = 1\), put
$$\begin{aligned} \mathcal L_1 = \left\{ (a,b) \in \mathcal L_0: P^+(ab) \leqslant N^{1/\log \log N} \right\} . \end{aligned}$$
Let \(\varepsilon \) be a small positive real number, and let
$$\begin{aligned} \mathcal L_2&= \left\{ (a,b) \in \mathcal L_0 {\setminus } \mathcal L_1: \omega (a)> (1+\varepsilon ) \log \log N \right\} , \\ \mathcal L_3&= \left\{ (a,b) \in \mathcal L_0 {\setminus } \mathcal L_1: \omega (b) > (1+\varepsilon ) \log \log N \right\} . \end{aligned}$$
Finally, write
$$\begin{aligned} \mathcal L= \mathcal L_0 {\setminus } (\mathcal L_1 \cup \mathcal L_2 \cup \mathcal L_3). \end{aligned}$$
As we seek a lower bound, we are free to discard some inconvenient elements of \(\mathcal C(N)\). Thus, by the Cauchy–Schwarz inequality, we have
$$\begin{aligned} \mathcal C(N) \geqslant (\#\mathcal L)^2 / \mathcal S(N), \end{aligned}$$
where \(\mathcal S(N)\) is the number of quadruples \((a,b,c,d) \in \mathbb N^4\) such that
$$\begin{aligned} ab=cd\hbox { and }(a,b),(c,d)\in \mathcal L. \end{aligned}$$
We first show that
$$\begin{aligned} \# \mathcal L_0 \gg N. \end{aligned}$$
For this, we use existing work counting Gaussian primes in narrow sectors. For convenience, we state the relevant result [9, Theorem 2].

Theorem 3.1

(Harman–Lewis) Let X be a large positive real number, and let \({\beta }, {\gamma }\) be real numbers in the ranges
$$\begin{aligned} 0 \leqslant {\beta }\leqslant \pi /2, \qquad X^{-0.381} \leqslant {\gamma }\leqslant \pi /2. \end{aligned}$$
$$\begin{aligned} \# \left\{ (a,b) \in \mathbb N^2: a^2 + b^2 \in \mathcal P\cap [0,X],\quad \arctan (b/a) \in [\beta , \beta + {\gamma }) \right\} \gg \frac{{\gamma }X}{\log X}. \end{aligned}$$
The implied constant is absolute.

Remark 3.2

The problem of counting Gaussian primes in narrow sectors has received quite some attention over the years, and still it is far from resolved. Rather than using Theorem 3.1 by Harman and Lewis [9], we could have used a weaker result by Kubilius [10] from the 1950s. We refer the interested reader to the introduction of [2] for more about the earlier history of this problem.

For positive integers \(i \leqslant \frac{ \log N}{10 \log 2}\), we apply this with
$$\begin{aligned} {\beta }= {\gamma }= \frac{\pi }{2^{i+1}}, \qquad X = 2^{i-2}N. \end{aligned}$$
By Jordan’s inequality
$$\begin{aligned} \frac{2}{\pi }x \leqslant \sin x \leqslant x \qquad (0 \leqslant x \leqslant \pi /2), \end{aligned}$$
observe that if \(a,b \in \mathbb N\), \(a^2 + b^2 \leqslant X\) and \({\theta }= \arctan (b/a) \leqslant \pi 2^{-i}\) then
$$\begin{aligned} ab \leqslant X \sin {\theta }\cos {\theta }= \frac{1}{2} X \sin (2 {\theta }) \leqslant X {\theta }\leqslant N2^{i-2} \cdot \frac{\pi }{2^i} \leqslant N. \end{aligned}$$
$$\begin{aligned} \# \mathcal L_0 \gg \sum _{i \leqslant \frac{\log N}{10 \log 2}} \frac{N}{\log N} \gg N, \end{aligned}$$
confirming (3.2).

Next, we show that \(\# \mathcal L_j = o(N)\) (\(j=1,2,3\)).

Lemma 3.3

We have \(\# \mathcal L_1 = o(N)\).


By de Bruijn [1, Eq. (1.6)], we have
$$\begin{aligned} \sum _{a \leqslant \sqrt{N}} \sum _{\begin{array}{c} b \leqslant N/a \\ P^+(b) \leqslant N^{1/\log \log N} \end{array}} \ll \sum _{a \leqslant \sqrt{N}} \frac{N}{a (\log N)^2} \ll \frac{N}{\log N}. \end{aligned}$$
Thus, by symmetry, we have \(\# \mathcal L_1 \ll \frac{N}{\log N}\). \(\square \)

Lemma 3.4

We have
$$\begin{aligned} \# \mathcal L_j = o(N) \qquad (j = 2,3). \end{aligned}$$


As \(\# \mathcal L_2 = \# \mathcal L_3\), we need only show this for \(j=2\). Taking out a prime factor \(\ell > N^{1/\log \log N}\) of ab, we have
$$\begin{aligned} \# \mathcal L_2 \leqslant 2\sum _{\begin{array}{c} a \leqslant N^{1-1/\log \log N} \\ \omega (a) > (1+\varepsilon ) \log \log N \end{array} } \sum _{b \leqslant a^{-1} N^{1- 1/\log \log N}} S_{a,b}, \end{aligned}$$
$$\begin{aligned} S_{a,b} = \sum _{\begin{array}{c} N^{1/\log \log N} < \ell \leqslant \frac{N}{ab} \\ \ell ,\,a^2 + b_0^2 \ell ^2 \in \mathcal P \end{array}}1. \end{aligned}$$
As in the previous section, Brun’s sieve implies that
$$\begin{aligned} S_{a,b} \ll \frac{N(\log \log N)^{O(1)}}{ab (\log N)^2}. \end{aligned}$$
$$\begin{aligned} \# \mathcal L_2 \ll \frac{N(\log \log N)^{O(1)}}{\log N} \sum _{\begin{array}{c} a \leqslant N^{1-1/\log \log N}\\ \omega (a) \geqslant T \end{array} }a^{-1}, \end{aligned}$$
$$\begin{aligned} T = \lfloor (1+\varepsilon ) \log \log N \rfloor . \end{aligned}$$
As in the prior section, the multinomial theorem implies that
$$\begin{aligned} \sum _{\begin{array}{c} a\leqslant N^{1-1/\log \log N}\\ \omega (a)\geqslant T \end{array}}\frac{1}{a}&\leqslant \sum _{j\geqslant T}\frac{1}{j!}\left( \log \log N+c_1\right) ^j \ll _\varepsilon \frac{1}{T!}(\log \log N+c_1)^T\\&\leqslant \left( \frac{e\log \log N+ec_1}{T}\right) ^T\ll (\log N)^{(1+\varepsilon )(1-\log (1+\varepsilon ))}. \end{aligned}$$
Since \((1+\varepsilon )(1-\log (1+\varepsilon ))<1\), using this estimate in (3.3) completes the proof of the lemma. \(\square \)
Combining (3.2) with Lemmas 3.3 and 3.4 gives
$$\begin{aligned} \# \mathcal L\gg N. \end{aligned}$$

Lemma 3.5

If \(c' > \log 4 -1\) then
$$\begin{aligned} \mathcal S(N) \ll _{c'} N (\log N)^{c'}. \end{aligned}$$


One component of the count is when \((a,b)=(c,d)\). This is the diagonal case, and it is easily estimated. By the sieve, the number of pairs \((a,b)\in \mathcal L\) with \(a\leqslant b\) is at most
$$\begin{aligned} \sum _{a\leqslant \sqrt{N}}\sum _{b\leqslant N^{1-1/\log \log N}/a}\sum _{\begin{array}{c} \ell \leqslant N/ab\\ \ell \in \mathcal P\\ a^2+\ell ^2b^2\in \mathcal P \end{array}}1 \leqslant \frac{N(\log \log N)^{O(1)}}{(\log N)^2}\sum _{a,b}\frac{1}{ab}\leqslant N(\log \log N)^{O(1)}, \end{aligned}$$
which is negligible (note that this estimate shows that (3.5) is essentially tight).
For the nondiagonal case we imitate Sect. 2. If (abcd) is counted by \(\mathcal S(N)\), put
$$\begin{aligned} g =\gcd (a,c), \quad a = gu, \quad c= gv, \end{aligned}$$
so that
$$\begin{aligned} ub = vd, \quad d = uw, \quad b = vw. \end{aligned}$$
Recall (3.4), and let \(\mathcal G\) be the set of \((g,u,v,w_0) \in \mathbb N^4\) such that
$$\begin{aligned} guvw_0 \leqslant N^{1-1/ \log \log N}, \qquad \omega (gu), \omega (vw_0), \omega (gv), \omega (uw_0) \leqslant T,\qquad u\ne v. \end{aligned}$$
As \(P^+(ab) > N^{1/ \log \log N}\), we see by symmetry that
$$\begin{aligned} \mathcal S(N) \ll N(\log \log N)^{O(1)} + \sum _{(g,u,v,w_0) \in \mathcal G} S(g,u,v,w_0), \end{aligned}$$
$$\begin{aligned} S(g, u ,v, w_0) = \sum _{\begin{array}{c} \ell \in \mathcal P,\,N^{1/\log \log N} < \ell \leqslant \frac{N}{guvw_0} \\ (gu)^2 + (vw_0)^2 \ell ^2, \;(gv)^2 + (uw_0)^2 \ell ^2 \in \mathcal P \end{array}} 1. \end{aligned}$$
The fact that \(u \ne v\) ensures that there are three primality conditions defining \(S(g,u,v,w_0)\). To bound \(S(g,u,v,w_0)\) from above, we may assume without loss that \(guvw_0\) is even, and that the variables \(g,u,v,w_0\) are pairwise coprime, for otherwise \(S(g,u,v,w_0) = 0\). Paralleling Sect. 2, an application of Brun’s sieve reveals that
$$\begin{aligned} S(g, u ,v, w_0) \ll \frac{ N (\log \log N)^{O(1)}}{guvw_0 (\log N)^3}. \end{aligned}$$
Substituting (3.7) into (3.6) yields
$$\begin{aligned} \mathcal S(N) \ll N(\log \log N)^{O(1)} + \frac{N (\log \log N)^{O(1)}}{(\log N)^3} \mathcal I, \end{aligned}$$
$$\begin{aligned} \mathcal I= \sum _{k_1 + \cdots + k_4 \leqslant 2T} \prod _{i =1}^4 \left( \sum _{n \leqslant N:\, \omega (n) = k_i} n^{-1} \right) \end{aligned}$$
and T is as in (3.4). With \(U = 2T\), it follows from the multinomial theorem that
$$\begin{aligned} \mathcal I&\leqslant \sum _{k_1 + \cdots + k_4 \leqslant U} \prod _i k_i!^{-1} \left( \sum _{p^v \leqslant N} p^{-v}\right) ^{k_i} \\&= \sum _{m \leqslant U} m!^{-1} \sum _{k_1 + \cdots + k_4 = m} { m \atopwithdelims ()k_1, k_2, k_3, k_4 } \left( \sum _{p^v \leqslant N} p^{-v} \right) ^m, \end{aligned}$$
and a further application of the multinomial theorem gives
$$\begin{aligned} \mathcal I\leqslant \sum _{m \leqslant U} m!^{-1} \left( 4 \sum _{p^v \leqslant N} p^{-v} \right) ^m \leqslant \sum _{m \leqslant U} \frac{(4 \log \log N + 4c_1)^m}{m!}. \end{aligned}$$
As \(U = 2(1+\varepsilon )\log \log N+O(1)\), we now have
$$\begin{aligned} \mathcal I&\ll \frac{ (4 \log \log N +4c_1)^U}{U!}<\left( \frac{4e\log \log N+4ec_1}{U}\right) ^U\\&=\left( \frac{4e}{2+2\varepsilon }+O\left( \frac{1}{U}\right) \right) ^U\ll (\log N)^{2(1+\varepsilon )(1+\log 2-\log (1+\varepsilon ))}. \end{aligned}$$
Substituting this into (3.8) yields
$$\begin{aligned} \mathcal S(N)&\ll N(\log \log N)^{O(1)} (\log N)^{2(1+\varepsilon )(1+\log 2 - \log (1+\varepsilon )) - 3}\nonumber \\&\leqslant N(\log \log N)^{O(1)}(\log N)^{\log 4-1+2\varepsilon (1+\log 2)}. \end{aligned}$$
As \(c' > \log 4 -1\), we may choose \(\varepsilon > 0\) to give \(\mathcal S(N) \ll _{c'} N (\log N)^{c'}\). \(\square \)

Combining (3.1) and (3.5) with Lemma 3.5 establishes Theorem 1.2.

4 A final comment

We conjecture that Theorem 1.1 holds with equality. For a lower bound, one might restrict attention to those pairs (ab) with \(\omega (a)\approx \omega (b)\approx \frac{1}{2\log 2}\log \log N\). The upper bound for the second moment is analysed as in the paper, getting \(N/(\log N)^{\eta +o(1)}\); we expect that a more refined analysis would give
$$\begin{aligned} \frac{N (\log \log N)^{O(1)}}{(\log N)^\eta } \end{aligned}$$
here. The difficulty is in obtaining this same estimate as a lower bound for the first moment. This would follow if we had an analogue of Theorem 3.1 in which ab have a restricted number of prime factors. Such a result holds for the general distribution of Gaussian primes, at least if one restricts only one of ab, see [5].


Author's contributions

SC and CP jointly proved the theorems, drafted the manuscript, and polished it. Both authors have read and approved the final manuscript

Open Access

This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (, which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.


The authors were supported by the National Science Foundation under Grant No. DMS-1440140 while in residence at the Mathematical Sciences Research Institute in Berkeley, California, during the Spring 2017 semester. The authors thank John Friedlander, Roger Heath-Brown, Zeev Rudnick, Andrzej Schinzel and the anonymous referees for helpful comments, and Tomasz Ordowski for suggesting the problem.


This year (2017) is the 100th anniversary of the publication of the paper On the normal number of prime factors of a number n, by Hardy and Ramanujan, see [8]. Though not presented in such terms, their paper ushered in the subject of probabilistic number theory. Simpler proofs have been found, but the original proof contains a very useful inequality, one which we are happy to use yet again. We dedicate this note to that seminal paper.

Competing interests

The authors declare that they have no competing interests.

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Authors’ Affiliations

The Mathematical Sciences Research Institute
Department of Mathematics, University of York
Department of Mathematics, Dartmouth College


  1. de Bruijn, N.G.: On the number of positive integers \(\le x\) and free of prime factors \(>y\). Nederl. Acad. Wetensch. Proc. Ser. A 54, 50–60 (1951)MathSciNetMATHGoogle Scholar
  2. Coleman, M.D.: The Rosser–Iwaniec sieve in number fields, with an application. Acta Arith. 65, 53–83 (1993)MathSciNetMATHGoogle Scholar
  3. Ford, K.: The distribution of integers with a divisor in a given interval. Ann. Math. 168, 367–433 (2008)MathSciNetView ArticleMATHGoogle Scholar
  4. Ford, K., Luca, F., Pomerance, C.: The image of Carmichael’s \(\lambda \)-function. Algebra Number Theory 8, 2009–2025 (2014)MathSciNetView ArticleMATHGoogle Scholar
  5. Fouvry, E., Iwaniec, H.: Gaussian primes. Acta Arith. 79, 249–287 (1997)MathSciNetMATHGoogle Scholar
  6. Friedlander, J.B., Iwaniec, H.: Opera de Cribro, American Mathematical Society Colloquium Publications 57. American Mathematical Society, Providence (2010)Google Scholar
  7. Halberstam, H., Richert, H.E.: Sieve methods, London Mathematical Society Monographs, No. 4. Academic Press (A subsidiary of Harcourt Brace Jovanovich, Publishers), London (1974)Google Scholar
  8. Hardy, G.H., Ramanujan, S.: The normal number of prime factors of a number \(n\). Q. J. Math. 48, 76–92 (1917)MATHGoogle Scholar
  9. Harman, G., Lewis, P.: Gaussian primes in narrow sectors. Mathematika 48, 119–135 (2001)MathSciNetView ArticleMATHGoogle Scholar
  10. Kubilius, J.: On a problem in the \(n\)-dimensional analytic theory of numbers, Vilniaus Valst. Univ. Mokslo Darbai. Mat. Fiz. Chem. Mokslu Ser. 4, 5–43 (1955). (in Lithuanian; Russian summary)MathSciNetGoogle Scholar
  11. McNew, N., Pollack, P., Pomerance, C.: Numbers divisible by a large shifted prime and large torsion subgroups of CM elliptic curves. IMRN (2016). doi:10.1093/imrn/rnw173 Google Scholar
  12. Tenenbaum, G.: Sur une question d’Erdős et Schinzel, pp. 405–443. Cambridge University Press, Cambridge, A tribute to Paul Erdős (1990)Google Scholar


© The Author(s) 2017