Q. Find all pairs $(p,n)$ of positive integers where $p$ is prime and $p^3-p=n^7-n^3$.
Rewriting the given equation as $p(p+1)(p-1)=n^3(n^2+1)(n+1)(n-1)$, we see that $p$ must divide one of the factors $n,n+1,n-1,n^2+1$ on the $\text{r.h.s}$.
Now, the $\text{l.h.s}$ is an increasing function of $p$ for $p\ge1$. This implies that for any given $n\ge1$, there is exactly one real $p$ for which $\text{l.h.s}=\text{r.h.s}$. For $p=n^2$, we get $\text{l.h.s}=n^6-n^2<n^7-n^3=\text{r.h.s}.$ This means that either $p>n^2$ or $p<n^2$ must hold.
Assuming $p>n^2$, it follows that the prime $p$ cannot divide any of $n,n+1,n-1$. So $p$ must divide $n^2+1$ and hence $p=n^2+1\quad (\because p>n^2)$.
Substituting the value of $p$ in the given equation we get, $n^2+2=n^3-n\implies n^3-n^2-n=2$. As the factor $n$ on the $\text{l.h.s}$ must divide $2$, the above equation has a unique integer solution $n=2$.
Finally, we get $(5,2)$ as the solution to the given equation.
But how do I conclude this is the only solution possible? Also, why does'nt $p<n^2$ (the case which I ignored) hold? As a bonus question, I would like to ask for any alternative/elegant solution (possibly using congruence relations) to the problem.
To eliminate the case $p\lt n^2$, note that $p\lt n^2$ implies $p+1\lt n^2+1$ and $p-1\lt n^2-1$, and this gives $p^3-p=p(p+1)(p-1)\lt n^2(n^2+1)(n^2-1)\le n^3(n^2+1)(n^2-1)=n^7-n^3$.
Remark: The paragraph that argues that either $p\gt n^2$ or $p\lt n^2$ isn't really necessary. It's obvious that $p\not=n^2$, since primes cannot be squares.