Here I attempt to solve Pell's equation with d = 1621 following the method on page 93 of Stein's book. But the solution produced is instead a solution of the negative Pell equation x^2-y^2 = -1 (instead of 1). Actually, the example on page 93 (after correcting the typo "v" to "u") has the same problem: it claims that [-2,1] solves Pell's equation with d=5, whereas, it really solves the negative Pell equation.
sage: K.<a> = QuadraticField(1621) sage: G = K.unit_group() sage: u = G.1 sage: L = [list(u^i) for i in [0..3]] sage: L [[1, 0], [4823622127875/2, 119806883557/2], [23267330432525342852015627/2, 577903134597288688851375/2], [56116404965454319198851772383057215250, 1393793173905903098261469193463230841]] sage: x = L[2][0]; sage: y = L[2][1]; sage: x 23267330432525342852015627/2 sage: x = L[3][0]; sage: y = L[3][1]; sage: x 56116404965454319198851772383057215250 sage: y 1393793173905903098261469193463230841 sage: x^2-1621*y^2 -1 -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
