TITLE: Simple proof that $t^2 - du^2 = -4$ has no integer solution when $d = n^2-4$, $d \neq 5$.
QUESTION [2 upvotes]: One can show that if $n \geq 3$ is a positive integer, $d=n^2-4$, and $\varepsilon = 1$ if $n$ is odd and $\varepsilon = 0$ if $n$ is even, then the continued fraction expansion of $\frac{\sqrt{d}+\varepsilon}{2}$ has period of even length of the form $(1,n-2)$.  One can show that such a continued fraction has period of odd length if and only if the negative Pell equation $t^2 - du^2 = -4$ has a solution.  Thus it has no solution when $d=n^2-4$ except when $d=5$, since then the period degenerates to $(1)$.  It takes some work to prove all of the details here.
However, in Barbeau's book "Pell's equation", Exercise 3.11, he says to take an odd positive integer $n$ and set $d = n^2-4$.  Part (b) of the exercise says to show that $d$ has a prime factor congruent to 3 modulo 4 and hence show that the negative Pell equation $t^2 - du^2 = -4$ has no solution.  But the claim is false: when $n=3$ or $n=15$, for instance, $d$ has no prime factor congruent to 3 modulo 4. 
It gets me wondering, though, if he had something else in mind.  Is there a short, simple proof that $t^2 - du^2 = -4$ has no solution for $d = n^2-4$, excepting the case $d=5$, perhaps just using some tricky algebra, congruence conditions, quadratic reciprocity, etc.?

REPLY [2 votes]: Start with the unit $\eta = \frac{n + \sqrt{d}}2$. It has norm $+1$, so if there is a unit with norm $-1$ then $\eta$ is a square, say $\eta = \varepsilon^2$ for
$\varepsilon = \frac{a+b\sqrt{d}}2$. This leads to $ab=1$, and there are finitely many possibilities left.
{"set_name": "stack_exchange", "score": 2, "question_id": 2025007}