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

Project Euler II
- 12 Problems
- 51 Finishers
- Sums of cubes and squares of sums
- Sum of big primes without primes
- Project Euler: Problem 11, Largest product in a grid
- Highly divisible triangular number (inspired by Project Euler 12)
- Divisors for big integer
- Large Sum (inspired by Project Euler 13)
- Longest Collatz Sequence
- Project Euler: Problem 16, Sums of Digits of Powers of Two
- Project Euler: Problem 18, Maximum path sum I
- Recurring Cycle Length (Inspired by Project Euler Problem 26)
- Numbers spiral diagonals (Part 1)
- Numbers spiral diagonals (Part 2)
Problem Recent Solvers1299
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!