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).
Who Has the Most Change?
Find all elements less than 0 or greater than 10 and replace them with NaN
Summing Digits within Text
03 - Matrix Variables 4
Integer Sequence - II : New Fibonacci
Path of least resistance - Move all direction
Graph Algorithms - 2 : Chromatic Number
Let's see how peculiar we can get
Construct a precedence graph from a code segment
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office