If $\displaystyle \displaystyle{n=p_1^{a_1}\cdot\ldots\cdot p_r^{a_r}}\,,\,\,p_i$ primes, $\displaystyle a_i\in\mathbb{N}$ , and since $\displaystyle \displaystyle{\phi(n)=n\prod\limits^r_{k=1}\left(1-\frac{1}{p_k}\right)}$ , we
get that $\displaystyle \displaystyle{\phi(n)\mid n\Longleftrightarrow 1=m\prod\limits^r_{k=1}\left(1-\frac{1}{p_k}\right)}\,,\,m\in\mathbb{N}$ , so the factors on the RHS are inverse
to each other, and this means $\displaystyle \displaystyle{\prod\limits^r_{k=1}\left(1-\frac{1}{p_k}\right)^{-1}=\prod\limits^r_{k=1}\frac{p_k}{p_k-1}\right)}\in\mathbb{N}$.
But the only prime that $\displaystyle p_k-1$ divides is $\displaystyle 2$ , unless $\displaystyle p_k=2$ and $\displaystyle p_k-1=1$ , in which case
only the prime $\displaystyle p_j=3$ can possibly be so that $\displaystyle (p_j-1)=2\mid 2=p_k$ , so n has to be of the form
$\displaystyle n=2^r3^s\,,\,r>0\,,\,s\geq 0$ .