Given positive integers $n, r$, with $p$ a prime, and $n^2/r^2 = p$, prove that $n$ is divisible by $p$. Use proof by contradiction (I am sure there are easier ways to prove this, but this is what the book requests, since the chapter is exercises on proof by contradiction).
I started off by assuming that $n$ is not divisible by $p$, therefore:
$n = ap + b$ for a non-negative integer $a$ and a positive integer $b$.
$n^2 = pr^2$, so $(ap+b)^2 = pr^2$
I expanded this out to get a quadratic polynomial in $b$:
$b^2 + 2apb + a^2p^2-r^2p = 0$
Using the quadratic formula, I found:
$b = -ap \pm r\sqrt{p}$
Since $a$, $r$, and $p$ are integers, and $p$ is prime, then both of these values of $b$ would therefore be irrational, violating the condition that $b$ must be a positive integer.
I'm not sure if this proof works or not. It doesn't feel very elegant (compared to some of the examples in the book). Could you please critique it?