Can I check, whether $n$ with $\frac{n}{\phi(n)}=r$ exists?
If a solution exists, there are $n$ primes such that $$\frac{p_1}{p_1-1} \cdots \frac{p_n}{p_n-1} = \frac{a}{b}.$$ For ease of argument, have the primes $p_1 < \cdots < p_n$ and $\gcd(a,b)=1$.
Now there is a largest prime $p$ that divides $a$. Because $p_i -1 < p_n$ for all $i$, we must have $p=p_n$. Hence,
$$\frac{p_1}{p_1-1} \cdots \frac{p_{n-1}}{p_{n-1}-1} = \frac{a}{b} \cdot \frac{p_n-1}{p_n} = \frac{a'}{b'}$$ where $a'$ and $b'$ are in reduced form. Now it turns out that $a'$ has a largest prime divisor less than $p_n$. So we can repeat this process at most $\pi(p)$ times and obtain a solution or achieve an inconsistency.