Problem 249. Project Euler: Problem 9, Pythagorean numbers
Solution Stats
Problem Comments
-
4 Comments
The description should be 9 + 16 = 5^2 and not 9+16 = 2^5 ?
Thanks Aurelien! Fixed it.
This is an interesting problem. Apparently everyone (including me) had to solve it by a basic brute force method with oly very slight variations. I did manage to use my MATLAB copy to use solve from the symbolic toolbox to get the answers, but the version of MATLAB on which Cody runs doesn't have access to a license for the symbolic toolbox.
@ Doug Hall, I have solved all the problems in the series. However, I have not received the badge and the associated scores on completion of the series. Can you please help me with this?
Solution Comments
-
1 Comment
Multiple solutions exist in the last test case.
-
1 Comment
This appears to be the smallest legitimate solution (no hiding behind regexp or similar, no exploiting the limited test cases), but it's not vectorized, and runs in O(n^2) time.
-
3 Comments
-
3 Comments
Doug: Just wondering if the last test case is incorrect. It seems like for the input of 3200, the p-triplet should be (700, 1152, 1348) and y_correct should be 1087027200. Please do let me know if I am wrong. Cheers, VL.
There is another one: (640,1200,1360). y_correct = 1044480000.
I just noticed that. I had thrown in a new test suite because someone had hardcoded the solutions in. I guess I did not test it right. Problem solved and submissions are being rescored now.
Problem Recent Solvers828
Suggested Problems
-
Determine if a Given Number is a Triangle Number
356 Solvers
-
Find perfect placement of non-rotating dominoes (easier)
302 Solvers
-
448 Solvers
-
681 Solvers
-
478 Solvers
More from this Author51
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!