Moreover, we can sort all solutions into increasing order by (which is an increasing function of for , given that ). Now it's easy to see that all solutions in positive integers are ``powers'' of the smallest solution, assuming that any solutions exist. There are several ways to show that solutions exist. One method uses continued fractions and has been known at least for 1000 years (it occurs in an old Indian text); it is probably the best method for explicitly computing solutions. ASIDE: What does this have to do with algebraic numbers? What we've done is to classify the algebraic integers in the field whose products with their conjugates equal 1. An analogous classification can be made for an arbitrary number field, which solves the Pell equation along the way. What about the equation when ? The situation is more complicated, so one needs to know a bit more to make progress. For example, given that has unique factorization, one can prove the following. (Note the resemblance to the proof that a prime is the sum of two squares.)

- One can prove the law of quadratic reciprocity by working with number fields containing roots of unity. (Quadratic reciprocity will be described in Oaz's talk.)
- Lamé gave a proof of Fermat's Last Theorem for -th powers assuming that the number field has unique factorization. Unfortunately, this only holds for finitely many primes . Fortunately, Kummer gave a proof that also works if the class number of is not divisible by . Unfortunately, no one has proved that there are infinitely many such . Fortunately, numerical evidence and heuristics suggest that about of primes have this property. (More fortunately, Fermat's Last Theorem has now been proved by Wiles et al.)