Determining ring of integers for $\mathbb{Q}[\sqrt{17}]$

I'm trying to find the ring of integers of $\mathbb{Q}[\sqrt{17}]$, and it comes down to determining the set $\{(a,b)\in\mathbb{Q}^2\mid 2a\in \mathbb{Z}, a^2-17b^2\in\mathbb{Z}\}$. How can I determine this set?

Theorem: If $d\equiv 1\pmod{4}$, then $\mathcal{O}_{\mathbf{Q}[\sqrt{d}]}=\mathbf{Z}\left[\frac{-1+\sqrt{d}}{2}\right]$. Otherwise, $\mathcal{O}_{\mathbf{Q}[\sqrt{d}]}=\mathbf{Z}[\sqrt{d}]$.

Proof: Let $\alpha=r+s\sqrt{d}\in\mathbf{Q}(\sqrt{d})$. Then, $\alpha\in\mathcal{O}_{\mathbf{Q}[\sqrt{d}]}$ iff $2r, r^2-s^2d\in\mathbf{Z}$. Clearly $2r\in\mathbf{Z}$, so $4s^2d\in\mathbf{Z}$, and since $d$ is squarefree, $2s\in\mathbf{Z}$. Substituting $m=2r, n=2s$, we get $r^2-ds^2\in\mathbf{Z}\implies 4|(m^2-dn^2)$. Now, if $d\equiv 2,3\pmod{4}$, then $$m^2-dn^2\equiv m^2+2n^2, m^2+n^2\pmod{4}.$$ Note that for these to be divisible by $4$, we must have that $m,n$ are both even, which happens iff $r,s\in\mathbf{Z}$, so this takes care of the case where $d\not\equiv 1\pmod{4}$.

Now if $d\equiv 1\pmod{4}$, then $m^2-dn^2\equiv m^2-n^2\pmod{4}$, but since $4|(m^2-n^2)$ iff $m\equiv n\pmod{2}$, we get $$\mathcal{O}_{\mathbf{Q}(\sqrt{d})}=\left\{\frac{m+n\sqrt{d}}{2}:m\equiv n\pmod{2}\right\}.$$ Now, note that $$\frac{1}{2}(m+n\sqrt{d})=\frac{m+n}{2}+n\left(\frac{-1+\sqrt{d}}{2}\right).$$ Since $m$ and $n$ have the same parity, $\frac{m+n}{2}$ is an integer, so $\mathcal{O}_{\mathbf{Q}(\sqrt{d})}\subset \mathbf{Z}+\frac{-1+\sqrt{d}}{2}\mathbf{Z}$, and to see the reverse just note that since $d$ is of the shape $4k+1$, $\frac{1}{2}(-1+\sqrt{d})\in\mathcal{O}_{\mathbf{Q}(\sqrt{d})}$, so we're done. $\Box$

$17\equiv 1\pmod{4}$, so $\mathcal{O}_{\mathbf{Q}[\sqrt{17}]}=\mathbf{Z}\left[\frac{-1+\sqrt{17}}{2}\right]$.

• How do we say that $2s \in \mathbb{Z}$ ? – Ninja Apr 18 '17 at 12:15
• Is $d$ allowed to be negative? – Akiva Weinberger Jul 12 '17 at 23:26
• @AkivaWeinberger: Yes, I believe it's quite general. – Ted Shifrin Jul 12 '17 at 23:47

Let $D$ be a squarefree number. The element $a+b\sqrt{D}\in\Bbb Q(\sqrt{D})=K$ has minimal polynomial

$$x^2-2ax+(a^2-Db^2).$$

Thus $a+b\sqrt{d}\in{\cal O}_K\Leftrightarrow a\in\frac{1}{2}\Bbb Z,a^2-Db^2\in\Bbb Z$. If $b$ is not an integer, then can $a$ an integer? And, furthermore, what is the only possible denominator for $b$? Now try to show that $a,b$ can be the appropriate types of fractions if and only if $D$ is a quadratic residue mod $4$.
{"ft_lang_label":"__label__en","ft_lang_prob":0.5032724,"math_prob":1.0000087,"size":2492,"snap":"2019-43-2019-47","text_gpt3_token_len":1079,"char_repetition_ratio":0.16921222,"word_repetition_ratio":0.0,"special_character_ratio":0.40650082,"punctuation_ratio":0.112227805,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":1.0000098,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-10-15T04:04:59Z\",\"WARC-Record-ID\":\"<urn:uuid:e926df1b-fece-46ee-8d07-d9edd501b86f>\",\"Content-Length\":\"149151\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:5a081cfa-1201-4028-b190-ec0f6493abd8>\",\"WARC-Concurrent-To\":\"<urn:uuid:85bf0fdd-231d-4e43-a6f4-38b2488c21d6>\",\"WARC-IP-Address\":\"151.101.193.69\",\"WARC-Target-URI\":\"https://math.stackexchange.com/questions/654202/determining-ring-of-integers-for-mathbbq-sqrt17\",\"WARC-Payload-Digest\":\"sha1:46MENK4WKKACEUD5JNE2Y5UIXD2LTWT4\",\"WARC-Block-Digest\":\"sha1:5OPTNTISY7G2AWXU5IGLKAPEFA7WBHRO\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-43/CC-MAIN-2019-43_segments_1570986655864.19_warc_CC-MAIN-20191015032537-20191015060037-00441.warc.gz\"}"}