27.4 The polygonal numbersPn,k 723
27.4.1 Appendix: Solution of Pell’s equation
(1) Letdbe a positive integer which is not a square. The positive integer
solutions of the equationx^2 −dy^2 =1can be arranged in a sequence as
follows. If(x, y)=(a, b)is the smallest positive solution, then
(
xn+1
yn+1
)
=
(
adb
ba
)(
xn
yn
)
,
(
x 1
y 1
)
=
(
a
b
)
.
(2) If the equationx^2 −dy^2 =− 1 has a solution in nonzero integers,
its integer solutions can be arranged in the form a sequence satisfying the
same recurrence relation above (with(a, b)the smallest positive solution
ofx^2 −dy^2 =1) but with(x 1 ,y 1 )given by its smallest positive solution.