Two element subset of $\{1,2,\dots,100\}$ with sum of elements being a square

243 Views Asked by At

Prove that every 50-element subset of $\{1,2,\dots,100\}$ contains two elements $a,b$ such that $a+b$ is a square of integer.

Any 50-element subset of the set $\{1,2,\dots,100\}$ has $\binom{50}{2}=2205$ 2-element subsets. We want to prove that one of them is $\{a,b\}$, where $a+b=k^2$. Here $k$ can be one of numbers $2,3,\dots,14$ and here are all "good" subsets $\{a,b\}$:

$2^2 \dashrightarrow \{1,3\}$

$3^2 \dashrightarrow \{1,8\},\ \{2,7\},\ \{3,6\},\ \{4,5\}$

$\dots$

$13^3 \dashrightarrow \{69,100\},\ \dots,\ \{84,85\}$

$14^2 \dashrightarrow \{96,100\},\ \{97,99\}$

Counted together, there are $1+4+7+12+17+24+31+40+49+40+28+16+2=261$ such subsets. Does this approach make any sense and get me closer to the solution?

1

There are 1 best solutions below

4
On BEST ANSWER

You have the right idea re: checking $2$-element subsets. However, it's best to just use one group of subsets. To minimize the amount of checking required, ideally we'd have $50$ disjoint $2$-element subsets. We're close with $49$ of them for a sum to $100$, as you've noted, but $50$ and $100$ are left unpaired. Resolving this requires replacing a $\{x,y\}$ subset pair with $x+50$ and $y+100$ where each is a perfect square. The only such subset is $\{31,69\}$.

This leads to subdividing the elements of $\{1,2,\ldots,100\}$ into the $50$ disjoint $2$-element subsets of $\{1,99\}$, $\{2,98\}$, $\ldots\,$, $\{30,70\}$, $\{32,68\}$, $\{33,67\}$, $\ldots\,$, $\{49,51\}$, $\{31,50\}$, $\{69,100\}$ where the sum of each of the $2$ elements is a perfect square. Thus, by the Pigeonhole Principle, any $50$ element subset which doesn't have $2$ elements $a$ and $b$ where $a+b$ is a perfect square needs to contain exactly $1$ element from each of those $50$ stated $2$ element-subsets.

In particular, this means we must choose one of the elements of the first subset, i.e., $\{1,99\}$. Suppose we pick $1$. To avoid having a sum of a perfect square, we can't choose any of the other subset elements which are $1$ less than a perfect square, e.g., $3$, $8$, etc., so we must choose the other element of that subset instead. Thus, to avoid $8$ we need to choose $92$, and to avoid $48$ requires choosing $52$. However, $92 + 52 = 144$ is a perfect square. Thus, choosing $1$ means we cannot avoid having a subset of $50$ elements with a square sum.

Next, consider picking $99$ instead. As explained in the previous paragraph, we need to avoid choosing a perfect square complement to any already chosen elements, starting with $99$. Thus, to avoid $99 + 45 = 144$ occurring, we need to choose $55$. Preventing $99 + 70 = 169$ requires choosing $30$. To not get $30 + 34 = 64$, we must choose $66$. However, then $55 + 66 = 121 = 11^2$. Thus, we can't avoid getting a subset of $50$ elements with a square sum by choosing $99$ either.

This proves that every $50$ element subset contains $2$ elements which sum to a perfect square.