a previous version of this manuscript, the weaker bound $\sum_{p {\leqslant}N} f_{{\operatorname{II}}}(p) \ll N \log^2 N \log\log N$ was claimed. As pointed out subsequently by Jia [@jia], the argument in that previous version in fact only gave $\sum_{p {\leqslant}N} f_{{\operatorname{II}}}(p) \ll N \log^2 N \log\log^2 N$, but can be repaired to give the originally claimed bound $\sum_{p {\leqslant}N} f_{{\operatorname{II}}}(n) \ll N \log^2 N \log \log N$. These bounds are of course superceded by the results in Theorem \[main\].

As a corollary of this and , we see that $$N \log^2 N \ll \sum_{p {\leqslant}N} f(p) \ll N \log^2 N \log \log N.$$ From this, the prime number theorem, and Markov’s inequality, we see that for any ${\varepsilon}> 0$, we can find a subset $A$ of primes of relative lower density at least $1-{\varepsilon}$, thus $$\label{liminf}
 \liminf_{N \to \infty} \frac{|\{ p \in A: p {\leqslant}N\}|}{|\{ p: p {\leqslant}N \}|} {\geqslant}1-{\varepsilon},$$ such that $f(p) = O_{\varepsilon}(\log^3 p \log \log p)$ for all $p \in A$. Informally, a typical prime has only $O(\log^3 p \log \log p)$ solutions to the Diophantine equation ; or alternatively, for any function $\xi(p)$ of $p$ that goes to infinity as $p \to \infty$, one has $O(\xi(p) \log^3 