Average of divisors of n. Let n be a natural number and let $f(n)=\frac{\sigma(n)}{d(n)}$ be the arithmetical average of n's divisors. Either prove or give a counterexample that for all natural numbers like n, which are not prime, $f(n)\leq\frac{3n}{8}+1$ and show when does the equality hold.
 A: Consider including the divisors of $n$ in this average in pairs whose product is $n$, starting with the "extremal" pair $(1,n)$ and continuing by reducing the larger divisor and increasing the smaller divisor in each step. (If $n$ is a square, the unpaired divisor $\sqrt n$ also needs to be considered.)
The average of a pair $(d,n/d)$ is $(d+n/d)/2$, and this is maximal for $d=1$ and minimal for $d=\sqrt n$. Thus if $n$ is not prime, we can bound the average from above by the average of the first two pairs, and we can bound the contribution of the second pair from above by using $d=2$:
\begin{align}
\frac{\sigma(n)}{d(n)}
&\le
\frac{1+n+2+n/2}4
\\
&=
\frac38n+\frac34
\\
&\lt
\frac38n+1\;.
\end{align}
In the special case where $n$ is the square of a prime, we have
\begin{align}
\frac{\sigma(n)}{d(n)}
&=
\frac{1+n+\sqrt n}3
\\
&=\frac38n+1-\frac{n-8\sqrt n+16}{24}
\\
&=\frac38n+1-\frac{(\sqrt n-4)^2}{24}
\\
&\le
\frac38n+1
\;,
\end{align}
with equality holding only for $n=16$, which isn't the square of a prime. Thus the inequality in fact holds for all composite $n$, not just for $n\gt10$, and equality never holds.
