Solution (source code)

= Solution

Write $\psi(x)=\sum_{n\le x}\Lambda(n)$, where $\Lambda$ is the <Von Mangoldt function>. The <Riemann–von Mangoldt explicit formula>, in its symmetric limiting form for $x>1$, is
$$
\psi_0(x)=x-\lim_{T\to\infty}\sum_{|\Im\rho|\le T}\frac{x^\rho}{\rho}-\log(2\pi)-\frac12\log(1-x^{-2}).
$$
Here nontrivial zeros are counted with multiplicity, the limit is taken symmetrically through admissible heights, and $\psi_0$ assigns half weight at a jump. Its difference from $\psi$ is at most $(\log x)/2$. The <Euler product> and part (a) exclude zeros with real part at least one. The <Functional equation of the Riemann zeta function> leaves only the <trivial zeros of the Riemann zeta function> at negative even integers outside $0<\Re\rho<1$; their already displayed logarithmic correction is $O(x^{-2})$ for large $x$. These terms and the constant are negligible in the requested asymptotic error, rather than literally absent from the exact formula.

A useful <truncated explicit formula for the second Chebyshev function> is, uniformly for $2\le T\le x$,
$$
\psi(x)=x-\sum_{|\Im\rho|\le T}\frac{x^\rho}{\rho}+O\left(\frac{x\log^2(xT)}T+\log x\right).
$$
One may first take a height in $[T,T+1]$ separated from zeros and then adjust to $T$ using the local count. The <local zero count for the Riemann zeta function> is
$$
\boxed{\#\{\rho:0<\Re\rho<1,\ t\le\Im\rho\le t+1\}\ll\log(|t|+3).}
$$
It includes multiplicity and is uniform in real $t$. It follows by subtracting the <Riemann–von Mangoldt formula> at endpoints, handling bounded heights separately and using conjugation for negative heights. Both closed endpoints change the count only by another local bound.