Let $S(n)$ be $S(n)=\left\{k\;\left|\;\left\{\frac{n}{k}\right\}\right.\geq \frac{1}{2}\right\}$,where $\{x\}$ is the fractional part of $x$
Prove that :
\begin{align} \sum_{k\in S(n)} \varphi(k)=n^2 \end{align}
maybe the fact \begin{align} \sum_{k \leq 2n}\left\lfloor{\frac{n}{k}+\frac{1}{2}}\right\rfloor \varphi(k)=\frac{3n^2+n}{2}\end{align}
and \begin{align} \sum_{k \leq 2n}\left\lfloor{\frac{n}{k}}\right\rfloor \varphi(k)=\frac{n^2+n}{2}\end{align}
can help, but I can't prove these two equations
Edited:Sorry that my question is to prove the two equation before, because I've already known how to relate the problem with these two equations, and I've also known how to prove the second equation from Identity involving Euler's totient function: $\sum \limits_{k=1}^n \left\lfloor \frac{n}{k} \right\rfloor \varphi(k) = \frac{n(n+1)}{2}$ but I can't solve the first one with the similar method.