## Let us call an integer sided triangle with sides $a \le b \le c$ barely acute if the sides satisfy $a^2 + b^2 = c^2 + 1$.

How many barely acute triangles are there with perimeter $\le 25\,000\,000$?

### This math problem is part of number theory and is related to the family of Pythagorean triples.

A standard approach to generate Pythagorean triples is to use the parametrization:

(a,b,c) = (m^2 – n^2, 2mn, m^2 + n^2) (where m>n>0),

which does include all triples, not just the primitive ones.

We need to transform the original equation a bit. To solve the equation a² + b² = c² + 1, we can write a² = c² – b² + 1. Let’s denote c – b = u and a = v, then from the triangle inequality b = c – u < a we get that u > v. So we have c² – (c – u)² = c² – c² + 2cu – u² =v² + 1, hence 2cu – u² = v² + 1. Rearranging this gives u² + 1 = 2cu – v². Denoting 2c/u = p and v/u = q we get the equation p² – 2q² = 1.

This equation is a variant of the Pell equation. The solutions are given by the convergents of the continued fractions of √2, which are given by √2=[1;2,2,2,…]= 1/(2+1/(2+1/(2+…)))=1,3/2,7/5,17/12,41/29,99/70,… From these we should take the ones with odd index, i.e., 7/5, 99/70,…, because we need p to be even to assure that c = pu/2 is integer.

We also have the perimeter 2c = 2pu/2 = pu <= 25,000,000. So after obtaining each new p from the convergent expansion of √2, you just have to check how many choices for u<=25,000,000/p lead to integer triangles, i.e., u and p must have the same parity. The programmatic part here is mostly to handle big integers correctly and to generate the convergents of the continued fraction. Hence, the number of barely acute triangles with perimeter ≤25,000,000 is obtained through this process of manual mathematical derivation and assisted computational check. This is why this problem is somewhat complicated.

##### More Answers:

Heighway DragonAlexandrian Integers

Sphere Packing