Find all positive integers $n$ such that $\phi(\phi(n))=2$.
First I want to find all positive integers $n$ such that $\phi(n)=2$ then solve for all $m$ such that $\phi(m)=n$.
Knowing that none of my $n$ can be odd should limit my choices to pick but I'm not sure how to go about finding them.
This is by all means not the most economical way of checking the cases.
We recall that $\phi(p_1^{a_1}p_2^{a_2}...p_k^{a_k})=(p_1-1)(p_2-1)...(p_k-1)p_1^{a_1-1}p_2^{a_2-1}...p_k^{a_k-1}$.
So $m$ is a product of at most two prime factors since if there are three prime factors in $m$ (not necessarily distinct), then we are guaranteed to get two or more prime factors(counting multiplicities).
If $m=p$, then $\phi(m)=\phi(p)=p-1=2$ implies, $p=3$.
If $m=p^2$, then $\phi(m)=p(p-1)=2$ implies $p^2-p-2=0$ so $p=2$(As $p=-1$ is not a valid solution.)
If $m=pq$ where $p>q$, then, $(p-1)(q-1)=2$. Then, $p-1=2, q-1=1$ is the only valid factorisation and incidentally, this is valid as $p=3, q=2$ are both primes.
Therefore, $\phi(m)=2$ implies $m=3,4,6$.
So $\phi(n)=3,4,6$
With $\phi(n)=3$ you get nothing as $\phi(w)$ is even except for when $w=2$. (Looking at the formula, $\phi(p_1^{a_1}p_2^{a_2}...p_k^{a_k})=(p_1-1)(p_2-1)...(p_k-1)p_1^{a_1-1}p_2^{a_2-1}...p_k^{a_k-1}$ and noting that $p_i-1$ is even except when $p_i=2$ immediately tells us why.)
For the case $\phi(n)=6$, we first note that $n=7$ is a solution. With the above remark, we note that if $\phi(n)=6$, then there does not exist a $r|n$ such that $\phi(r)=3$. So as a result, we know that if $n$ is not prime and $n=st$ for some positive coprime integers $s,t\neq 1$ then, WLOG, $\phi(s)=1$ and $\phi(t)=6$. So $s=2$. $t=7$ is a valid solution. If $t$ is not prime, then we can repeat the argument and say $t=ab$ for some coprime $a,b$ with $\phi(a)=1$, $\phi(b)=6$. But then, that tells us again that $a=2$ and then that contradicts the fact that $s$ and $t=ab$ are coprime. So we have exhausted all the possible cases for when $\phi(n)=6$. In this case, $\underline{n=7,14}$
We consider what happens, when $n$ can be written as a product of two non-coprime factors and $\phi(n)=6$. Then, WLOG, $n=p^2 c$. So in particular, $\phi(p^2)=p(p-1)$ divides $6$. $p$ divides, $p(p-1)$ which divides $6$. So $p=2,3$. If $n=3^2 c$ where $c>1$, then $c$ has to be coprime to 3 as otherwise, $\phi(3^3)=12$ divides $\phi(n)=6$. Thus, since $c$ is coprime to $3$, $\phi(c)=1$. This tells us $c=2$. So we have two further solutions, $\underline{n=9,18}$.
With the case when $\phi(n)=4$, we note that if $n$ is a product of 4 or more prime factors(not necessarily distinct) then, $\phi(n)$ has 3 or more prime factors(not necessarily distinct).
If it is a product of one prime factor, (i.e. $n=p$) then $\underline{n=5}$.
If it is a product of two prime factors, (i.e $n=pq$ or $n=p^2$) then we know that $n=10$ as the latter case when $n=p^2$ gives us $p^2-p-4=0$ which has non-integral solutions.
If it is a product of three prime factors, (i.e. $n=p^3$, $n=p^2q$ or $n=pqr$) we note that the first case gives us $p^3-p^2-4=0$. This factorizes as $(p-2)(p^2+2)=0$ and the quadratic term has no integral factors. So $p=2$ and $\underline{n=8}$.
The second case gives us $p(p-1)(q-1)=4$. If $p,p-1,q-1$ are distinct integers, then, we get a contradiction as $4$ cannot be written as a product of three distinct positive integers. $p$ and $q-1$ are the only pair that might not be distinct. This tells us that $p=2$ and $q=3$ as $p,q$ are both primes.
If $n=2^2c$ similarly, we can say that $c$ has to be coprime with $2$ as otherwise $8$ divides $n$ and so $\phi(8)=4$ divides $\phi(n)$. Thus, $6=\phi(2^2)\phi(c)$ gives us $\phi(c)=3$ which is a contradiction. This gives us the case $\underline{n=2^2\cdot 3=12}$ and $\phi(12)=4$ as required.
The last case when $n=pqr$ can be ruled out as $\phi(n)$ is a product of three distinct positive integers.
That was a lot of checking rather than actual maths.