TITLE: Is the average of primes up to $n$ smaller than $\frac{n}{2}$, if $n > 19$?
QUESTION [7 upvotes]: For $n = 19$, the average $\frac{(2 + 3 + 5 + 7 + 11 + 13 + 17 + 19)}{ 8} = \frac{77}{8}$ is greater than $\frac{19}{2}$ but for $n > 19$, it seems that the average is smaller than $n/2$.
I confirmed it holds for all $n < 10^7$ but have not been able to prove it for all n. How can I prove this?

REPLY [3 votes]: Mandl's inequality (see for example this paper of Axler) states that
$$
\frac{1}{m}\sum\limits_{k = 1}^m {p_k }  < \frac{{p_m }}{2}
$$
for $m\geq 9$. If $n\geq 23$, then $\pi(n)\geq 9$. Thus,
$$
\frac{1}{{\pi (n)}}\sum\limits_{p \le n} p  = \frac{1}{{\pi (n)}}\sum\limits_{k = 1}^{\pi (n)} {p_k }  < \frac{{p_{\pi (n)} }}{2} \le \frac{n}{2}.
$$
For $n=20,21$ and $22$, the inequality can be checked by hand.