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?

You proof does not work because you did not use the fact that $n$ is not divisible by $p$ (you could have $b=0$ for instance). Also, when defining $b$, I think it would be more convenient to say that $n=ap+b$ is the euclidean division of $n$ by $p$ (this also implies that $0<b<p$). What is wrong in you proof is that the initial equation is false. Indeed you found a contradiction without using the fact  that $n$ is not divisible by $p$ so the initial hypothesis is false, that is $n^2=pr^2$. You can see that by writing $2v_p(n)=1+2v_p(r)$ which is not possible because the LHS is even and the RHS is odd.
