Problem 2370. Fermat's last theorem - again
For a given integer n, express it as a sum of two squares if possible. Return empty matrix otherwise. Solution may not be unique and uniqueness will not be checked, so return one of the solutions. Example:
n=25 Output=[3 4]
n=41 Output=[5 4]
n=7 Output=[]
Solution Stats
Problem Comments
-
1 Comment
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
Solution Comments
Show commentsProblem Recent Solvers39
Suggested Problems
-
Make the vector [1 2 3 4 5 6 7 8 9 10]
52471 Solvers
-
Return the largest number that is adjacent to a zero
5506 Solvers
-
4754 Solvers
-
How many trades represent all the profit?
613 Solvers
-
Relative ratio of "1" in binary number
1579 Solvers
More from this Author44
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!