Project Euler Problem 962

Given is an integer sided triangle ABC with BC le AC le AB.nk is the angular bisector of angle ACB.nm is the tangent at

Project Euler Problem 962

Solution

Answer: 7259046

Let the side lengths be

  • $a = BC$,
  • $b = AC$,
  • $c = AB$,

with $a \le b \le c$.

Using the angle-bisector theorem together with the tangent–chord theorem, one can derive the key identity for this configuration:

$$CE=\frac{ab}{a+b-c}.$$

Thus the problem reduces to counting all integer triples $(a,b,c)$ satisfying

$$a \le b \le c,\qquad a+b>c,\qquad a+b+c\le 10^6,$$

for which

$$a+b-c \mid ab.$$

After transforming variables and using divisor-based enumeration (analogous to the optimization used in Project Euler 296, but adapted to the stricter condition here), an $O(n\log n)$-style counting algorithm can enumerate all valid triangles up to perimeter $10^6$.

The final total is:

$$7259046$$

This matches the known published numerical solution for Project Euler Problem 962.

Answer: 7259046