Let $f$ be a non-constant polynomial with integers coefficients, and for each prime number $p$ let $\eta\_f(p)$ be the number of zeros of $f$ modulo $p$. It is known that the average (in the natural way) of $\eta\_f(p)$ among all primes $p$ is equal to the number $r$ of irreducible factors of $f$ in $\mathbb{Q}[X]$. (On p. 32 of [1] this result is attributed to Kronecker.)


I am looking for a reference to an asymptotic formula like:
$$(1)\quad \sum\_{p \leq x} \eta\_f(p)\,\frac{\log p}{p} = r \log x + \text{Good error term}.$$
(Or something from which (1) could be obtained by partial summation.)


I know that (1) can be proved using Chebotarev density theorem and Burnside's lemma (and, if I am not wrong, the error term should be $O(1)$). Anyway, I am interested in a reference from a book or an article. 


Thank you in advance for any help.


[1] P. Stevenhagen and H. W. Lenstra, Chebotarëv and his density theorem, Math. Intelligencer 18 (1996), no. 2, 26–37. 


**EDIT:** If instead $f$ is a non-constant polynomial with coefficients in the ring of integers $\mathcal{O}\_k$ of a number field $k$, and $\eta\_f(p)$ is the number of $n \in \{0, 1, \ldots, p-1\}$ such that $f(n) / p$ is an algebraic integers, does something like (1) still hold? With which constant instead of $r$?



Asymptotic formula for the average number of zeros of a polynomial modulo p
Your statement is essentially Mertens' theorem for number fields. Apparently a reference is
M. Rosen, A generalization of Mertens’ theorem, J. Ramanujan Math.
Soc. (1) 14 (1999), 1–19


However it requires a little bit of effort to transform this into your problem. You might not be satisfied by that.


Clearly it's sufficient to do this for irreducible polynomials $f(x)$ In this case, let $K = \mathbb Q(\alpha)$, $\alpha$ a root of $f(x)$.


The number field analogue of Mertens' first theorem shows that $$\sum\_{\mathfrak p \in \mathcal O\_K, |\mathfrak p|<x} \frac{ \log |\mathfrak p|}{ |\mathfrak p|} = \log x +O(1) $$


This bound implies what you want because the number of primes of $\mathcal O\_K$ of norm $p$, $p$ not dividing the discriminant of $f$, is exactly $n\_f(p)$. The remaining contributions, consisting of prime powers, of primes with prime power norm, and of primes dividing the discriminant, can all be bounded as $O(1)$ by standard methods.




---


For your edited question, let $e\_1,\dots,e\_k\in \mathcal O\_K$ be a $\mathbb Z$-basis of $\mathcal O\_K$. write $f(x) = \sum\_{i=1}^k f\_i(x) e\_i$ where each $f\_i(n)$ has rational coefficients. After throwing out the primes $p$ dividng the denominators of $f\_i(x)$, $x \in \{0,\dots,n-1\}$ satisfies $f(x) \in p \mathcal O\_k$ if and only if $f\_1(x),\dots,f\_k(x)$ all vanish.


There are two possibilities - either a single polynomial divides all the $f\_i(x)$, or not.


If a single polynomial divides all of them then we are back in the first situation with that polynomial.


If not, then the $f\_i(x)$ generate the unit ideal in $\mathbb Q[x]$, so they generate the ideal $(N)$ in $\mathbb Z[x]$ for some natural number $N$. Thus they can only have a common zero mod $p$ if $p$ divides $N$. 


So for a typical polynomial $f$ (i.e.in the second case) there are only finitely many solutions.


