A Problem About Integer-Sided Triangles

This is a problem from "Number Theory World":

A triangle with all three sides of integer length has a perimeter of 1000, and one of its interior angles is twice another. Find the lengths of the three sides.

At first glance this looks like a geometry problem, but it's actually an elementary number theory problem, and mainly a problem about Diophantine equations. Problems like this could plausibly show up in math competitions, so let's explore it together. Incidentally, as a kid I was quite fond of number theory — throughout elementary and middle school I spent a lot of time reading about "primes," "perfect numbers," "amicable numbers," "large number factorization," and the like. Now that I've studied calculus and other topics, my interests have gradually shifted toward more applied areas of mathematics, so my level in number theory isn't particularly high — please bear with me. more

Let the three sides be a, b, c, with corresponding angles A, B, C, and let B = 2A. From the given condition, we have a+b+c=1000

By the law of cosines, we have $\cos A=\frac{b^2+c^2-a^2}{2bc}$

By the law of sines, we have $\frac{a}{\sin A}=\frac{b}{\sin 2A}=\frac{b}{2\sin A \cos A}$

Substituting the expression for cos A into the above equation, we get:$a=\frac{b}{2(\frac{b^2+c^2-a^2}{2bc})}$

that is, $\frac{c}{a}=1+(\frac{c}{b})^2-(\frac{a}{b})^2$

Some readers might wonder why we'd want to write it in this form. Actually, when studying a problem, BoJone likes to make the expressions as short as possible, with as few unknowns as possible. In the expression above, $\frac{c}{a}$ can be written as $\frac{c//b}{a//b}$, and by simply setting $\frac{a}{b}=m,\frac{c}{b}=n$, we can reduce the equation to one involving only two unknowns. That is:

$$\frac{n}{m}=1+n^2-m^2$$

From a physical point of view, the reason this simplification works is that after the substitution, $\frac{a}{b},\frac{c}{b}$ are both "dimensionless" quantities. As for how one might quickly come up with this step, BoJone has no magic trick to offer — it just takes practice, intuition, and a lot of trial and error.

The equation above can be further rewritten as $\frac{n-m}{m}=(n-m)(n+m)$. It's easy to check that $ n !=m$, so we have $1=(n+m)m$, which, converting back to the original unknowns, gives: $a^2+ac=b^2$. At this point, the most direct approach would be to just enumerate possibilities with a computer program. Of course, in a math competition you can't do that, and for readers who want to see the analytical process worked out, it's worth exploring the computation further.

After a series of attempts, I came up with the following relatively tractable approach. Adding $(1/2 c)^2$ to both sides of $a^2+ac=b^2$, we get $(a+1/2 c)^2=b^2+(1/2 c)^2$

This turns into a Pythagorean triple problem (though of course we don't yet know whether c is odd or even). Recall that all Pythagorean triples can be expressed as $(x^2+y^2)^2=(x^2-y^2)^2+(2xy)^2$, so let's first set $x^2+y^2=a+1/2 c,x^2-y^2=b,2xy=1/2c$

(Here's a small question worth pondering: why not $x^2-y^2=1/2 c,2xy=b$?)

From $a+b+c=1000$, we have $x^2+xy=500 \Rightarrow y=\frac{500-x^2}{x}$.

$$\begin{aligned}x > y \Rightarrow x > \sqrt{250}=15.8... \\ y>0 \Rightarrow x < sqrt{500} =22.36...\end{aligned}$$

Since $x^2+xy=500$, x and y cannot both be of the form "**.5," which means c must be even. We only need to check the integer values of x from 16 to 22, and we find x=20, y=5. This gives the final result:

a=225, b=375, c=400

English translation of a post from 科学空间 | Scientific Spaces by 苏剑林. Original: https://kexue.fm/archives/1417
Translated automatically with claude-sonnet-5; all equations are reproduced verbatim from the source. Copyright remains with the original author.