What is the maximal number of elements we can choose form the set $\{1, 2, \ldots, 31\}$, such that the sum of any two of them is not a perfect square.
Problem
Source: 2011 Armenian Republican Olympiad
Tags: number theory
Diamondhead
01.08.2016 07:40
The answer is $3$. An example is $6,19,30$. (Note: there is only one such example that has the maximum number of elements.)
First, we will show that the number of elements we choose is at most 4.
Assume that, for sake of contradiction, we can choose $a_1<a_2<\ldots<a_n$ with $n \geq 5$ such that $a_i+a_j$ is a perfect square for all $i \neq j \in \{ 1,2,\ldots,n \}$. Since $1 \leq a_1<\ldots<a_n \leq 31$, therefore, $3 \leq a_i+a_j \leq 61$, so there are $6$ possible values of $a_i+a_j$ which are $4, 9, 16, 25, 36, 49$. Since there are $\binom{n}{2} >6$ of $a_i+a_j$, By Pegionhole principle, there are pairwise distinct $i_1,i_2,i_3,i_4$ such that $a_{i_1}+a_{i_2}=a_{i_3}+a_{i_4}=k \in \{ 4, 9, 16, 25, 36, 49 \}$, so $a_{i_1}+a_{i_2}+a_{i_3}+a_{i_4}=2k$. However, by the problem condition, $a_{i_1}+a_{i_3}$ and $a_{i_2}+a_{i_4}$ are also both perfect squares. But it is not hard to see that for each $a \in \{ 4, 9, 16, 25, 36, 49 \}$, there is only one pair $(b,c) \in \{ 4, 9, 16, 25, 36, 49 \}$ such that $b+c=2a$ which is $(b,c)=(a,a)$. Therefore, $a_{i_1}+a_{i_3}=a_{i_2}+a_{i_4}=k$, we get $a_{i_2}=a_{i_3}$, contradiction.
Next, we will show that the number of elements we choose is at most 3. Assume there is a 4-element subset $\{b_1,b_2,b_3,b_4 \}$ of $\{ 1,2,\ldots,31 \}$ satisfying the problem condition.
Note that $b_i+b_j$ are all pairwise distinct. Proof.Otherwise, WLOG $b_1+b_2=b_3+b_4=m$, so $$b_1+b_2+b_3+b_4=2m$$But it is not hard to see that for each $a \in \{ 4, 9, 16, 25, 36, 49 \}$, there is only one pair $(b,c) \in \{ 4, 9, 16, 25, 36, 49 \}$ such that $b+c=2a$ which is $(b,c)=(a,a)$. Therefore, $b_1+b_3=b_2+b_4=m$, we get $b_2=b_3$, contradiction.
Since $b_i+b_j \in \{4, 9, 16, 25, 36, 49 \}$, we get $\{b_i+b_j | 1 \leq i < j \leq 4 \}=\{4, 9, 16, 25, 36, 49 \}$.
Therefore, $\sum_{1 \leq i < j \leq 4} {(b_i+b_j)} = 4+9+16+25+36+49$, so $3(b_1+b_2+b_3+b_4)=139$ but $3 \nmid 139$, which is a contradiction. And we are done.
ochoa
01.08.2016 07:43
Diamondhead wrote:
The answer is $3$. An example is $6,19,30$. (Note: there is only one such example that has the maximum number of elements.)
First, we will show that the number of elements we choose is at most 4.
Assume that, for sake of contradiction, we can choose $a_1<a_2<\ldots<a_n$ with $n \geq 5$ such that $a_i+a_j$ is a perfect square for all $i \neq j \in \{ 1,2,\ldots,n \}$. Since $1 \leq a_1<\ldots<a_n \leq 31$, therefore, $3 \leq a_i+a_j \leq 61$, so there are $6$ possible values of $a_i+a_j$ which are $4, 9, 16, 25, 36, 49$. Since there are $\binom{n}{2} >6$ of $a_i+a_j$, By Pegionhole principle, there are pairwise distinct $i_1,i_2,i_3,i_4$ such that $a_{i_1}+a_{i_2}=a_{i_3}+a_{i_4}=k \in \{ 4, 9, 16, 25, 36, 49 \}$, so $a_{i_1}+a_{i_2}+a_{i_3}+a_{i_4}=2k$. However, by the problem condition, $a_{i_1}+a_{i_3}$ and $a_{i_2}+a_{i_4}$ are also both perfect squares. But it is not hard to see that for each $a \in \{ 4, 9, 16, 25, 36, 49 \}$, there is only one pair $(b,c) \in \{ 4, 9, 16, 25, 36, 49 \}$ such that $b+c=2a$ which is $(b,c)=(a,a)$. Therefore, $a_{i_1}+a_{i_3}=a_{i_2}+a_{i_4}=k$, we get $a_{i_2}=a_{i_3}$, contradiction.
Next, we will show that the number of elements we choose is at most 3. Assume there is a 4-element subset $\{b_1,b_2,b_3,b_4 \}$ of $\{ 1,2,\ldots,31 \}$ satisfying the problem condition.
Note that $b_i+b_j$ are all pairwise distinct. Proof.Otherwise, WLOG $b_1+b_2=b_3+b_4=m$, so $$b_1+b_2+b_3+b_4=2m$$But it is not hard to see that for each $a \in \{ 4, 9, 16, 25, 36, 49 \}$, there is only one pair $(b,c) \in \{ 4, 9, 16, 25, 36, 49 \}$ such that $b+c=2a$ which is $(b,c)=(a,a)$. Therefore, $b_1+b_3=b_2+b_4=m$, we get $b_2=b_3$, contradiction.
Since $b_i+b_j \in \{4, 9, 16, 25, 36, 49 \}$, we get $\{b_i+b_j | 1 \leq i < j \leq 4 \}=\{4, 9, 16, 25, 36, 49 \}$.
Therefore, $\sum_{1 \leq i < j \leq 4} {(b_i+b_j)} = 4+9+16+25+36+49$, so $3(b_1+b_2+b_3+b_4)=139$ but $3 \nmid 139$, which is a contradiction. And we are done.
Sorry there was a mistake in the original statement. I edited it, It now says "is not a perfect square".
Diamondhead
01.08.2016 08:23
Wow hahaha