Archimedes posed a riddle about herding cattle... His problem ultimately boiled down to an equation that involves the difference between two squared terms, which can be written as x2 – dy2 = 1. Here, d is an integer — a positive or negative counting number — and Archimedes was looking for solutions where both x and y are integers as well. This class of equations, called the Pell equations, has fascinated mathematicians over the millennia since. Indian mathematician Brahmagupta, and later the mathematician Bhāskara II, provided algorithms to find integer solutions to these equations. In the mid-1600s, the French mathematician...