Relation between units in $\mathbb{Q}(\sqrt{13})$ and integral solutions to $x^2 - 13y^2 = \pm 1$ I have shown that in the number ring of $\mathbb{Q}(\sqrt{13})$, the units are precisely  $\pm \left(\frac{3+\sqrt{13}}{2} \right)^n$.
How can one deduce the integral solutions to the related Pell's equation in this manner?
 A: The theorem which links $\mathbb{Q}(\sqrt{D})$ and $\mathbb{Z}(\sqrt{D})$ is called Dirichlet unit theorem , a very interesting reference could be Direchlet's unit theorem.
So for example the units in $\mathbb{Q}(\sqrt{13})$ are $\mp \epsilon^n$ where $\epsilon=\frac{1+\sqrt{13}}{2}$ then this implies using the theorem that the unit group of any order in this field has the form $\mp a^{\mathbb{Z}}$ for some unit $a$.
This can be applied in particular for the ring of the integers of the field, $\mathbb{Z}(\sqrt{13})$ which represents exactly the solutions of the given Pell equation. the solutions will be $$ x+\sqrt{13}y=(18+5\sqrt{13})^n=a^n$$ with $a=\epsilon^3$ is the smallest integer in the units of the field.
A: The connection is the norm function: $$N\left(\frac{a}{2} + \frac{b \sqrt{13}}{2}\right) = \left(\frac{a}{2} - \frac{b \sqrt{13}}{2}\right)\left(\frac{a}{2} + \frac{b \sqrt{13}}{2}\right) = \frac{a^2}{4} - \frac{13b^2}{4}.$$ It's important that $a$ and $b$ be of the same parity. But if $a$ and $b$ are both even, you can just halve them both without regard for the new parity and do $$N(a + b \sqrt{13}) = a^2 - 13b^2.$$ This should remind you of the $x^2 - 13y^2 = \pm 1$ equation. So what you need here are those powers of $\frac{3}{2} + \frac{\sqrt{13}}{2}$ that are of the form $a + b \sqrt{13}$ with $a, b \in \mathbb{Z}$. This turns out to be $\left(\frac{3}{2} + \frac{\sqrt{13}}{2}\right)^{3n}$. Indeed:


*

*$N(18 +  5 \sqrt{13}) = -1$ and $18^2 - 13 \times 5^2 = -1$.

*$N(649 +  180 \sqrt{13}) = 1$ and $649^2 - 13 \times 180^2 = 1$.

*$N(23382 +  6485 \sqrt{13}) = -1$ and $23382^2 - 13 \times 6485^2 = -1$.

*etc.

