Is there a formula in $d$ for units of $\mathbb{Z}[\sqrt{d}]$?

252 Views Asked by At

Dirichlet's Unit Theorem tells us all units in the integer ring of a real quadratic field, say $\mathbb{Z}[\sqrt{d}]$, are powers of a single "fundamental unit". Meaning there exists $\alpha=a+b\sqrt{d}$ such that $N(\alpha)=a^2-db^2=\pm1$ and that for any other unit $\beta$ there exists an integer $k$ such that $\beta=\alpha^k$.

What I'm wondering is whether there's a formula for $a$ and $b$ in terms of $d$. For $d=2$ for example, we have $a=b=1$ and $\alpha=1+\sqrt{2}$.

I understand also that $a^2-db^2=\pm1$ is essentially a solution to Pell's equation. One can find a table of solutions for $d=1,...,128$ on Wikipedia $-$ but no formula. That same wikipedia article also points out that the smallest solutions for some particular $d$ can be very large relative to $d$. For example, with $d=313$, the smallest solution is $$a, b = 32188120829134849, 1819380158564160.$$ That's not encouraging for the existence of a formula.

This came up because in a theorem on $\mathbb{Z}[\sqrt{2}]$ I'm hoping to generalize to $\mathbb{Z}[\sqrt{d}]$ in general. The most encouraging route for proving the generalization makes heavy use of the value of $b$.

What branch of math should one even walk down in hopes of spotting an answer?

2

There are 2 best solutions below

0
On

Not formula but algorithm of course exist. In pari/gp command bnfinit('X^2-d).fu return fundamental unit.

gp-code:

pell(d,c)=
{
 Q= bnfinit('X^2-d);
 fu= Q.fu[1]; print("Fundamental Unit: "fu);
 N= bnfisintnorm(Q, c);  print("Fundamental Solutions (Norm): "N);
 for(k=1, #N, n= N[k];
  for(j=0, 10,
   s= lift(n*fu^j);
   X= abs(polcoeff(s, 0)); Y= abs(polcoeff(s, 1));  
   if(X^2-d*Y^2==c, print("("X","Y")"))
  )
 )
};

output:

? \r pell.gp
? pell(313,1)
Fundamental Unit: Mod(7170685*X - 126862368, X^2 - 313)
Fundamental Solutions (Norm): [1]
(1,0)
(32188120829134849,1819380158564160)
(2072150245021969438104715652505601,117124856755987405647781716823680)
(133397244925777070843301583468593656588455084443649,7540058082713667504003446125203741470945194284480)
(8587613275889215956205760812400537768252316119048299561978672742401,485400601250164750241979240919394389707542655611270208094258863360)
(552838267516409253358132372595800070340504977256013299427006204808514294767053621249,31248266407150014445246836522457089108081590057422041460298879378912896332616180800)
0
On

There is almost certainly no formula for $\mathbb{Z}[\sqrt{d}]$ in general. However, there are families of real quadratics for which we can say something about the fundamental unit. Particularly we want solutions to $$N(\alpha)=N(a+b\sqrt{d})=a^2-b^2d=\pm1.$$

We can solve this parametrically choosing $d=t^2+1$. It follows that $\alpha=t+\sqrt{d}$ is a unit. And we can see it is the principal unit by noting that the coeffiicent of $\sqrt{d}$ cannot be made any closer to zero. In this example, choosing $t=1$ gives the unit $1+\sqrt{2}$ in $\mathbb{Z}[\sqrt{2}]$. So for $d=2,5,10,17,26,...$ we can suppose that $b=1$. By similar logic one can show also that $b=1$ when $d=t^2-1$.

We could view this the other way round too: we first assume $b=1$. From here, we note that $a^2-d=\pm1$ rearranges into $d=a^2\mp 1$. Or again, choosing $b=2$ we obtain $d=(a^2\mp1)/4$ which is solved by $a=2t+1$ and choosing "$-1$" for the "$\mp1$". Simplifying it all gives us $d=t^2+t$. Thus we get a statement like "If $d$ is of the form $t^2+t$ for some integer $t$, but is not of the form $t^2\pm1$ for any other integer $t$, it follows that the fundamental unit is of the form $a+2\sqrt{d}$."

More generally, if $d$ is of the form $t(b^2t\pm2$) then we have a unit of the form $$\alpha=(b^2t\pm1)+b\sqrt{d}.$$ This will be our principle unit if $b$ is the smallest positive integer such that $d=t(b^2t\pm2)$ is solvable in an integer $t$. This gives us a sort of sieve process:

$$\begin{array}{c|c|c|c|c|c|c} d & b & t^2\pm1 & t^2+t & t(9t\pm2) & t(16t\pm 2) & ...\\ \hline 1 & [\text{square}] & & & & & \\ 2 & 1 & \times & \times & & & \\ 3 & 1 & \times & & & & \\ 4 & [\text{square}] & & & & & \\ 5 & 1 & \times & & & & \\ 6 & 2 & & \times & & & \\ 7 & 3 & & & \times & & \\ 8 & 1 & \times & & & & \\ 9 & [\text{square}] & & & & & \\ 10 & 1 & \times & & & & \\ 11 & 3 & & & \times & & \\ 12 & 2 & & \times & & & \\ 13 & & & & & & \\ 14 & 4 & & & & \times & \\ 15 & 1 & \times & & & & \\ 16 & [\text{square}] & & & & & \\ 17 & 1 & \times & & & & \\ 18 & 4 & & & & \times & \\ 19 & & & & & & \\ 20 & 2 & & \times & & & \\ ... & & & & & & \\ \end{array}$$

Interestingly, some values of $d$ are missed entirely. For $d\le 20$ we have the exceptions $d=13,19$ with units $649+180\sqrt{13}$ and $170+39\sqrt{19}$ respectively (from https://en.wikipedia.org/wiki/Pell%27s_equation). The exceptions continue $$13,19,21,22,28,29,31,33,39,41,43,44,45,46,52,53,54,55,57,58,59,61,67,69,...$$ Since all these families grow like $\Theta(t^2)$ they unfortunately will cover a smaller and smaller percentage of the positive integers. Also $d=313$ is, in fact, on the list.