## Triangles with 60° angle and sides integers

Previous blog:   Integer triangles with 120° angle

Law of cosines
https://en.wikipedia.org/wiki/Law_of_cosines

$c^2 \; = \; a^2 \; + \; b^2 \; - \; 2 \, a \, b \, \cos \, \gamma$

If   $\gamma \; = \; 60^\circ$   —>   $\cos 60^\circ \; = \; 0.5$

then,     $c^2 \; = \; a^2 \; + \; b^2 \; - \; a \, b$

To find triples   $(a, b, c)$   that satisfy the relation   $c^2 \; = \; a^2 \; + \; b^2 \; - \; a \, b$

We use the parametric equations

$a \; = \; m^2 \; - \; n^2$
$b \; = \; 2 \,m \,n \; - \; n^2$
$c \; = \; m^2 \; - \; m \,n \; + \; n^2$

where   $m$   and   $n$   are integers and   $m \; > \; n$

$(m^2 - n^2)^2 - (m^2 - n^2 ) \,(2 \, m \, n - n^2) + (2 \, m \, n - n^2)^2 \; = \; (m^2 - m \, n + n^2)^2$

Perimeter   $P$ :

$P \; = \; m^2 \; - \; n^2 \; + \; 2 \, m \, n \; - \; n^2 \; + \; m^2 \; - \; m \, n \; + \; n^2$
$P \; = \; 2 \, m^2 \; + \; m \, n \; - \; n^2$
$P \; = \; (2 \, m \; - \; n) \, (m \; + \; n)$

Let the triple   $(x, \; y, \; z)$   represents an integer 120° triangle
that is,   $x^2 \; + \; x \,y \; + \; y^2 \; = \; z^2$

Then the triples   $(x+y, \; y, \; z)$   and   $(x, \; x+y, \; z)$   represent two integer 60° triangles :

$x^2 \; + \; x \,y \; + \; y^2 \; = \; z^2$
$x^2 \; - \; x^2 \; + \; x^2 \; + \; x \,y \; - \; x \,y \; + \; x \,y \; + \; y^2 \; = \; z^2$
$x^2 \; + \; 2 \,x \,y \; + \; y^2 \; - \; x^2 \; - \; x \,y \; + \; x^2 \; = \; z^2$
$(x+y)^2 \; - \; (x + y) \,x \; + \; x^2 \; = \; z^2$

Or

$x^2 \; - \; (x+y) \,x \; + \; (x+y)^2 \; = \; z^2$

Here are the primitives for   a   <   100 :