[Math] Convert Equilateral triangle to Isosceles triangle

computer sciencegeometrynumber theoryrecreational-mathematicstriangles

Let an equilateral triangle have the length of each side an integer $N$. I need to find if it is possible to transform the triangle keeping two sides fixed and alter the third side such that it still remains a triangle, but the altered side will have its length as an even integer, and the line drawn from the opposite vertex to the mid-point of the altered side is of integral length, i.e. it becomes an isosceles triangle.

Example : If $N=5$ then the answer is YES while if $N=3$ answer is NO.

It's a computer graphics problem that is a sub-part of bigger problem, I have been racking brains about maths and the concept behind it, to solve my problem.

Best Answer

To restate your question more clearly, you are asking what kind of integer number $N$ can be the hypothenuse of a right-angled triangle, so that the other two sides are of integer length too.

The answer is well known: $N$ must be (the multiple of) the sum of two perfect squares: $N=a^2+b^2$ (or $N=k(a^2+b^2)$). If so, the other two sides (which in your problem are half the modified side and "the line drawn from the opposite vertex to the mid-point of the altered side") are given by $a^2-b^2$ and $2ab$ (multiplied by $k$ if needed).

Example: $5=2^2+1^2$, $3=2^2-1^2$, $4=2\cdot(2\cdot1)$.