Problem 52659. Easy Sequences 15: Pythagorean Area with maximum Hypotenuse
Solution Stats
Problem Comments
-
11 Comments
From the first test problem, you are missing the triple (9,12,15).
A should be [6; 24; 30; 54; 60; 84; 96] and
B should be [5;10; 13; 15; 17; 25; 20].
Hi David,
Should be OK now. Thanks.
I believe my code should be correct. If you could look at my code, I believe you are missing some triples in other tests as well. I am getting larger values than the test suite and I verified that I don't have any duplicates and the areas are all <= to the input.
I am having the same experience as David, and have also been careful about duplication.
HI William/David,
I've checked your solutions and your answers are not the same. I've verified my answers with:
http://oeis.org/A009112/b009112.txt.
It seems to be OK.
I've added an OEIS link in the problem for reference.
I was confused. I did all possible unique Pythagorean triples (some have the same area). You just want unique areas (and if the areas are the same, the largest hypothenuse). If you added, "unique" areas of all Pythagorean triangles, it would be clearer.
Hi David,
That's why we want to find "largest possible hypotenuse for each area". That doesn't make sense if we don't mean unique areas. Anyway, I changed the problem to make it even clearer. Thanks.
I am now getting the correct A (verified based on OEIS) to 10000, but my max hypotheses must not be matching yours. I verified my code is selecting the maximum hypotheses for the same areas. I don't think I am doing anything wrong.
Hi David, consider your answer for 1,000. If a program is correct the area you will get there should match with OEIS also.
I had a mistake in my code. Figured it out. Thanks.
Solution Comments
Show commentsProblem Recent Solvers8
Suggested Problems
-
41625 Solvers
-
4234 Solvers
-
Mysterious digits operation (easy)
282 Solvers
-
Find out sum and carry of Binary adder
1465 Solvers
-
Easy Sequences 22: Sum of Proper Fractions
8 Solvers
More from this Author116
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!