Problem 249. Project Euler: Problem 9, Pythagorean numbers
A Pythagorean triplet is a set of three natural numbers, a b c, for which,
a^2 + b^2 = c^2
For example,
3^2 + 4^2 = 9 + 16 = 5^2 = 25.
There exists exactly one Pythagorean triplet for which a + b + c = N (the input).
Find the product abc.
Solution Stats
Problem Comments
-
6 Comments
Show
3 older comments
Srishti Saha
on 13 Oct 2018
@ 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?
Brandon
on 23 May 2023
Wow, all the triangles are in the ratio of 8:15:17? Pretty huge oversight.
Christos Saragiotis
on 26 Nov 2023
People have realized that all test cases are based on the primitive Pythagorean triplet (8, 15, 17) and the solutions are full of hacks. This is quite annoying as one cannot compare one's solution with other valid ones.
Solution Comments
Show commentsProblem Recent Solvers1299
Suggested Problems
-
Replace NaNs with the number that appears to its left in the row.
3012 Solvers
-
The Answer to Life, the Universe, and Everything
544 Solvers
-
671 Solvers
-
797 Solvers
-
9210 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!