**This is a development version of this entry. It might change over time and is not stable. Please refer to release versions for citations.**

### Abstract

This article gives the basic theory of Pell's equation
*x*^{2} = 1 +
*D* *y*^{2},
where
*D* ∈ ℕ is
a parameter and *x*, *y* are
integer variables.

The main result that is proven
is the following: If *D* is not a perfect square,
then there exists a *fundamental solution*
(*x*_{0},
*y*_{0}) that is not the
trivial solution (1, 0) and which generates all other solutions
(*x*, *y*) in the sense that
there exists some
*n* ∈ ℕ
such that |*x*| +
|*y*| √*D* =
(*x*_{0} +
*y*_{0} √*D*)^{n}.
This also implies that the set of solutions is infinite, and it gives
us an explicit and executable characterisation of all the solutions.

Based on this, simple executable algorithms for computing the fundamental solution and the infinite sequence of all non-negative solutions are also provided.