Hello, Rifat. I guess, based on the Test Suite, that you are allowing _all_ integers, which is not what might be expected given that Fermat's Last Theorem traditionally involves natural numbers only (1, 2, 3, 4, ...). https://www.britannica.com/science/Fermats-last-theorem It might be worth mentioning in the Problem Statement. —DIV
For the test for x=1, I think the answer should be an empty vector.
x=1 makes sense if you also consider 0. Then 0^2 + 1^2 = 1
As David Verrelli pointed out, negative integers are also accepted in this problem (not only zero).
The Goldbach Conjecture, Part 2
1300 Solvers
Program an exclusive OR operation with logical operators
641 Solvers
234 Solvers
Back to basics 4 - Search Path
325 Solvers
Replace Nonzero Numbers with 1
184 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!