Is there a pattern to the signs of the norms of quadratic fundamental units? 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.
 A: 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.
A: There are some partial results; if $d\equiv3\pmod 4$ then the fundamental
unit has norm $+1$. The same is true if $d$ has a positive factor congruent
to $3$ modulo $4$. The proof is just working modulo $4$.
On the other hand if $d=p\equiv1\pmod 4$ is a prime, then the fundamental
unit has norm $-1$. To prove this one can show that if $\varepsilon>0$
is a unit of norm $1$ in $K=\Bbb Q(\sqrt d)$ then $\sqrt{\varepsilon}\in K$ also.
Things get more complicated when there are more prime factors.
If $d=pq$ where $p$ and $q$ are primes $\equiv1\pmod 4$ then
one can have both $+1$ and $-1$ as the norm of the fundamental unit.
