How do you find all $n$ such that $\phi(n)|n$ Where $\phi(n)$ is the Euler phi function, how do you find all $n$ such that $\phi(n)|n$?
Notice that $\varphi(1) = \varphi(2) = 1$, so $\varphi(1) \mid 1$ and $\varphi(2) \mid 2$.

If $n &gt; 2$, assume that the prime factorization of $n$ is 

$$n = p_1^{a_1} \ldots p_k^{a_k}$$ 

Then the formula for the totient function gives

$$\varphi(n) = (p_1 - 1)p_1^{a_1-1}\ldots (p_k - 1)p_k^{a_k-1}.$$

Since $n&gt;2$, this is always an even number, so $p_1=2$ must appear as a factor. We next observe that $n$ cannot have two odd prime factors. If $a_2&gt;0$ and $a_3&gt;0$, then both $p_2-1$ and $p_3-1$ are even, so $2^{a_1+1}\mid \varphi(n)$, which is a contradiction.

So $n=2^{a_1}p^{a_2}$ for some prime $p&gt;2$. Here $p-1\mid\varphi(n)\mid n$, so $p-1$ must be a power of two, say $p-1=2^\ell$. Then $2^{a_1-1+\ell}\mid\varphi(n)$, so we must have $\ell=1$ and $p=3$.

In the end we can verify that $n=1$ or $n=2^a3^b$, with $a&gt;0$, $b\ge0$.
Quasi-brute-force approach using Maple :

with(numtheory):
for n from 1 to 100 do
if n mod phi(n) = 0 then
print(n);
end if;
end do;