Pell's Equation/Sequence

Sequence of Minimum Solutions to Pell's Equation
The minimum solutions of $x$ and $y$ for the Diophantine equation $x^2 - n y^2 = 1$ for various values of $n$ are as follows:


 * {| border="1"

! align="right" style = "padding: 2px 10px" | $n$ ! align="right" style = "padding: 2px 10px" | $x$ ! align="right" style = "padding: 2px 10px" | $y$
 * align="right" style = "padding: 2px 10px" | $2$
 * align="right" style = "padding: 2px 10px" | $3$
 * align="right" style = "padding: 2px 10px" | $2$
 * align="right" style = "padding: 2px 10px" | $3$
 * align="right" style = "padding: 2px 10px" | $2$
 * align="right" style = "padding: 2px 10px" | $1$
 * align="right" style = "padding: 2px 10px" | $5$
 * align="right" style = "padding: 2px 10px" | $9$
 * align="right" style = "padding: 2px 10px" | $4$
 * align="right" style = "padding: 2px 10px" | $6$
 * align="right" style = "padding: 2px 10px" | $5$
 * align="right" style = "padding: 2px 10px" | $2$
 * align="right" style = "padding: 2px 10px" | $7$
 * align="right" style = "padding: 2px 10px" | $8$
 * align="right" style = "padding: 2px 10px" | $3$
 * align="right" style = "padding: 2px 10px" | $8$
 * align="right" style = "padding: 2px 10px" | $3$
 * align="right" style = "padding: 2px 10px" | $1$
 * align="right" style = "padding: 2px 10px" | $10$
 * align="right" style = "padding: 2px 10px" | $19$
 * align="right" style = "padding: 2px 10px" | $6$
 * align="right" style = "padding: 2px 10px" | $11$
 * align="right" style = "padding: 2px 10px" | $10$
 * align="right" style = "padding: 2px 10px" | $3$
 * align="right" style = "padding: 2px 10px" | $12$
 * align="right" style = "padding: 2px 10px" | $7$
 * align="right" style = "padding: 2px 10px" | $2$
 * align="right" style = "padding: 2px 10px" | $13$
 * align="right" style = "padding: 2px 10px" | $649$
 * align="right" style = "padding: 2px 10px" | $180$
 * align="right" style = "padding: 2px 10px" | $14$
 * align="right" style = "padding: 2px 10px" | $15$
 * align="right" style = "padding: 2px 10px" | $4$
 * align="right" style = "padding: 2px 10px" | $15$
 * align="right" style = "padding: 2px 10px" | $4$
 * align="right" style = "padding: 2px 10px" | $1$
 * }
 * align="right" style = "padding: 2px 10px" | $13$
 * align="right" style = "padding: 2px 10px" | $649$
 * align="right" style = "padding: 2px 10px" | $180$
 * align="right" style = "padding: 2px 10px" | $14$
 * align="right" style = "padding: 2px 10px" | $15$
 * align="right" style = "padding: 2px 10px" | $4$
 * align="right" style = "padding: 2px 10px" | $15$
 * align="right" style = "padding: 2px 10px" | $4$
 * align="right" style = "padding: 2px 10px" | $1$
 * }
 * align="right" style = "padding: 2px 10px" | $1$
 * }

Note the unusual peak at $13$.

Thus, the sequence for $x$ for non-square $n$ begins:
 * $3, 2, 9, 5, 8, 3, 19, 10, 7, 649, 15, 4, 33, 17, 170, \ldots$

Similarly, the sequence for $y$ for non-square $n$ begins:
 * $2, 1, 4, 2, 3, 1, 6, 3, 2, 180, 4, 1, 8, 4, 39, 2, 12, \ldots$