For rings of the form , the fundamental unit has the form where (x,y) is the smallest nontrivial solution to Pell's equation x2 - ny2 = 1 or x2 - ny2 = -1. (For example, if n is a prime that is 1 mod 4 then the fundamental unit comes from a solution of the second equation.)