Solution (source code)

= Solution

The <Dirichlet unit theorem> states that for a <number field> with $r$ real embeddings and $s$ conjugate pairs of complex embeddings,
$$
\mathcal O_K^\times\cong\mu(K)\times\mathbb Z^{r+s-1},
$$
where $\mu(K)$ is its finite group of <roots of unity>. Here $K$ is real quadratic, so $(r,s)=(2,0)$ and $\mu(K)=\{\mathord\pm1\}$. Thus its unit group has rank one.

The element
$$
\varepsilon=1+\sqrt2
$$
is a unit because its <field norm> is
$$
N_{K/\mathbb Q}(\varepsilon)
=(1+\sqrt2)(1-\sqrt2)=-1.
$$
It is the smallest unit greater than one in the chosen real embedding. Indeed, write such a unit as $u=a+b\sqrt2$ and let $u'=a-b\sqrt2=N(u)/u$ be its <algebraic conjugate>. Since $|u'|<1<u$, both $a=(u+u')/2$ and $b=(u-u')/(2\sqrt2)$ are positive integers. Hence $a,b\geq1$ and $u\geq1+\sqrt2$. The rank-one logarithmic lattice in Dirichlet's theorem is therefore generated by $\log\varepsilon$. Consequently the <units of Q of square root two> are
$$
\boxed{\mathcal O_K^\times
=\{\mathord\pm(1+\sqrt2)^n:n\in\mathbb Z\}}.
$$