Solution (source code)

= Solution

Suppose first that a simple <continued fraction> is eventually periodic. Its periodic tail $\xi$ is fixed by the <Möbius transformation> represented by the <continued-fraction matrix> of one full period:
$$
\xi=\frac{a\xi+b}{c\xi+d}.
$$
Thus
$$
c\xi^2+(d-a)\xi-b=0.
$$
The infinite tail is not <rational number>[rational], since a rational simple continued fraction terminates. Hence $\xi$ is a <quadratic irrational>, and the finite initial block expresses the original number as another rational Möbius transform of $\xi$. Therefore \b[every eventually periodic simple continued fraction represents a quadratic irrational].

For the purely periodic fraction $x=[7,7,7,\ldots]$,
$$
x=7+\frac1x,
$$
so $x^2-7x-1=0$. Positivity selects
$$
\boxed{x=\frac{7+\sqrt{53}}2.}
$$

Apply the <continued-fraction algorithm> to $\sqrt{23}$:
$$
\sqrt{23}
=4+\frac1{\frac{\sqrt{23}-4}{1}}
=4+\cfrac1{1+\cfrac1{3+\cfrac1{1+\cfrac1{8+\cdots}}}}.
$$
The complete quotient then repeats, giving
$$
\boxed{\sqrt{23}=[4;\overline{1,3,1,8}].}
$$
The <continued fraction convergent>[convergents] through one term before the final $8$ are
$$
4,\quad5,\quad\frac{19}{4},\quad\frac{24}{5}.
$$
The last of these satisfies the <Pell equation>
$$
24^2-23\cdot5^2=576-575=1,
$$
so a positive solution is
$$
\boxed{(x,y)=(24,5).}
$$