Proof that if $n^2/r^2 = p$, with $p$ prime, then $n$ is divisible by $p$ 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?

Your proof is really very overcomplicated. It's also missing something: note that you aren't assuming that $b < p$ anywhere. What goes wrong if I choose $b = p = 2, a = 1, n = 4$?
For a much easier solution: Multiply by $r^2$ to obtain $n^2 = pr^2$. Apply the definition of "prime".
