Finding intergers $𝑛>2$ satisfying $𝑛^{π‘›βˆ’2}=k^{n}$

Question:

Find all integers $𝑛>2$ such that the number $𝑛^{π‘›βˆ’2}$ is the $n$-th power of an integer.

I have solved this question on my own and I need a solution verification. If my attempt is incorrect or missing something crucial, could you please provide me a suggestion of how to improve this?


Solution 1:

We can observe that $𝑛=4$ works, as $4^{4βˆ’2}=2^{4}$, and prove that no other integer $n>2$ does (though both $n=1$ and $n=2$ do).

Let $n=p^{e_{1}}_{1}β‹―p^{e_{k}}_{k}$ be the prime power decomposition of $n$.Then $n^{nβˆ’2}=p^{(nβˆ’2)e_{1}}_{1}⋯𝑝^{(nβˆ’2)e_{k}}_{k}$, and this is an n-th power if and only if $n|(nβˆ’2)e_{i}$ for all $1≀i≀k$. If $n$ is odd then $gcd(n,nβˆ’2)=1$ so this requires that $n|e_{i}$ for each $i$. But any prime $p$ raised to the n-th power already exceeds $n$, since $2^{n}>n$ for all $n$. So for $n^{nβˆ’2}$ to be an n-th power $n$ must be even, say $n=2m$. Then $gcd(n,nβˆ’2)=2$, and so $2m|(2mβˆ’2)e_{i}=2(mβˆ’1)e_{i}$, and hence $m|(mβˆ’1)e_{i}$, for all $i$. Since $gcd(m,mβˆ’1)=1$ this means that $m|e_{i}$ for all $i$. Now no odd prime $p$ may occur in the decomposition of $n$, because $p^{m}>2m=n$ already for any $pβ‰₯3$ and $mβ‰₯1$. Thus we must have $n=2^{e}$, so $m=2^{e-1}$. And finally, we can’t have $eβ‰₯3$, because for such $e$ we have $2^{eβˆ’1}>e$, so $m=2^{eβˆ’1}$ can’t divide $e$ as would be required.