Let $x$ and $y$ be two positive integers such that $x+y< 537$. Under these conditions, find the sum of all distinct values of y such that $x^2+y^2=x^3$.
Unsure as to how to go about this question. I know for a fact that the answer is 812, but am not sure how to do it.