Given $8\sqrt{p} = q\sqrt{80}$, where $p$ is prime, is the solution unique? I had this maths question:

Given that $$8\sqrt{p} = q\sqrt{80}$$ where $p$ is prime, find the value of $p$ and the value of $q$

I did this by simplifying the RHS to $4q\sqrt{5}$ and comparing clearly gives $p=5$ and $q=2$
However, I also thought why not do this by getting unitary surds on either side, eg $$8\sqrt{p} = q\sqrt{80} \Rightarrow \sqrt{64p} = \sqrt{80q^2}$$ This tells me that $64p=80q^2$ or equivalently $4p = 5q^2$.
How would I be able to get $p$ and $q$ from this method? How do I know that the solution is unique?
If so, is it fortuitous that we get a unique solution with these particular numbers or will it always be unique - I think I just need to see a proof to convince myself!
 A: If $q$ is restricted to the integers: From the equation $4p = 5q^2$, it follows that $5|5q^2=4p$, or in particular, $5$ has to divide $4p$. This is possible only if $5$ divides $p$. But this and $p$ prime, gives $p=5$. From $p=5$ it is clear that $q=2$.
ETA: If $q$ is allowed to be any real number i.e., no longer restricted to the integers, then there is a solution for every prime $p$; indeed pick $q$ such that the equation $4p=5q^2$ is satisfied, or $q=2\sqrt{\frac{p}{5}}$. Note that the only prime $p$ for which this is rational is for $p=5$ however.
A: Clearly $4p$ has to have a prime factor of $5$ but $4$ does not have that factor. So the prime $p$ has to have a factor of $5$, therefore ... .
A: The answer is very different depending on whether q is required to be an integer or not. Let's look at both cases, starting from the equation $4p = 5q^2$ that you derived.
If q is restricted to the integers, then that means $5q^2$ is divisible by 5, and because of equality, $4p$ is as well. Since 4 does not divide 5, $p$ must. But $p$ also has to be prime, and the only prime number divisible by $5$ is $5$ itself. Therefore, $\boxed{\textbf{p = 5}}$.
If q is unrestricted, then it's a whole different story. You can plug in any prime number for $p$, and $4p = 5q^2$ will always have a real number solution since both sides will always be positive. In this situation, there are infinitely many solutions, because there are infinitely many prime numbers that $p$ could equal.
A: The answer is "no". Because, we don't have an important restriction $q\in\mathbb Z^{+}$. Otherwise, we have infinitely many solutions:
$$q=2\sqrt {\frac p5}$$
where, $p$ is an any prime number.
