Integers whose totient divides them (source code)

= Integers whose totient divides them
{title2=$\varphi(n)\mid n\iff n=1\text{ or }n=2^c3^d,\ c\ge1,\ d\ge0$}

If $n>1$ is odd, its <Euler totient function> is even and cannot divide $n$. Otherwise write $n=2^c\prod_{j=1}^r p_j^{a_j}$ with odd primes $p_j$ and $c\ge1$. Comparing powers of two in $\varphi(n)\mid n$ gives $\sum_j v_2(p_j-1)\le1$. Thus there is at most one odd prime $p$, with $v_2(p-1)=1$. Since $p-1$ divides $\varphi(n)$, it divides $n$, and is <coprime> to $p$; with only the prime factors $2,p$ available it must be a power of two. Hence $p-1=2$ and $p=3$. Conversely, for $c\ge1$ the prime-power totient formula verifies divisibility for $2^c3^d$, and $n=1$ is immediate.