Problem

Source: P4 - RMO Maharashtra and Goa 2019

Tags: number theory



Let $a_1,a_2,\cdots,a_6,a_7$ be seven positive integers. Let $S$ be the set of all numbers of the form $a_i^2+a_j^2$ where $1\leq i<j\leq 7$. Prove that there exist two elements of $S$ which have the same remainder on dividing by $36$.