# $yx^2=z$ For any interger $z$, find a whole number solution.

Given any integer $z$, what are all the integer solutions possible that create a square prism of length $x$ with a height of length $y$? For example, if $z=25$, some possibles solutions are a $5\times 5$ square prism with a height of $1$ or a square prism that is $1\times 1$ with a height of $25$.

Would the formula $yx^2=z$ be a way to figure this out and would this be a diophantine equation?

• I forgot a cube is the same length in all three axes, I should change it to a rectangular prism with two faces having a length of $x$. Edit: Square Prism. Commented Mar 3, 2015 at 3:31

Yes, $yx^2=z$ is a good way to represent the situation and if you demand that all the variables be naturals it is a Diophantine equation. Now if you factor $z$ you can find the solutions easily. $x$ can be any factor that you can square, then $y$ is what is left.
Hint: Think about taking a prime factorization of $z$. If $z=x^2y$, then every prime power divisor of $z$ must be accounted for by either $x^2$ or $y$. What sort of powers can $x^2$ actually take care of, and what sort must be taken care of by $y$?