This is a problem from Project Euler, problem 94.

The problem asks about isosceles triangles with integer sides (differing by 1 unit, e.g, 5-5-6) and integer area, which are known to be Heronian Triangles.

Now as per the wiki, all heronian isosceles triangles have sides of the form:

$$ a = u^{2} + v^{2} \\ b = 2(u^2 - v^2) $$

for coprime integers u and v with u>v.

As per the question, the difference between a and b is 1, which reduces the equations to

$$ u^2 - 3v^2 = 1 \space for \space b > a \\ 3v^2 - u^2 = 1 \space for \space a > b $$

Clearly both are of the form of Pell's equation. And the second being a negative Pell equation with D = 3, it is not solvable effectively removing any possibility of triangles with a > b.

As I solved for the 1st equation, I did not get all the possible Heronian isosceles triangles. However, on the web I can find solutions considering the case of a > b as well.

Where am I doing wrong ? Isn't the question asking about Heronian isosceles triangles ? And, if the wiki is right, how can we have triangles with a > b when the corresponding Pell's equation is not solvable ?


The formula you wrote down for generating the Heronian triangles is not quite correct. For example, we can take $u$ and $v$ odd, $a=\frac{1}{2}(u^2+v^2)$, $b=u^2-v^2$, with $u\gt v$.

That will give you the Pellian $3v^2-u^2=2$, which does have solutions.

  • $\begingroup$ I see. Looks like I didn't notice the part where they say "All isosceles Heronian triangles are given by rational multiples of". $\endgroup$ – gaganbm Dec 14 '13 at 20:49
  • $\begingroup$ I just checked, they kind of get it right, though they should have given an iff condition, since not all rational multiples work. $\endgroup$ – André Nicolas Dec 14 '13 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.