Problem 1215. Diophantine Equations (Inspired by Project Euler, problem 66)
Consider the quadratic Diophantine equation of the form:
x^2 – Dy^2 = 1
When D=13, the minimal solution in x is 649^2 – 13×180^2 = 1. It can be assumed that there are no solutions in positive integers when D is square.
Given a value of D, find the minimum value of X that gives a solution to the equation.
Solution Stats
Problem Comments
-
4 Comments
How exactly does, "6492 – 13×1802 = 1", as given in the example?
The 2s at the end of 649 and 180 used to be superscripts. I'm not quite sure when that changed, but it is fixed now. Thanks for the heads up on that.
No problem. Thanks for the fix!
Some tips. Continued fractions are the main way for finding the fundamental solutions to Pell's equations. And square roots have patterns in continued fractions.
Solution Comments
Show commentsProblem Recent Solvers69
Suggested Problems
-
Project Euler: Problem 6, Natural numbers, squares and sums.
2530 Solvers
-
What is the distance from point P(x,y) to the line Ax + By + C = 0?
554 Solvers
-
Return elements unique to either input
803 Solvers
-
Given a matrix, swap the 2nd & 3rd columns
1251 Solvers
-
Convert from Fahrenheit to Celsius
27438 Solvers
More from this Author80
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!