Assume that $n=\prod_{i=1}^{k}p_i^{a_i}\ge2$ for some distinct primes $p_1,\cdots,p_i$ and some integers $a_1,\cdots,a_i \ge 1$
Let $rad(n)=\prod_{i=1}^{k}p_i$, then we have $\frac{n}{2}=\varphi(n)^2=n^2\frac{\varphi(rad(n))^2}{rad(n)^2}$
Which implies that $rad(n)^2=2n\varphi(rad(n))^2$, that is, $1=2\frac{n}{rad(n)^2}\varphi(rad(n))^2 \ge \frac{2}{rad(n)}\varphi(rad(n))^2 = 2\prod_{i=1}^{k}\frac{(p_i-1)^2}{p_i}$, with the equal sign holds if and only if $n=rad(n)$.
Since $\frac{(p_i-1)^2}{p_i} < 1 \implies p_i^2-3p_i+1 < 0 \implies p_i < \frac{3+\sqrt{5}}{2}\implies p_i=2$, this means if $2\nmid n$ this leads to a contradiction.
If $2\mid n$, and $k\ge2$(i.e. $n$ has at least 2 distinct prime factors). Assume that $p_1=2$, then since $\frac{\varphi(2)^2}{2}=\frac{(2-1)^2}{2}$, this implies that $1\ge\prod_{i=2}^{k}\frac{(p_i-1)^2}{p_i} > 1$, which again is a contradiction.
If $n=2^s$ with $s \ge 2$, then we have $1=2\frac{n}{rad(n)^2}\varphi(rad(n))^2 > \frac{2}{rad(n)}\varphi(rad(n))^2 = 2\times\frac{(2-1)^2}{2}=1$, which again leads to a contradiction.
Therefore, $\varphi(n)=\sqrt{\frac{n}{2}}$ if and only if $n=2$
Can anyone help me confirm that?
– Aria Jan 21 '24 at 17:17