Find the smallest number \(n\) such that any set of \(n\) ponts in a Cartesian plan, all of them with integer coordinates, contains two poitns such that the square of its mutual distance is a multiple of \(2016\).
Problem
Source: 38th Brazilian MO (2016) - First Day, Problem 2
Tags: combinatorics, combinatorial geometry, Brazilian Math Olympiad, Brazilian Math Olympiad 2016, number theory
27.11.2016 14:31
To begin with, $2016=2^5\cdot 3^2\cdot 7$. WLOG, we can suppose one of the points, say $A_0$ , coincides with $(0,0)$. Let the other points be $A_1(x_1,y_1),A_2(x_2,y_2),\dots,A_n(x_{n-1},y_{n-1})$. An well known fact: For a prime $p=4k+3$, if $x^2+y^2\equiv 0 \pmod{p}$, then $x\equiv 0\pmod{p},y\equiv 0\pmod{p} $. Also, it's easy to establish that: if $x^2+y^2\equiv 0 \pmod{32}$ then there are two possibilities: $x\equiv 0\pmod 8,y\equiv 0\pmod 8$ or $x\equiv 4\pmod 8,y\equiv 4\pmod 8$. Further, consider the residues mod $3,7,8$ of the pairs $(x_i,y_i), i=1,2,\dots,n$. If there exist two pairs $(x_i,y_i),(x_j,y_j)$ that have the same residue mod $3,7,8$, that's $x_i\equiv x_j\pod{3,7,8}$ and $y_i\equiv y_j\pod{3,7,8}$ then $|A_iA_j|^2\equiv 0\pmod{2016}$. Note that if $x_i\equiv 0 \pmod{3,7},y_i\equiv 0 \pmod{3,7} $ and $x_i\equiv 0[4] \pmod{8},y_i\equiv 0[4] \pmod{8}$ then $|A_0A_j|^2\equiv 0\pmod{2016}$. All that together implies $n=(3\cdot 7\cdot 8)^2/2$. EDIT: @below: Yeah, the number of points is $\frac{(3\cdot 7\cdot 8)^2}{2}+1.$ Since I enumerated them as $A_0,A_1,\dots,A_n, $ their number is $n+1.$
09.04.2017 00:01
dgrozev wrote: To begin with, $2016=2^5\cdot 3^2\cdot 7$. WLOG, we can suppose one of the points, say $A_0$ , coincides with $(0,0)$. Let the other points be $A_1(x_1,y_1),A_2(x_2,y_2),\dots,A_n(x_{n-1},y_{n-1})$. An well known fact: For a prime $p=4k+3$, if $x^2+y^2\equiv 0 \pmod{p}$, then $x\equiv 0\pmod{p},y\equiv 0\pmod{p} $. Also, it's easy to establish that: if $x^2+y^2\equiv 0 \pmod{32}$ then there are two possibilities: $x\equiv 0\pmod 8,y\equiv 0\pmod 8$ or $x\equiv 4\pmod 8,y\equiv 4\pmod 8$. Further, consider the residues mod $3,7,8$ of the pairs $(x_i,y_i), i=1,2,\dots,n$. If there exist two pairs $(x_i,y_i),(x_j,y_j)$ that have the same residue mod $3,7,8$, that's $x_i\equiv x_j\pod{3,7,8}$ and $y_i\equiv y_j\pod{3,7,8}$ then $|A_iA_j|^2\equiv 0\pmod{2016}$. Note that if $x_i\equiv 0 \pmod{3,7},y_i\equiv 0 \pmod{3,7} $ and $x_i\equiv 0[4] \pmod{8},y_i\equiv 0[4] \pmod{8}$ then $|A_0A_j|^2\equiv 0\pmod{2016}$. All that together implies $n=(3\cdot 7\cdot 8)^2/2$. Are you sure it is not your answer plus one ?
27.03.2022 15:09
Johann Peter Dirichlet wrote: Find the smallest number \(n\) such that any set of \(n\) ponts in a Cartesian plan, all of them with integer coordinates, contains two poitns such that the square of its mutual distance is a multiple of \(2016\). Same. I claim the answer is $\frac{168^2}{2}+1$. Note that the square of the distance between two points whose integer coordinates are $(x_i,y_i)$, $(x_j,y_j)$ is a multiple of $2016$ iff $(x_i-x_j)^2+(y_i-y_j)^2\equiv 0\mod 2016$. First, let's solve the equation $a^2+b^2\equiv 0\mod 2016$. Since $2016=2^5\cdot 3^2\cdot 7$, it is easy to check, using CRT, that the only solutions to that equation are $$ \left\{\begin{array}{lll} a\equiv b\equiv 0\mod 168 \\ a\equiv b\equiv 84\mod 168 \\ \end{array} \right. $$Hence we are looking for the smallest number $n$, such that, given $n$ points with integer coordinates $(x_1,y_1), (x_2,y_2), (x_3,y_3),\dots, (x_n,y_n)$, there necessarily exist two different points $(x_i,y_i)$, $(x_j,y_j)$ satisfying one of the two following conditions: $$ \left\{\begin{array}{lll} x_i-x_j\equiv y_i-y_j\equiv 0\mod 168 \\ x_i-x_j\equiv y_i-y_j\equiv 84\mod 168 \\ \end{array} \right. $$Instead of looking for $n$, let's look for $(n-1)$; that is, the largest number for which given $(n-1)$ points in the cartesian plane, there do not necessarily exist two such that the square of their distance is divisible by $2016$. Let $S=\{P_1,P_2,P_3,\dots,P_{168^2}\}$ be a set of $168^2$ points $(x,y)$ such that $x_i-x_j\equiv y_i-y_j\equiv 0\mod 168$ isn't satisfied for any two points $P_i(x_i,y_i)$, $P_j(x_j,y_j)$. There is only one possibility for such set modulo $168$. All points whose integer coordinates $x$ and $y$ belong to $[1,168]$. Clearly, if any new point $P_k(x_k,y_k)$ was added to such set, then there would exist $P_i\in S$ such that $x_i-x_k\equiv y_i-y_k\equiv 0\mod 168$. But then the square of the distance between $P_i$ and $P_k$ would be a multiple of $2016$. Therefore, $(n-1)\leq 168^2$. However, in the set $S$ there exist pairs of points $(x_I,y_I)$, $(x_J,y_J)$ such that $x_u-x_v\equiv y_u-y_v\equiv 84\mod 168$, and so the square of the distance between them would be a multiple of $2016$. It is easy to realise that, for any point $(x_i,y_i)$ in $S$, there only exists another point $(x_j,y_j)$ in $S$ such that $x_i-x_j\equiv y_i-u_j\equiv 84 \mod 168$. Therefore, the set $S$ can be grouped in $\frac{168^2}{2}$ pairs of points such that: $\bullet$ The square of the distance between two points forming a pair is a multiple of $2016$. $\bullet$ For any point in $S$, there only exists another point such that the square of the distance between them is a multiple of $2016$. Therefore, the maximum number of points with integer coordinates such that the given any two, the square of the distance between them is not a multiple of $2016$, is achieved by removing one point from each pair in $S$, and so it has cardinality $\frac{|S|}{2}=\frac{168^2}{2}$. Hence, $$ n-1=\frac{168^2}{2} \Longrightarrow \boxed{n=\frac{168^2}{2}+1} $$