Solving the Pell Equation

This article by Henrik Lenstra has an intriguing quote:

The key notion underlying the second algorithm is that of “infrastructure”, a word coined by Shanks (see [11]) to describe a certain multiplicative structure that he detected within the period of the continued fraction expansion of √d. It was subsequently shown (see [7]) that this period can be “embedded” in a circle group of “circumference” Rd, the embedding preserving the cyclical structure. In the modern terminology of Arakelov theory, one may describe that circle group as the kernel of the natural map Pic0Z[√d] → PicZ[√d] from the group of “metrized line bundles of degree 0” on the “arithmetic curve” corresponding to Z[√d] to the usual class group of invertible ideals. By means of Gauss’s reduced binary quadratic forms one can do explicit computations in Pic0Z[√d] and in its “circle” subgroup.

I’m a sucker for anything that related elementary topics (like Pell’s equation) to advanced topics that I don’t understand (like Arakelov theory).