A triangle is called perfect if its perimeter and its area are equal (as numbers). For example, the triangles with sides [tex]6[/tex], [tex]8[/tex], [tex]10[/tex] and [tex]9[/tex], [tex]10[/tex], [tex]17[/tex] are perfect. How many perfect triangles with integer sides are there? (Congruent triangles are counted only once.)
Solution:
Let the sides be [tex]a,b,c[/tex] and the semiperimeter [tex]s[/tex], and put [tex]x=s-a[/tex], [tex]y=s-b[/tex], [tex]z=s-c[/tex]. By the triangle inequality these numbers are positive, and
[tex]x+y+z=3s-2s=s,\qquad a=y+z,\quad b=x+z,\quad c=x+y[/tex]
By Heron's formula the area is [tex]S=\sqrt{sxyz}[/tex], and the perimeter is [tex]2s[/tex]. The condition [tex]S=2s[/tex] gives
[tex]sxyz=4s^2\iff xyz=4s=4(x+y+z)[/tex]
The numbers [tex]2x=b+c-a[/tex], [tex]2y=a+c-b[/tex], [tex]2z=a+b-c[/tex] have the same parity as the perimeter [tex]a+b+c[/tex]. If the perimeter were odd, then [tex]X=2x[/tex], [tex]Y=2y[/tex], [tex]Z=2z[/tex] would be odd integers with [tex]\frac{XYZ}{8}=4\times \frac{X+Y+Z}{2}[/tex], i.e. [tex]XYZ=16(X+Y+Z)[/tex], an odd number equal to an even one. Hence the perimeter is even, and [tex]x,y,z[/tex] are positive integers with [tex]xyz=4(x+y+z)[/tex].
Let [tex]x\ge y\ge z[/tex]. Then [tex]xyz=4(x+y+z)\le 12x[/tex], so [tex]yz\le 12[/tex]. Moreover, [tex]x(yz-4)=4(y+z)\gt 0[/tex], so [tex]yz\gt 4[/tex] and
[tex]x=\frac{4(y+z)}{yz-4}[/tex]
If [tex]z=1[/tex], then [tex]5\le y\le 12[/tex], and [tex]x=\frac{4(y+1)}{y-4}[/tex] is an integer with [tex]x\ge y[/tex] only for [tex]y=5[/tex] ([tex]x=24[/tex]), [tex]y=6[/tex] ([tex]x=14[/tex]) and [tex]y=8[/tex] ([tex]x=9[/tex]).
If [tex]z=2[/tex], then [tex]3\le y\le 6[/tex] and [tex]x=\frac{2(y+2)}{y-2}[/tex]: [tex]y=3[/tex] gives [tex]x=10[/tex], [tex]y=4[/tex] gives [tex]x=6[/tex], [tex]y=5[/tex] gives a non-integer, and [tex]y=6[/tex] gives [tex]x=4\lt y[/tex].
If [tex]z=3[/tex], then [tex]y\in\{3, 4\}[/tex] and [tex]x=\frac{24}{5}[/tex] or [tex]x=\frac{28}{8}[/tex], which are not integers. If [tex]z\ge 4[/tex], then [tex]yz\ge 16\gt 12[/tex].
The five triples [tex](x, y, z)[/tex] give the triangles with sides [tex](a, b, c)=(y+z, x+z, x+y)[/tex]:
[tex](24, 5, 1)\to(6, 25, 29),\qquad (14, 6, 1)\to(7, 15, 20),\qquad (9, 8, 1)\to(9, 10, 17)[/tex]
[tex](10, 3, 2)\to(5, 12, 13),\qquad (6, 4, 2)\to(6, 8, 10)[/tex]
All the steps are reversible, so all five triangles are perfect; for example, the triangle with sides [tex]5[/tex], [tex]12[/tex], [tex]13[/tex] has perimeter [tex]30[/tex] and area [tex]\frac{5\times 12}{2}=30[/tex]. Hence there are [tex]5[/tex] perfect triangles with integer sides.