(35S) Pell's Equation Programme
|
06-07-2014, 09:17 AM
(This post was last modified: 12-25-2018 10:41 AM by Gerald H.)
Post: #1
|
|||
|
|||
(35S) Pell's Equation Programme
The programme finds the primitive integer solution of Pell’s equation
x^2 – D * y^2 = ± 1 for integer input D and 1 or -1 for solution of the +1 or -1 case respectively. Code: 1 LBL P For input 13 & 1 the programme returns [649, 180, 1] & indeed 649^2 – 13 * 180^2 = 1 Similarly input 13 & -1 returns [18, 5, -1] & 18^2 – 13 * 5^2 = -1 Input 7 & -1 returns 0, indicating that x^2 – 7 * y^2 = -1 has no integer solutions for x & y. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)