Find the Triangle

Computer Science Level pending

If the sides of an integer triangle are bound by 1 and 9 inclusive, find the triangle with the greatest distance between its circumcenter and its orthocenter . If that distance is a b \frac{a}{\sqrt{b}} , where a a and b b are integers and b b is square-free, submit a + b . a+b.


The answer is 75.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Fletcher Mattox
Nov 29, 2020

Notice that 56 19 19 = 56 19 . \dfrac{56\sqrt{19}}{19} = \dfrac{56}{\sqrt{19}}. , so the solution is 56 + 19 = 75 56+19=\boxed{75}

I tried really hard to find an analytical solution, but there were too many independent variables to differentiate. If someone has a suggestion, I would love to hear it.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# https://brilliant.org/problems/find-the-triangle-2/

from sys import argv
from sympy import *
from itertools import product

# return square of triangle area
def heron(x):
    a, b, c = map(Integer, x)
    s = (a + b + c)/2
    return s*(s - a)*(s - b)*(s - c)

# distance between O and H according to Wolfram
# see eqn (5) on https://mathworld.wolfram.com/Circumcenter.html
def OH(x):
    a, b, c = x
    t2 = a**6 - b**2*a**4 - c**2*a**4 - b**4*a**2 - c**4*a**2 + 3*b**2*c**2*a**2 + b**6 + c**6 - b**2*c**4 - b**4*c**2
    area2 = heron(x)
    OH2 = t2 / (16 * area2)
    return sqrt(OH2)

# triangle inequality
def is_triangle(x):
    a, b, c = x
    return a < b+c and b < a+c and c < a+b

# exhaustively generate all integer triangles
def integer_triangles(n):
    uniq = set()
    sides = list(range(1, n))
    for t in product(sides, repeat=3):
        if is_triangle(t):
            uniq.add(tuple(sorted(t)))
    return list(uniq)

n = int(argv[1]) if len(argv) == 2 else 10
tmax = -1
tri = integer_triangles(n)
for t in tri:
    if OH(t) > tmax:
        tmax = OH(t)
        abc = t
print(abc, tmax)

1
(5, 5, 9) 56*sqrt(19)/19

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...