How many groups of three different numbers from the set $\{1,2,…,100\}$ have the property that one number is the sum of the other two

combinatoricscontest-math

How many groups of three different numbers from the set $\{1,2,…,100\}$ have the property that one number is the sum of the other two?

So I’m looking at the sets of the form $\{x,y,x+y\}$. Looking at the parity of $x+y$ if it’s even then either $x$ and $y$ are odd or both even. There are $49$ choices for each so we have $49\cdot 49=2401$ choices for $x$ and $y$.

If $x+y$ is odd then $x$ is even and $y$ is odd or the other way around. It seems that still we have $49$ choices for either one? What is the restriction here, the amount of choices seems to blow up if I consider this case also.

Best Answer

Let $x$ be the largest element of your triple. If $x$ is odd, then there are $\left \lfloor \frac x2 \right \rfloor$ pairs below $x$ that work to complete the triple. If $x$ is even, then there are $\left \lfloor \frac{x-1}{2} \right \rfloor$ pairs that work (because the numbers have to be different, $n+n=2n$ never occurs). So the answer is $$2 \sum_{k=0}^{49} k= 2450.$$