The simple continued fraction algorithm for begins with . Its complete quotients repeat after
Thus
The convergents through one period are
The last one gives the negative Pell equation solution
Therefore