Rational square root of a perfect square