We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Pythagorean triples with up to is a bit insane. I could manage . Still looking for a way out.
EDIT: You may try to list some of the valid , , and its perimeter to look for a pattern. Don't look further if you don't want to spoil the fun.
The sum of two consecutive perimeters is very close to the isosceles side of the next triangle. Experiment with it.
EDIT 2: You may also take a look at Tree of primitive Pythagorean triples. The parent-child relationship is especially useful here. If you don't know how Pythagorean triples can be used for this problem, look up Isosceles Heronian triangles.
Yet another approach I've seen from others is to solve Pell's equation.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #94: Almost equilateral triangles
You are viewing a single comment's thread. Return to all comments →
Pythagorean triples with up to is a bit insane. I could manage . Still looking for a way out.
EDIT: You may try to list some of the valid , , and its perimeter to look for a pattern. Don't look further if you don't want to spoil the fun.
The sum of two consecutive perimeters is very close to the isosceles side of the next triangle. Experiment with it.
EDIT 2: You may also take a look at Tree of primitive Pythagorean triples. The parent-child relationship is especially useful here. If you don't know how Pythagorean triples can be used for this problem, look up Isosceles Heronian triangles.
Yet another approach I've seen from others is to solve Pell's equation.