I have been playing around with continued fractions, and I have noticed that if $p,q$ are two primes $\equiv 3 \mod 4$, then the continued fraction representation of $\sqrt{\frac{p}{q}}$ has an even period.
Now I know that exactly one of the equations $px^2 - qy^2 = \pm 1$ is solvable. And I also know that, for any $d\in\mathbb{N}$, $x^2 - d y^2 = 1$ is solvable and $x^2 - d y^2 = -1$ is solvable if and only if $\sqrt{d}$ has an odd period. Now I hope that I can make a connection here using the fact that either $px^2 - qy^2 = -1$ or $qy^2 - px^2 = -1$ is not solvable and the other one is. For example assume $qy^2 - px^2 = 1$ is solvable, then $qy^2 - px^2 = -1$ isn't. Then $y^2 - \frac{p}{q}x^2 = \frac{1}{q}$ is solvable and $y^2 - \frac{p}{q}x^2 = -\frac{1}{q}$ is not solvable. Now if $\frac{1}{q}$ was equal to $1$ and $\frac{p}{q}$ was an integer I could readily conclude that the continued fraction of $\sqrt{\frac{p}{q}}$ has an even period, but these are not the case so I don't know how to proceed.