# Given $d \equiv 1 \pmod 4$, can $\mathcal{O}_{\mathbb{Q}(\sqrt{d})}$ have a fundamental unit that is not a “half-integer”?

Also $d > 0$, $\mu(d) \neq 0$.

I acknowledge the term "half-integer" is, at best, problematic. What I mean by it is that an integer in $\mathcal{O}_{\mathbb{Q}(\sqrt{d})}$ is of the form $\frac{a + b \sqrt{d}}{2}$ with $a$ and $b$ both odd.

Please bear with me, I'm very new to this subject. If I've done it correctly, the fundamental units in $\mathcal{O}_{\mathbb{Q}(\sqrt{d})}$ for $d = 5, 13, 17, 21$ are $$\frac{1 + \sqrt{5}}{2}, \frac{3 + \sqrt{13}}{2}, \frac{5 + 3 \sqrt{17}}{2}, \frac{5 + \sqrt{21}}{2}.$$

Can the fundamental unit in such a domain possibly be of the form $a + b \sqrt{d}$ rather than $\frac{a + b \sqrt{d}}{2}$? And if so, when factoring other integers in that domain, how can you be sure you haven't overlooked a "half-integer" factor?

EDIT: It's been pointed out that I screwed up the calculation in $\mathcal{O}_{\mathbb{Q}(\sqrt{17})}$. Still, I appreciate any insights you all might have regarding fundamental units in these domains.

• It turns out that fundamental units in the rings of integers you describe are always "half-integers". en.wikipedia.org/wiki/… – Greg Martin Jul 14 '15 at 21:25
• @Greg, as much as I'd love to say that Wikipedia led you down the wrong path, it seems that I can't. But I can at least say that that article, technically correct though it may be, is very poorly written and needlessly confusing. – Robert Soupe Jul 15 '15 at 0:36

Yes, it can. An arithmetic mistake on your part has masked an example you would otherwise have found yourself. Verify that $$N\left(\frac{5}{2} + \frac{3\sqrt{17}}{2}\right) = \frac{25}{4} - \frac{153}{4} = -32.$$
In order for $\mathcal{O}_{\mathbb{Q}(\sqrt{d})}$ to have a half-integer fundamental unit, there has to be a solution to $x^2 - dy^2 = \pm 4$ with $x$ and $y$ both odd, and there isn't when $d = 17$. Consider this modulo 16: the odd squares are 1 and 9, and since $17 \equiv 1 \pmod{16}$, we see that $1 - 1 = 0$, $1 \pm 9 = 8$, $9 - 9 = 0$. But $4 \not\equiv 0$ nor $8 \pmod{16}$. Hence the fundamental unit of $\mathcal{O}_{\mathbb{Q}(\sqrt{17})}$ is $4 + \sqrt{17}$.
At least for primes $p$ what you can do is see whether you can solve $x^2 - dy^2 = \pm 4p$ with $x$ and $y$ odd. For composite numbers, you take this to the constituent prime factors, but if $\mathcal{O}_{\mathbb{Q}(\sqrt{d})}$ is not UFD then you also have to watch out for potentially multiple distinct factorizations, as well as non-obviously non-distinct factorizations (fun, right?).
Finding the fundamental unit of a particular real quadratic integer ring is something your favorite computer algebra system can do much more quickly and reliably than you can. For example, with Wolfram Mathematica you can do NumberFieldFundamentalUnit[Sqrt[n]] (I believe this also works in Wolfram Alpha).
Let me give you an example that is neither one more than a power of 2 nor one more than a square: given $d = 41$, we have $32 - 5\sqrt{41}$ as the fundamental unit.