Given, a positive value (d), determine the fundamental solution [x, y] of the Pell equation: x^2 - d*y^2 = 1.
Provide character arrays of the outputs (x and y).
For example:
d=5;
[x,y]=pell(d)
x =
'9'
y =
'4'
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers4
Suggested Problems
-
Project Euler: Problem 8, Find largest product in a large string of numbers
1331 Solvers
-
Find the stride of the longest skip sequence
194 Solvers
-
Number of 1s in a binary string
11630 Solvers
-
1072 Solvers
-
Mersenne Primes vs. All Primes
855 Solvers
More from this Author65
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
The value of x_correct in Test #1 should be 1079 rather than 1089. I have verified this using the tabulated results for x and y in the Wikipedia.
Oh, I see. If you use (x,y) = (1,0) for the 10 cases in which d is a perfect square, then x_correct does become 1089 in Test #1.