<s>[INST] Finding all pairs of integer solutions to ${x^y = (x+y)^2}$ How do I find all solutions for ${x^y = (x+y)^2}$, where $x$ and $y$ are positive integers and at least one of them is prime.
For example, ${64 = 2^6 = (2+6)^2}$
A friend of mine pointed out that $x|y^2$ then $x^2|y^2$, so, when $x$ is prime and $y$ is not prime, we can write $y=xk$. Thus $x^{xk} = x^2 (1+k^2)$ and $x^{xk-2} = (1+k^2)$.
 [/INST] This is not an answer. This is a clarification to a comment I did to the OP.
$y$ must be even if $x$ is not a perfect square because:
Since $y$ is an integer there are two possibilities,  either $y=2k$ or $y=2k+1$. If $y=2k+1$(odd) then
$x^y=x^{2k+1}=(x+2k+1)^2$
$x^\frac{2k+1}{2}=x+2k+1$
$x^k\sqrt{x}=x+2k+1$
Notice that here the $RHS$ is an integer and the $LHS$ would also be an integer if $x$ is a perfect square otherwise the $LHS$ would not be an integer which is a contradiction.
This means that if $x$ is not a perfect square then $y$ is even.
</s>