Find all integers s.t. $\phi(n)=24$.
I keep practicing these and keep getting frustrated cause I keep missing numbers. I'm going off Elementary Number Theory and Its Applications by Kenneth H. Rosen
His strategy it to get it's divisors, which in this case
$$m|24, m\in \{(1,24),(2,12),(3,8),(4,6)\} $$
Then to put the equation in both these formats and solve
$$\phi(n)=(p_1^{a_1}-p_1^{a_1-1})\times...\times(p_r^{a_r}-p_r^{a_r-1})$$
$$\phi(n)=2^{k-1}(p_1^{a_1}-p_1^{a_1-1})\times...\times(p_r^{a_r}-p_r^{a_r-1})$$
Where $p_i$ is a prime and $2^k|\phi(n), k\in N$
So in the first format it can be in the following formats:
$\phi(n)=(p_1^{a_1}-p_1^{a_1-1})\times...\times(p_r^{a_r}-p_r^{a_r-1})$
$\phi(n)=24=1\times24=2\times12=3\times8=4\times6$
So from the above we can eliminate $1\times24$ because 25 isn't prime and eliminate $3\times8$ because no prime minus itself to 1 less power equals 3.
So from the first round we get
n={39, 35, 45}
Then with k=1
$\phi(n)=2^{k-1}(p_1^{a_1}-p_1^{a_1-1})\times...\times(p_r^{a_r}-p_r^{a_r-1})=(p_1^{a_1}-p_1^{a_1-1})\times...\times(p_r^{a_r}-p_r^{a_r-1})$
So we just multiply what we have so far for n by 2.
n={39,35,45,90,78,70}
Then with k=2
$\phi(n)=2^{k-1}(p_1^{a_1}-p_1^{a_1-1})\times...\times(p_r^{a_r}-p_r^{a_r-1})=2(p_1^{a_1}-p_1^{a_1-1})\times...\times(p_r^{a_r}-p_r^{a_r-1})$
So only $2\times 12$ works here so we get $2^2\times13$
n={39, 35, 45, 90, 78, 70, 52}
Then with k=3
$\phi(n)=2^{k-1}(p_1^{a_1}-p_1^{a_1-1})\times...\times(p_r^{a_r}-p_r^{a_r-1})=2^2(p_1^{a_1}-p_1^{a_1-1})\times...\times(p_r^{a_r}-p_r^{a_r-1})$
$24=4\times6$ so the only ones that can equal 6 are $(3^2-3)$ and $(7-1)$. So we get $2^3\times 3^2$ and $2^3 \times 7$
n={39, 35, 45, 90, 78, 70, 52, 72, 56}
But I ended up missing 84. I always end up missing 1 or 2 so any suggestions on how to do this better and not miss any would be great.