# Simplifying my Solution for: List the first three positive prime numbers $d$ in $\textbf{Z}$ so that the quadratic integers in…

Here is the question I have answered: List the first three positive prime numbers $d$ in $\mathbb{Z}$ so that the quadratic integers in $\mathbb{Q}(\sqrt{d})$ are precisely the ones of the form $a + b \sqrt d$, where $a$ and $b$ are rational integers. List the first three positive prime numbers $d$ so that the quadratic integers in $\mathbb{Q}(\sqrt{d})$ are precisely the ones of the form $$\frac{a + b \sqrt d}{2},$$ where $a$ and $b$ are rational integers and $a$ and $b$ are either both even or both odd.

Do the same when $\sqrt d$ is replaced by $\sqrt{−d}$.

Here is my solution: If $$\frac{a + b \sqrt d}{c}$$ is an algebraic integer then its irreducible monic polynomial $f(X)$ in $\mathbb{Q}[X]$ has coefficients in $\mathbb{Z}$. Since conjugation : $\sqrt d \to -\sqrt d$ is a automorphism that fixes $\mathbb Q$ then $$\frac{a - b \sqrt d}{c}$$ is also a root of $f(X)$. So $$f(X) = \left(X - \frac{a + b \sqrt d}{c}\right)\left(X - \frac{a - b \sqrt d}{c}\right) = X^2 - 2 \frac{a}{c} X + \frac{a^2 - db^2}{4}.$$

i) $\frac{2a}{c}$ an integer implies $c = 1$ or $2$.

ii) If $c = 2$ then $$\frac{a^2 - db^2}{4}$$ an integer implies $a^2 \equiv db^2 \bmod 4$. If $b$ is odd then so are $a$ and $d$ ($d$ is prime so either $2$ or odd)}. Working modulo $4$, $0 = (a - b)(a + b) = a^2 - b^2 = (d - 1)b^2 \bmod 4$, so that $d \equiv 1 \bmod 4$.

When $d \equiv 3 \bmod 4$ or $2$ then clearly $\mathbb{Z}[\sqrt d]$ is a ring, i.e., closed under addition and multiplication. When $d \equiv 1 \bmod 4$ then $$\frac{1 + \sqrt d}{2^2} = \frac{1 + d^2}{2} + \frac{\sqrt d}{2},$$ and since $d^2 \equiv 1 \bmod 4$ then $\frac{1 + d^2}{2}$ in an odd integer, so again $$\mathbb{Z}\left[\frac{1 + \sqrt d}{2}\right]$$ is a ring closed under addition and multiplication.

So the ring of integers in $\mathbb{Q}(\sqrt d)$ is $$\mathbb Z\left[\frac{1 + \sqrt d}{2}\right]$$ when $d \equiv 1 \bmod 4$, and $\mathbb Z[\sqrt d]$ when $d ≡ 3$ mod $4$, or $d = 2$.

This means $5, 13,$ and $17$ are the first few primes where the ring of algebraic integers is of the form $$\mathbb Z\left[\frac{1 + \sqrt d}{2}\right],$$ and $-3, -7, -11$ the first few negative ones. $2, 3, 7, 11$ are the first few primes for $\mathbb Z[\sqrt d]$ and $-2, -5, -13$ the first few negative ones.

However, I am looking to find a simpler solution. Can someone post a solution that does not involve quadratic integer notions like rings, fields, field extensions, splitting fields (I don't know how splitting fields could be used here in any circumstance, but I am not experienced enough to be able to say that with certainty). Thanks!

• I was getting hung up on the notation. I started to spruce it up, but I have to go to work now, so maybe I finish it later or someone else does. – Robert Soupe Aug 31 '16 at 12:11
• I'm not sure you've made your meaning clear. Consider for example $d = 5$. Then $5 = (\sqrt 5)^2$ but 2, 3, 7, 13, 17 are prime. On the imaginary side, we similarly have $5 = -(\sqrt{-5})^2$ but 2, 3, 7 are irreducible, 11, 13, 17 are prime. The point is that 5 is not prime in either of those. Or look at $d = 13$; on both the real and imaginary domains we have that 13 is not prime, it ramifies (you've encountered that terminology before, right?). 5 is prime but $$\left(\frac{9 - \sqrt{13}}{2}\right) \left(\frac{9 + \sqrt{13}}{2}\right) = 17.$$ – Bill Thomas Aug 31 '16 at 21:01
• What are you not sure about in terms of my clarity? – Crazed Aug 31 '16 at 21:15
• @RobertSoupe I finished the TeX notation. Thanks for starting (and doing most of) it! – Crazed Sep 1 '16 at 0:07
• The only way I see the solution not involving those concepts is for the question to not involve them either. Then you're asking for the prime $d$ closest to $0$ such that $$\frac{x^2}{4} - \frac{dy^2}{4} = p$$ has an integer solution for some prime $|p| \neq |d|$, and the other primes in the vicinity have solutions to $x^2 -dy^2 = p$. – Mr. Brooks Sep 1 '16 at 21:32

If I'm understanding correctly, you just need to determine which quadratic integer rings have "half-integers," which ones don't, and then pick out a few small primes from each.

Maybe, as Mr. Brooks suggested in a comment, there's no way to answer this question without invoking algebraic number theory concepts. But maybe at least it can be done using the simpler concept of norm.

Given rational real numbers $a$ and $b$ and a squarefree number $d$, the norm of $a + b \sqrt{d}$ is $(a - b \sqrt{d})(a + b \sqrt{d}) = a^2 - db^2$. The number $a + b \sqrt{d}$ is an algebraic integer if its norm is an integer, otherwise it's an algebraic number but not an algebraic integer.

It is easy to see that if both $a$ and $b$ are integers, then $N(a + b \sqrt{d})$ is an integer as well. It takes a lot more work, which I won't show here, to prove that if either $a$ or $b$ is rational but not an integer, the only way for $N(a + b \sqrt{d})$ to be an integer is if both $a$ and $b$ are fractions so that the numerators are odd and the denominators are equal to 2 or $-2$, and $d \equiv 1 \pmod 4$. I guess this is the inexcusable yada, yada, yada part of my answer.

The first few positive integers satisfying that congruence are 1, 5, 9, 13, 17, 21, 25, 29, ..., see http://oeis.org/A016813 From that, we pick out the primes: 5, 13, 17, 29, ... http://oeis.org/A002144

From here, it's a simple matter of repeating this process of picking out primes for negative $d \equiv 1 \pmod 4$, then the positive and negative integers that satisfy that congruence.

• your argument is that if $a+b \sqrt{d}$ is the root of an irreducible monic polynomial $P \in \mathbb{Z}[x]$ then it is of degree $2$ so $P(x) = (x-a-b\sqrt{d})(x-a+b\sqrt{d}) = x^2-2ax + a^2-b^2d$ and $2a \in \mathbb{Z}$ ? – reuns Sep 2 '16 at 2:47
• How do I prove the "yada yada yada" part (I have a feeling it's crucial to my own understanding), and/or solve the part where the square root of d is replaced by the square root of -d? I feel like I am missing something, and feel like an idiot. Thanks! – Crazed Sep 2 '16 at 2:54
• @user1952009 That sounds about right, but it also sounds like you have a much better grip on this than I do. – Robert Soupe Sep 2 '16 at 3:31
• If $d$ is negative, then the norm works out to a sum rather than a subtraction, and the congruences kind of take care of you. Maybe these two little exercises will clarify things: First, compute $$N\left(\frac{1}{2} + \frac{\sqrt{-11}}{2}\right),$$ then compute $$N\left(\frac{5}{2} + \frac{\sqrt{13}}{2}\right).$$ – Robert Soupe Sep 2 '16 at 3:36
• @Crazed $P(x) = x^2-2ax + a^2-b^2d$ is an irreducible polynomial of $\mathbb{Q}[x]$ having $a+b \sqrt{d}$ as one of its root. Hence the minimal polynomial $R \in \mathbb{Z}[x]$ of $a+b \sqrt{d}$ is $R = k P$ for some $k \in \mathbb{Z}$. And $R$ is monic means $k=1$. i.e. $2a \in \mathbb{Z}, a^2-b^2 d \in \mathbb{Z}$. – reuns Sep 2 '16 at 3:56

I will try to fill in the hole skipped over by the first answerer. Well, he's right, it does take a lot of work to try to do it by elementary means.

Given $a, b \in \textbf Q$, and $d \in \textbf Z$ squarefree, what are the conditions necessary for $a^2 - db^2 = N \in \textbf Z$ to hold true?

If $a, b \in \textbf Z$, then $a^2 - db^2 = N \in \textbf Z$ is trivially true because $\textbf Z$ is closed under addition and multiplication.

If one or both of $a$ and $b$ are rational but not integers, things get a lot more complicated. To try to keep things simple, let's express $a$ and $b$ as fractions in lowest terms with positive denominators: $$a = \frac{p}{q}, b = \frac{r}{s},$$ $p, r \in \textbf Z$, $q, s \in \textbf Z^+$, $\gcd(p, q) = \gcd(r, s) = 1$.

Let us now further suppose that $q \neq s$. Then $$a^2 - db^2 = \frac{p^2 s^2}{q^2 s^2} - \frac{dr^2 q^2}{q^2 s^2}.$$ Although $d$ may seem to be a wildcard in all of this, remember that it is still squarefree. It may share prime factors with any of $p, q, r, s$, but we're guaranteed a deficit of factors and thus this number is not an integer.

Therefore $q = s$ is a must. Arbitrarily, I will ditch $s$ and use $q$ henceforth. Then $$a = \frac{p}{q}, b = \frac{r}{q}.$$ We need not worry about $q = 1$, this would mean $a, b \in \textbf Z$ and we already went over that.

Moving on to $q = 2$, we see that both $p$ and $r$ must be odd so as to not contradict the assertion that the two fractions are in lowest terms. Then we have $$a^2 - db^2 = \frac{p^2 - dr^2}{4}.$$ Since $p$ is odd, this means that $p^2 \equiv 1 \bmod 4$. Likewise, $r^2 \equiv 1 \bmod 4$. Then, for this thing to be an integer, we need $d \equiv 1 \bmod 4$ so that $p^2 - dr^2$ works out to be a multiple of $4$.

I still have left to prove that $q > 2$ fails to give integers. But it's almost the Sabbath now.