Inverse totient problem (source code)

= Inverse totient problem

Given a <positive integer> $m$, find all <positive integers> $n$ satisfying $\varphi(n)=m$. For every <prime divisor> $p$ of a solution, $p-1$ divides $m$, so the possible <primes> lie in the finite set $\{d+1:d\mid m,\ d+1\text{ is prime}\}$. Search can then combine the <prime powers> whose totient contributions multiply to $m$.