Is $\phi(n^k) = \phi(m^k)$ for any $n \neq m$ and $k > 2$? It's easy to find pairs of integers $n \neq m$ such that the Euler totient $\phi(n) = \phi(m)$, for example just take $n$ odd and $m = 2n$. However, some computer experiments that I have run indicate that for $k > 1$ it may be impossible to find such pairs for which $\phi(n^k) = \phi(m^k)$. Particularly it seems that no perfect squares yield the same totient. I don't see an obvious reason why this should be true. Could someone explain it?
 A: The answer is no for the following reason. Let $p_1, \dots, p_k$ be the prime divisors of $n$ and $q_1, \dots, q_r$ be the prime divisors of $m$. Then if $\phi(n^k) = \phi(m^k)$, we have
$$n^{k-1} \cdot n \prod \left(1 - \frac{1}{p_i} \right) = m^{k-1} \cdot m \prod \left(1 - \frac{1}{q_i} \right).$$
Now cancel out the common $(1-1/p_i)$ factors on each side, i.e. the terms corresponding to common prime divisors of $n$ and $m$. Also, divide by $d^k=\gcd(n,m)^k$ where $n=ad$ and $m=bd$ to get
$$a^{k-1} \cdot a \prod \left(1 - \frac{1}{p_{i_k}} \right) = b^{k-1} \cdot b \prod 
\left(1 - \frac{1}{q_{k_i}} \right).$$
Now $p_{i_k}$ does not divide the gcd since it isn't a shared prime factor. Thus $p_{i_k}$ divides $a$. Similarly, $q_{k_i}$ divides $b$, and so we conclude that the RHS is $a^{k-1}$ times an integer and the LHS is $b^{k-1}$ times an integer.
Without loss of generality, we can have $b > a$. Now $\gcd(a,b) = 1$ which means the equation implies $b \; | \; a \prod \left(1 - \frac{1}{p_{i_k}} \right) < b$. This is a contradiction, so we cannot have $n \neq m$ such that $\phi(n^k) = \phi(m^k)$  for $k \geq 2$.
A: Here’s another proof, I hope. It was harder to write up than I expected.
The following observation will be useful: If $k>1$ and $n$ is an integer, every prime factor of $n$ divides $\phi(n^k)$.
For the purpose of obtaining a contradiction, assume a counterexample to the result: $n\neq m$, $k>1$, and $\phi(n^k)=\phi(m^k)$.
Let $p$ be the largest prime divisor of $\phi(n^k)$ and let $n^k=p^{ik}b^k$ where $\gcd(p,b)=1$. Then $\phi(n^k)=\phi(p^{ik})\phi(b^k)$, and as previously noted, $\phi(b^k)$ is divisible by every prime factor of $b$. Then no prime greater than $p$ divides $b$ (or $n$), and $p$ divides $\phi(n^k)$ exactly $ik-1$ times. Because $\phi(n^k)=\phi(m^k)$, $p$ also divides $\phi(m^k)$ exactly $ik-1$ times, and $m$ can also have no prime factors greater than $p$, because none divides $\phi(m^k)$. Note that $p$ is a factor of $m$ and $n$, because $ik-1$ is nonnegative.
Thus $m^k=p^{ik}a^k$ where $\gcd(p,a)=1$ and all prime factors of $a$ are less than $p$. Note that $a=m/p^i$ and $b=n/p^i$.
But now $\displaystyle\phi(a^k)=\frac{\phi(m^k)}{\phi(p^{ik})}=\frac{\phi(n^k)}{\phi(p^{ik})}=\phi(b^k)$, and $a$ and $b$ provide a new counterexample and their largest prime factors are less than $p$.
By repeating this process, $m$ and $n$ can be taken to have no prime divisors, but this is a contradiction, because then each equals $1$, and $1\neq 1$.
