16. A right-angled triangle has sides of integer length. One of its sides has length 20. Toni writes down a list of all the different possible hypotenuses of such triangles.
What is the sum of all the numbers in Toni's list?
Solution
227
Consider a hypotenuse of length 20. Let the shortest side be of length $a$. For integer side-lengths we require $20^{2}-a^{2}$ to be a square. We observe that of $20^{2}-1^{2}, 20^{2}-2^{2}, 20^{2}-3^{2}, \ldots, 20^{2}-19^{2}$ only $20^{2}-12^{2}=256$ and $20^{2}-16^{2}=144$ are squares. Therefore a hypotenuse of length 20 is possible.

Now we consider that one of the shorter two sides has length 20. Let the hypotenuse and the other shorter side be of lengths $h$ and $b$ respectively. By Pythagoras' Theorem $20^{2}=h^{2}-b^{2}$, yielding $(h-b)(h+b)=400$. We now consider factor pairs $(m, n), m \leq n$ of 400 to find $(h-b, h+b)$.
- $(m, n)=(1,400)$ gives $(h, b)=(200.5,199.5)$ which are non-integers.
- $(m, n)=(2,200)$ gives $(h, b)=(101,99)$ with hypotenuse 101.
- $(m, n)=(4,100)$ gives $(h, b)=(52,48)$ with hypotenuse 52 .
- $(m, n)=(5,80)$ gives $(h, b)=(42.5,37.5)$ which are non-integers.
- $(m, n)=(8,50)$ gives $(h, b)=(29,21)$ with hypotenuse 29 .
- $(m, n)=(10,40)$ gives $(h, b)=(25,15)$ with hypotenuse 25 .
- $(m, n)=(16,25)$ gives $(h, b)=(20.5,4.5)$ which are non-integers.
- $(m, n)=(20,20)$ gives $(h, b)=(40,0)$ which is a degenerate case, that is it includes a side of zero length.

Therefore the possible hypotenuses are $101,52,29,25$ and 20 with sum 227 .