The generalized Pell equation is of the form:
. Given D and N as inputs, output the first 50 positive integer solutions [x, y] sorted by x (smallest to largest). Both outputs should be a cell array of character arrays containing the integer solutions.
Solution Stats
Problem Comments
1 Comment
Solution Comments
Show comments
Loading...
Problem Recent Solvers3
Suggested Problems
-
middleAsColumn: Return all but first and last element as a column vector
652 Solvers
-
Make a run-length companion vector
661 Solvers
-
The sum of the numbers in the vector
645 Solvers
-
Write c^3 as sum of two squares a^2+b^2
331 Solvers
-
Lights Out 8 - 5x5, light-only solution? I
17 Solvers
More from this Author63
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Using a combination of a so-called 'brute-force' algorithm and the general solution to the Pell-equation (see e.g. a nice paper by Robertson), I get much more solutions with small positive x than seem to be considered by the creator of the problem. The assigned 20-th solution of case 1 is my 30-th solution. Please rework the problem.