How to check if ratio of 2 numbers is a perfect square without actually finding the ratio?
For example, if $a = 27$, $b = 3$, then their ratio $\frac{27}{3} = 9$ is a perfect square.
Can we determine whether ratio of 2 numbers is a perfect square without actually finding the ratio?
One way is to find the prime factorisations of both numbers. If the difference between the exponents of the factor is odd (say $2^2$ and $2^3$), then the result is not a perfect square. Only if all the differences are even will the ratio be a perfect square.
Another way is to use Euclid's algorithm to find $\frac{a}{\gcd{(a, b)}}$ and $\frac{b}{\gcd{(a, b)}}$, where the $\text{gcd}$ is the greatest common divisor of $a$ and $b$. Then these two numbers must be coprime since they have already been divided by the greatest common divisor. If the largest number out of $a, b$ is a perfect square, their ratio ($\frac{b}{\gcd{(a, b)}}$ divided by $\frac{a}{\gcd{(a, b)}}$) is a perfect square.