Homepage Solution manuals Ivan Niven An Introduction to the Theory of Numbers Exercise 5.3.16* (Triangles with integer sides and an angle of $60°$)

Exercise 5.3.16* (Triangles with integer sides and an angle of $60°$)

Find, in the spirit of Theorem5.5, all primitive triples x , y , z of positive integers such that a triangle with sides x , y , z has an angle of 60 .

Answers

Proof. Consider a triangle with sides x , y , z , where x , y , z are positive integer, which has an angle of 60 . Let z is the length of the side intercepted by the angle γ with measure 60°. Then the law of cosines gives

z 2 = x 2 + y 2 2 xy cos γ .

Since γ = π 3 , we obtain

z 2 = x 2 + y 2 xy . (1)

Conversely, if ( x , y , z ) satisfies (1), then z 2 = x 2 + y 2 xy = x 2 + y 2 2 xy cos γ , thus cos γ = 1 2 , where γ [ 0 , π ] , so γ = π 3 .

A triangle with sides x , y , z has an angle of 60 if and only if some permutation of ( x , y , z ) satisfies (1). It remains to find all primitive solutions ( x , y , z ) ( ) 3 of the equation (1), that is

z 2 = x 2 + y 2 xy ,  where  x y z = 1 , x > 0 , y > 0 , z > 0 . (2)

If ( x , y , z ) satisfies (2), then x , y cannot be both even , otherwise z is even. This is impossible, because x y z = 1 . So x or y is odd. By exchanging x and y if necessary, we can assume that y is odd. So we search the solutions ( x , y , z ) of (2) with y odd (which gives the solutions ( x , y , z ) and ( y , x , z ) ).

We write the equation (1) in an equivalent form:

z 2 = x 2 + y 2 xy 4 z 2 = 4 x 2 + 4 y 2 4 xy ( 2 z ) 2 = ( 2 x y ) 2 + 3 y 2 3 y 2 = ( 2 z 2 x + y ) ( 2 z + 2 x y ) .

So we must find the solutions of

3 y 2 = ( 2 z 2 x + y ) ( 2 z + 2 x y ) , x y z = 1 , ( y  odd ) . (3)

We show first that a = 2 z 2 x + y and b = 2 z + 2 x y are relatively prime. Suppose for the sake of contradiction that some prime p divides these factors a , b , so that

p 2 z 2 x + y , p 2 z + 2 x y .

Then p ( 2 z 2 x + y ) + ( 2 z + 2 x y ) = 4 z and p ( 2 z + 2 x y ) ( 2 z 2 x + y ) = 4 x 2 y . We know that p 2 , otherwise p = 2 y , but y is odd by hypothesis. Therefore p z and p 2 x y . Moreover the equation (3) shows that p 2 3 y 2

  • If p = 3 , then 3 2 3 y 2 , thus 3 y 2 , and 3 is prime, so 3 y . Since 3 2 x y , 3 2 x , so 3 x . Then 3 x y z = 1 . This is a contradiction, which proves that p 3 .
  • Since p 3 , p 2 3 y 2 implies p 2 y 2 . By the unique factorization theorem, p y , and p 2 x y , thus p 2 x where p 2 , so p x . Then p x y z = 1 . This is a contradiction.

Therefore a b = 1 , where 3 y 2 = ab . Note that a > 0 and b > 0 , otherwise a 0 and b 0 , which implies 2 z 2 x u , 2 z 2 x + y , thus 4 z 0 , which is false. As in Problem 5, this shows that

( i ) a = 3 u 2 , b = v 2 or ( ii ) a = v 2 , b = 3 u 2 ,

where u > 00 , v > 0 are suitable integers such that u v = 1 . In both cases, 3 y 2 = ab = 3 u 2 v 2 , where z > 0 , a > 0 , b > 0 , thus y = ab . We examine these two cases.

(i)
In the first case, 2 z 2 x + y = 3 u 2 , 2 z + 2 x y = v 2 .

Then 4 z = 3 u 2 + v 2 , 4 x + 2 y = 3 u 2 v 2 . Since y = uv is odd, u and v are odd (and relatively prime). We obtain

{ x = 2 uv 3 u 2 + v 2 4 , y = uv , z = 3 u 2 + v 2 4 . (4)

Since u , v are odd, u 2 v 2 1 ( mod 4 ) , and 2 uv 2 ( mod 4 ) , thus 3 u 2 + 4 v 2 0 ( mod 4 ) and 2 uv 3 u 2 + v 2 0 ( mod 4 ) .

If we don’t like quotients, we write u = 2 s + 1 , v = 2 t + 1 , where s 0 , t 0 are integers. If we replace u , v in the preceding equations, we obtain

{ x = t 2 3 s 2 + 2 st 2 s + 2 t , y = 4 st + 2 s + 2 t + 1 , z = 3 s 2 + t 2 + 3 s + t + 1 . (5)

(we can take s , t so that ( 2 s + 1 ) ( 2 t + 1 ) = 1 ).

Conversely, if (5) is true, then

x 2 + y 2 xy = 9 s 4 + 6 s 2 t 2 + t 4 + 18 s 3 + 6 s 2 t + 6 s t 2 + 2 t 3 + 15 s 2 + 6 st + 3 t 2 + 6 s + 2 t + 1 = z 2 .

(Thanks to Sagemath!).

(ii)
In the second case, 2 z 2 x + y = v 2 . 2 z + 2 x y = 3 u 2 .

Then

{ x = 2 uv + 3 u 2 v 2 4 , y = uv , z = 3 u 2 + v 2 4 . (6)

With u = 2 s + 1 , v = 2 t + 1 , this gives

{ x = t 2 + 3 s 2 + 2 st + 4 s + 1 , y = 4 st + 2 s + 2 t + 1 , z = 3 s 2 + t 2 + 3 s + t + 1 . (7)

Conversely, if (7) is true, then

x 2 + y 2 xy = 9 s 4 + 6 s 2 t 2 + t 4 + 18 s 3 + 6 s 2 t + 6 s t 2 + 2 t 3 + 15 s 2 + 6 st + 3 t 2 + 6 s + 2 t + 1 = z 2 .

In conclusion, if ( x , y , z ) are positive integers such that x y z = 1 , then

z 2 = x 2 + y 2 xy u , v , 𝜀 { 1 , 1 } , u v 1 ( mod 2 )  and  { x = 2 uv + 𝜀 ( v 2 3 u 2 ) 4 , y = uv , z = 3 u 2 + v 2 4 .  or  { x = uv , y = 2 uv + 𝜀 ( v 2 3 u 2 ) 4 , z = 3 u 2 + v 2 4 .

(To avoid redundancy, we can take only the pairs ( u , v ) such that u v = 1 ).

In another form,

z 2 = x 2 + y 2 xy s , t , { x = t 2 3 s 2 + 2 st 2 s + 2 t , y = 4 st + 2 s + 2 t + 1 , z = 3 s 2 + t 2 + 3 s + t + 1 ,  or  { x = t 2 + 3 s 2 + 2 st + 4 s + 1 , y = 4 st + 2 s + 2 t + 1 , z = 3 s 2 + t 2 + 3 s + t + 1 .  or  { y = t 2 3 s 2 + 2 st 2 s + 2 t , x = 4 st + 2 s + 2 t + 1 , z = 3 s 2 + t 2 + 3 s + t + 1 ,  or  { y = t 2 + 3 s 2 + 2 st + 4 s + 1 , x = 4 st + 2 s + 2 t + 1 , z = 3 s 2 + t 2 + 3 s + t + 1 .

To list the solutions, we only keep the triplets such that x > 0 , y > 0 .

(We can take only the pairs ( s , t ) such that ( 2 s + 1 ) ( 2 t + 1 ) = 1 ). □

Note: Apart the obvious symmetry ( x , y , z ) ( y , x , z ) which maps solutions on solutions, there is another symmetry, given by ( x , y , z ) ( y x , y , z ) (if y > x ). Indeed

( y x ) 2 + y 2 ( y x ) y = x 2 + y 2 xy = z 2 .

We can explain this symmetry geometrically: if we complete a triangle with integer sides x , y , z (where y > x ) in an equilateral triangle, we obtain a second triangle with sides ( y x , x , z ) with an angle of 60° (You can do a figure with the solution ( 5 , 8 , 7 ) and the solution ( 3 , 8 , 7 ) ).

The solutions of the second case are given by this symmetry: if

x = 2 uv + 3 u 2 v 2 4 , y = uv , z = 3 u 2 + v 2 4 ,

is a solution of the first case such that y > x , then

y x = 2 uv 3 u 2 + v 2 4 , y = uv , z = 3 u 2 + v 2 4 ,

is a solution for the second case.

Note: verification of these results with Python (on jupyter-lab)

from math import gcd, sqrt

def is_square(n):
    r = round(sqrt(n))
    if r * r == n:
        return True
    else:
        return False

l = []
for x in range(1,100):
    for y in range(1, 100):
        u = x ** 2 + y ** 2 - x * y
        if is_square(u):
            z = round(sqrt(u))
            if gcd(gcd(x,y), z) == 1 and y % 2 == 1:
                l.append((x,y,z))
print(l)

[(1, 1, 1), (5, 21, 19), (7, 15, 13), (8, 3, 7), (8, 5, 7), (8, 15, 13), ...


l2 = []
for u in range(17):
    for v in range(18):
        for epsilon in [1,-1]:
            if u % 2 == 1 and v % 2 == 1  and gcd(u,v) == 1:
                 x, y, z = (2 * u * v + epsilon * (- 3 * u ** 2 + v ** 2)) // 4,
                                     u * v, (3 * u ** 2 + v ** 2) // 4
                if gcd(gcd(x,y), z) == 1 and x>0 and y>0:
                    l2.append((x,y,z))
print(l2)
[(1, 1, 1), (8, 5, 7), (15, 7, 13), (35, 11, 31), (48, 13, 43), (80, 17, 73),...

We obtain the same solutions (but not in the same order). We have verified similarly (5) and (7).

User profile picture
2025-04-13 10:51
Comments