Units of the quadratic field Q square root of five (source code)

= Units of the quadratic field Q square root of five

For $K=\mathbb Q(\sqrt5)$,
$$
\mathcal O_K=\mathbb Z\left[\frac{1+\sqrt5}{2}\right].
$$
Writing $\phi=(1+\sqrt5)/2$, the full unit group is
$$
\mathcal O_K^\times=\{\mathord\pm\phi^n:n\in\mathbb Z\}.
$$