Show that the sum or difference of $a_i$ and $a_j$ from a set of seven distinct integers is divisible by 10

elementary-number-theorypigeonhole-principle

I know this is a duplicate of this question, but I don't understand the top answer at all. How does squaring $a$ show what we're supposed to show?

Here's my intuition on how to prove this:
$a_i$ and $a_j$ can be decomposed as a sum of multiples of powers of $10$ since we're working in base $10$. When we add or subtract $a_i$ and $a_j$ from each other we want to show that their remainder is zero using the pigeonhole principle.

Is this a correct way of looking at it?

Thanks.

Best Answer

The idea behind that proof is that $$0=a_i^2-a_j^2 =(a_i-a_j)(a_i+a_j) \pmod{10}$$

Then at least one of $(a_i-a_j),(a_i+a_j)$ is divisible by $2$ and at least one is divisible by $5$. Now show that $(a_i-a_j)$ and $(a_i+a_j) $ have the same parity.

Your idea also works:

Split the seven numbers among the following $6$ boxes:

$$\{ 1,9 \pmod{10} \} ; \{ 2,8 \pmod{10} \} ; \{ 3,7 \pmod{10} \} \\ \{ 4,6 \pmod{10} \} ; \{ 5 \pmod{10} \} ; \{ 0 \pmod{10} \}$$

Then at least one box contains two numbers. If the two numbers in the same box are congruent $\pmod{10}$, then their difference is divisible by $10$. Otherwise, their sum is divisible by 10.