non-homothetic configurations such that the area of triangle ABC is integer

32 Views Asked by At

Let a, b, c, and n be four integers such that b < a ≤ n and c ≤ n. In a triangle ABC (ABC is oriented in the positive counterclockwise direction), let D be a point on side [BC] such that BD = a, DC = b, and DA = c.

It is known that the radius of the circumcircle of triangle ABD is equal to the radius of the circumcircle of triangle ADC. If n = 200, how many non-homothetic configurations exist such that the area of triangle ABC is an integer?

Since the radius of the circumcircle of triangle ABD is equal to the radius of the circumcircle of triangle ADC, we can deduce that triangle ABC is isosceles at A (by the inscribed angle theorem).

To calculate the area of triangle ABC, we use the height and base of triangle ABC. The height of the triangle is c^2 - ((a - b) / 2)^2 (obtained using the Pythagorean theorem).

To find the non-homothetic configurations I calculate the irreducible fractions of height/base of triangles of entire area and count the different irreducible fractions.

I found 5782 non-homothetic configurations with a Python program but is false. Where are the errors?

import math
from fractions import Fraction

# Set the value of n
n = 200

# Create a set to store unique fractions
fractions_already_seen = set()

# Loop through possible values of a, b, and c
for a in range(1, n + 1):
    for b in range(1, n + 1):
        for c in range(1, n + 1):
            # Check if b is less than a
            if b < a:
                # Calculate the square of the height using the Pythagorean theorem
                h_2 = c**2 - ((a - b) / 2)**2
                # Check if the height is positive
                if h_2 > 0:
                    # Calculate the height
                    h = math.sqrt(h_2)
                    # Check if the height is an integer
                    if int(h) == h:
                        # Calculate the area of the triangle
                        area = (a + b) * int(h) / 2
                        # Check if the area is an integer
                        if int(area) == area:
                            # Check if the fraction (height / (a + b)) is not already in the set
                            if Fraction(int(h), a + b) not in fractions_already_seen:
                                # Add the fraction to the set
                                fractions_already_seen.add(Fraction(int(h), a + b))

# Print the result
print("answer", len(fractions_already_seen))