Can a composite number $n$ be the arithmetic mean of $\sigma(n)$ and $\varphi(n)$? Let


*

*$\varphi(n)$ be the totient-function 

*$\sigma(n)$ be the divisor-sum-function 


It is clear that every prime number $n$ is the arithmetic mean of $\varphi(n)$ and $\sigma(n)$, in other words , the equality $$\varphi(n)+\sigma(n)=2n$$ holds. 

Can the given equality hold for a composite number $n$ ?

Upto $10^8$, I did not find an example. I conjecture that the equality can only hold for primes or $n=1$. How can I prove it ?
 A: In other terms, we want that
$$ \prod_{p\mid n}\left(1-\frac{1}{p}\right)+\prod_{p\mid n}\left(1+\frac{1}{p}+\ldots+\frac{1}{p^{\nu_p(n)}}\right) = 2 $$
but the LHS cannot be an integer if $\nu_p(n)>1$, so it is enough to restrict our attention to square-free numbers and to the solutions of
$$ \prod_{p\mid n}\left(1-\frac{1}{p}\right)+\prod_{p\mid n}\left(1+\frac{1}{p}\right) = 2. $$
There are some solutions only if $\omega(n)=0$ or $\omega(n)=1$. If $\omega(n)\geq 2$, the LHS is at least as large as
$$ 2+\sum_{\substack{p,q\mid n \\ p\neq q}}\frac{1}{pq} > 2.$$
A: The answer is indeed "No". Let $n=p_1^{a_1}\cdots p_k^{a_k}$. Then $$\sigma(n)=(1+p_1+\cdots+p_1^{a_1})\cdot(1+p_2+\cdots+p_2^{a_2})\cdots(1+p_k+\cdots+p_k^{a_k})\\\varphi(n)=(p^{a_1}_1-p^{a_1-1}_1)\cdots (p_k^{a_k}-p_k^{a_k-1})$$
Now, if you expand the product in $\varphi(n)$ and take a look at the "monomials" $p_1^{h_1}\cdots p_k^{h_k}$ that appear in it, you'll notice that:


*

*they all have coefficient either $+1$ or $-1$ (the case $0$ is not considered because we're dealing with the ones that appear in the expansion)

*they are a subset of the monomials that appear in the expansion of $\sigma(n)$

*$p_1^{a_1}\cdots p_k^{a_k}$ appears with coefficient $+1$

*if $k\ge 2$, there is at least one monomial $M_n$ that appears with coefficient $+1$ other than the one mentioned in (3) - namely, $M_n=p_1^{a_1-1}p_2^{a_2-1}\prod_{j=3}^k p_j^{a_j}$.
Since all the monomials in $\sigma(n)$ have coefficient $+1$, the ones that have $-1$ in $\varphi(n)$ cancel out upon sum with $\sigma(n)$. Therefore we obtain that $$\sigma(n)+\varphi(n)\ge 2\cdot\sum\{\text{monomials that appear with coefficient }+1\text{ in }\varphi(n)\}$$
As we've observed in (3) and (4), if $k\ge 2$ we have that $RHS\ge 2n+2M_n> 2n$. On the other hand, if $n=p^a$, then $$\sigma(p^a)+\varphi(p^a)=2p^a+0\cdot p^{a-1}+p^{a-2}+\cdots +1$$ which is equal to $2p^a$ if and only if $a<2$.
A: Noticed that it's equivalent to prove that
$$
\sigma\left(n\right)-n\ge n-\varphi \left(n\right)
$$
Noticed that $RHS$ means how many $i$ and $n$ is not relatively prime
where $i\in\left[1,n\right]$
$$
RHS=\sum_{i=1}^n\left[\gcd\left(i,n\right)\neq1\right]
$$
So
$$
RHS\le \sum_{k=2,k \mid n}^n\sum_{i=1}^n\left[k \mid i\right]=\sum_{k=2,k \mid n}^n\dfrac n k=LHS
$$
