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 commentsGroup

Strings II
- 21 Problems
- 41 Finishers
- Find the sum of all the numbers of the input vector
- Select every other element of a vector
- Arrange Vector in descending order
- Inner product of two vectors
- Get the length of a given vector
- Find max
- Whether the input is vector?
- Flip the vector from right to left
- Create a vector
- Doubling elements in a vector
- Vector creation
Problem Recent Solvers1299
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!