Suppose that φ(n)=2m for some m∈Z+. Based on the formula of φ(n), we have
φ(n)=p∣n∏pt−1(p−1)=2m
with vp(n)=t. This implies that t=1 for all odd prime divisors, since otherwise, p∣2m, a contradiction. Thus p−1 is a power of 2.
With odd prime divisor of n, put p=2s+1 for some s∈Z+. If s=1 then p=3, otherwise s must be even since p≡(−1)s+1≡0(mod3) when s is odd, contradiction. In case s has some proper odd prime divisor q then put s=qt with t>1 then 2s+1=(2t)q+1 is divisible by 2t+1, contradiction also.
These imply that s is also a power of 2, so by putting s=2k, we get p=22k+1. Now let n=2ap1p2…pl with a≥0,l≥0 and p1,p2,…,pl are odd primes in ascending order, in which p1=22k+1. So
2n=σ(n)=(2a+1−1)(p1+1)(p2+1)…(pl+1)
is the sum of divisors of n. Note that l>0, otherwise, σ(n)=2a+1−1, contradiction. If p1>3 then 3∤2n and
p1+1=22k+2=2(22k−1+1)≡2((−1)2k−1+1)≡0(mod3)
implying that 3∣2n, contradiction. Thus p1=3 and v3(2n)=1 leads to l≤2. There are two cases
* If l=2 then 2a+1⋅3⋅p2=(2a+1−1)⋅4⋅(p2+1), note that v2(p2+1)=1 so comparing the exponent of 2 in both sides to get a=2. Thus 6p2=7(p2+1), contradiction.
* If l=1 then 2a+1⋅3=(2a+1−1)⋅4, then a=1 implies that n=6 is a perfect square.
Therefore, n=6 is only solution of this problem.