TITLE: Is there a pattern to the signs of the norms of quadratic fundamental units?
QUESTION [12 upvotes]: Let $K$
be the quadratic field $\mathbb{Q}(\sqrt d)$
where $d\in\mathbb{N}_{\geq1}$
is square-free,
and let $\mathbb{Z}_K$
be the ring of integers of $K$.
Define the fundamental unit of $\mathbb{Z}_K$
as the minimal invertible element of $\mathbb{Z}_K$
larger than $1$.
We can necessarily write this fundamental unit as $a+b\sqrt d$
where $a,b\in\mathbb{Q}^+$.
Then, since it is invertible,
its field norm $a^2-db^2$
is $\pm1$.
Here is what the sign of this norm ends up being for the first bunch of
values of $d$.
$2$ $-$
$3$ $+$
$5$ $-$
$6$ $+$
$7$ $+$
$10$ $-$
$11$ $+$
$13$ $-$
$14$ $+$
$15$ $+$
$17$ $-$
$19$ $+$
$21$ $+$
$22$ $+$
$23$ $+$
$26$ $-$
$29$ $-$
$30$ $+$
Given $d$,
is there a way to tell what this sign will be,
than computing the fundamental unit and its product with its conjugation?
I'm also curious what more advanced concepts this sign may be related to.

REPLY [7 votes]: Introductory Algebraic Number Theory by Alaca & Williams deals with this in a fair level of detail in Chapter 11.

Theorem 11.5.4: given prime $d \equiv 1 \pmod 4$, the fundamental unit has norm $-1$. e.g., $d = 5$, $N(\phi) = -1$.
Theorem 11.5.5: if $d$ is divisible by some prime $p \equiv 3 \pmod 4$, the fundamental unit has norm 1. e.g., $N(2 + \sqrt 3) = N(5 + 2 \sqrt 6) = 1$.
Theorem 11.5.6: if $d = 2p$ and $p \equiv 5 \pmod 8$, the fundamental unit has norm $-1$. e.g., $N(3 + \sqrt{10}) = N(5 + \sqrt{26}) = -1$.
Theorem 11.5.7: if $d = pq$ with distinct primes $p \equiv q \equiv 1 \pmod 4$ and $$\left(\frac{p}{q}\right) = \left(\frac{q}{p}\right) = -1$$ (I know that by quadratic reciprocity that's a bit redundant) then the fundamental unit has norm $-1$. e.g., $N(8 + \sqrt{65}) = -1$.

These are from my notes, not directly from the book; hopefully I haven't made any mistakes of transcription. I don't remember if they say anything about the $d$ not covered by these four theorems. Proofs are included for all four of them, I think one or two of them is given more than one proof.