As the title of the question susggests, I would like to show that


The "trivial bound is that"


\begin{align\*}
\lim\_{Q\to\infty}\lim\_{N\to\infty}\frac{1}{N\pi(Q)}\sum\_{n<N}\left|\sum\_{\substack{p<Q\\p|n}}p-\pi(Q)\right|&\leq \lim\_{Q\to\infty}\lim\_{N\to\infty}\frac{1}{N\pi(Q)}\sum\_{n<N}\left(\sum\_{\substack{p<Q\\p|n}}p+\pi(Q)\right)\\
&=2
\end{align\*}


where the equality is obtained by noting that $\frac{1}{p}$ numbers are multiplies of $p$, so the expected value of $\sum\_{\substack{p<q \\ p|n}}p$ is exactly $\sum\_{p<Q}1=\pi(Q)$. Thus, we are looking only for a "$o(\cdot)$" improvement. The first thought of mine would be to note that since $\sum\_{\substack{p<q \\p|n}}p$ is an additive function and so by the Turan-Kubilius inequality


$$\sum\_{n<N}\left|\sum\_{\substack{p<Q\\p|n}}p-\pi(Q)\right|^2\leq 4N\sum\_{p<Q}p$$


The issue is, this inequality is worse than the trivial one since apply Cauchy-Shwartz we get that this inequality yields


\begin{align\*}
\frac{1}{N\pi(Q)}\sum\_{n<N}\left|\sum\_{\substack{p<Q\\p|n}}p-\pi(Q)\right|&\leq \frac{1}{\pi(Q)}\sqrt{\frac{1}{N}\sum\_{n<N}\left|\sum\_{\substack{p<Q\\p|n}}p-\pi(Q)\right|^2}\\
&\leq \frac{2}{\pi(Q)}\sqrt{\sum\_{p<Q}p}\\
\end{align\*}


where by the PNT this last term is on the order of $\sqrt{\frac{Q^2}{\log(Q)}}=\frac{Q}{\sqrt{\log(Q)}}$. This inequality would indicate to us that the sum would $\mathit{diverge}$, namely


$$\lim\_{N\to\infty}\frac{1}{N\pi(Q)}\sum\_{n<N}\left|\sum\_{\substack{p<Q\\p|n}}p-\pi(Q)\right|=\Omega(\sqrt{\log(Q)})$$


I have proved that the sum can't go to zero too fast, and specifically that


$$\lim\_{N\to\infty}\frac{1}{N\pi(Q)}\sum\_{n<N}\left|\sum\_{\substack{p<Q\\p|n}}p-\pi(Q)\right|=\Omega(\log(Q)^{-\epsilon})$$


for any $\epsilon>0$. It does, however, feel natural that this sum should be at least $o(1)$.



Showing that $\lim_{Q\to\infty}\lim_{N\to\infty}\frac{1}{N\pi(Q)}\sum_{n<N}\left|\sum_{\substack{p<Q\\p|n}}p-\sum_{p<Q}1\right|=0$
It seems that the conjecture is **false**, if I did not miss some asymptotc issue The essence of what follows is that I show that the interior limit exceeds *any* function of $Q$ tending to $0$.


For any $t\geq 1$, denote by $p\_t(Q)$ the density of those $n$ divisible by at least one $p$ with $t\pi(Q)<p<Q$. We have
\begin{align\*}
 p\_t(Q)&=1-\prod\_{t\pi(Q)<p<Q}\left(1-\frac1p\right)
 \sim 1-\exp\left(\sum\_{t\pi(Q)<p<Q}\frac1p\right)
 \sim 1-\frac{\log Q}{\log (t\pi(Q))}\\
 &\sim 1-\frac{\log Q}{\log Q+\log t-\log\log Q}
 =\frac{\log\log Q-\log t}{\log Q+\log t-\log\log Q}\\
 &\sim \frac{\log\log Q-\log t}{\log Q},
\end{align\*}
where the estimates work in the regime $t\leq o(Q/\pi(Q))=o(\log Q)$. (More precisely, in any such regime this equivalence is *uniform* over $t\leq o(\log Q)$, as $q\to\infty$.)


Assume now that your conjecture is true, i.e., that
$$
 f(Q):=\lim\_{N\to\infty}\frac{1}{N\pi(Q)}\sum\_{n<N}\left|\sum\_{\substack{p<Q\\p|n}}p-\pi(Q)\right| \to 0, \qquad Q\to\infty.
$$
Take $N$ to be a multiple of $Q!$. Notice that at least $p\_t(Q)N$ of the summands are larger than $(t-1)\pi(Q)$. Put $q=\log Q$. Summing up over $t=2,3,\dots,qf(Q)=o(q)$, we obtain
\begin{align\*}
 \frac1{N\pi(Q)}\sum\_{n<N}\left|\sum\_{\substack{p<Q\\p|n}}p-\pi(Q)\right|
 &\buildrel(\*)\over\ge \sum\_{t=2}^{qf(Q)} p\_t(Q)
 \sim \sum\_{t=2}^{qf(Q)} \frac{\log q-\log t}{q}
 =\frac1q\log\frac{q^{qf(Q)}}{(qf(Q))!}\\
 &\sim \frac1q\log\left(\frac{qe}{qf(Q)}\right)^{qf(Q)}
 \sim f(Q)(-\log f(Q)).
\end{align\*}
Since $f(Q)=o(1)$, the limit of the above expression as $N\to\infty$ cannot equal $f(Q)$.


**Remark.** The inequality $(\*)$ holds, because if a number $n$ is accounted for $x$ times in the right sum, then its large prime divisor $p$ is larger than $(x+1)\pi(Q)$, so that
$$
 \left|\sum\_{\substack{p<Q\\p|n}}p-\pi(Q)\right|>x\pi(Q).
$$


