I have a question about finding all positive integers n such that

$\displaystyle \phi (n) = m $ where m is given.

For example $\displaystyle \phi (n) = 12 $

===========================================

For this problem or any problem, how do you know that the possible number of solutions are finite and you are not missing any.

Regarding, to $\displaystyle \phi (n) = 12 $, here is how I approached it.

If p | n, then (p-1) | 12. So, the possible p - 1 =1, 2, 3, 4, 6, 12 since they are factors of 12.

As a result, the possible values of p = 2, 3, 4, 5, 7, 13 but since p is a prime that leaves only p = 2, 3, 5, 7, 13.

From here, how would I continue?

I know that $\displaystyle n = p_{1}^{a_{1}} .... p_{k}^{a_{k}}$, then

$\displaystyle \phi (n) = \phi(p_{1}^{a_{1}})...\phi(p_{k}^{a_{k}}) $, so would I have to check every 1,2,...,k for each single p's?

Thank you for reading. Any help is greatly appreciated.