# Uniformity in the error term of counting ideals up to a certain norm

There is a beautiful formula to count the number of ideals $I$ in the ring of integers $\mathcal{O}_K$ of a number field $K$, given by

$$\sum_{n \leq X} a_n \sim C_K X,$$

where $a_n$ is the number of ideals in $\mathcal{O}_K$ of norm $n$ and $C_K$ is the residue at $s = 1$ of the Dedekind zeta function $\zeta_K$ of $K$. The quantity $C_K$ is used in the class number formula, see: https://en.wikipedia.org/wiki/Class_number_formula

Indeed, one can further refine the result by counting principal ideals. Let $b_n$ denote the number of principal ideals in $\mathcal{O}_K$ of norm $n$. Then

$$\displaystyle \sum_{n \leq X} b_n \sim \frac{C_K}{h_K} X,$$

where $h_K$ is the class number of $K$.

Now let $K = \mathbb{Q}(\sqrt{d})$, where $d$ is a positive fundamental discriminant. Let $\epsilon_d = u_0 + v_0 \sqrt{d}$, where $(u_0, v_0)$ is the smallest positive solution to the Pell equation $x^2 - dy^2 = \pm 4$. Then the regulator of $K$ is given by $\log \epsilon_d$, so the class number formula yields

$$\displaystyle C_K = \frac{2 h(d) \log \epsilon_d}{\sqrt{d}}.$$

Therefore, the number of principal ideals up to $X$ is given by

$$\displaystyle \sum_{n \leq X} b_n \sim \frac{2 \log \epsilon_d}{\sqrt{d}} X.$$

My question is, what about the error term? According to these notes due to Andrew Granville, one gets an error term of $O_d(X^{1/2})$. He did not specify the dependence on $d$. I believe it is not too difficult to obtain $O(\max\{u_0, v_0\} X^{1/2})$ from Granville's arguments, but this seems very large (at least, the dependence on $d$ of the error term is far worse than the dependence on $d$ of the main term). Is there a way to show that the dependence on $d$ is small, say $O(X^{1/2} \log \epsilon_d)$?

If $\zeta_K(s)$ has no zero for $\sigma \geq \rho$, you can take $O(x^{\rho+\epsilon})$.
Even the simplest zero-free regions should give you a good enough estimate. Of course, under GRH you get $O(x^{1/2+\epsilon})$.
• Is the constant in the big-$O$ absolute? Also, is there a version of Bombieri-Vinogradov that can give the above result 'on average' (instead of GRH) over a large range of $d$? – Stanley Yao Xiao Aug 7 '16 at 2:01
• @StanleyYaoXiao I'm not sure. I doubt that you can go all the to $O(x^{1/2+\epsilon})$ with Bombieri-Vinogradov, but probably quite close. – Myshkin Aug 7 '16 at 5:01