Maximum value of $n$ such that the distances are equal For a natural number $j$, let $Q_j$ denote the point $(0,j)$ in the coordinate plane. Find the maximum value of $n$ such that there are $n$ points $P_1,P_2 \ldots P_n$(not necessarily different) with integer coordinates all lying on a line parallel to the x axis such that $P_1Q_1=P_2Q_2=\ldots P_nQ_n$ where $PQ$ denotes the distance between the points $P$ and $Q$.
I am quite a novice in combinatorics. So, please help me on how to start. It looks like a good problem. Thanks.
 A: The maximum $n$ with the desired property is $n=3$.
One one hand let $P_1=(0,6), P_2=(3,6), P_3=(4,6)$. Then $P_1Q_1=P_2Q_2=P_3Q_3=5$.
Suppose it is possible to have four such points $P_1(x_1,a)$, $P_2=(x_2,a)$, $P_3=(x_3,a)$ and $P_4=(x_4,a)$, with $x_1,x_2,x_3,x_4$ integers.
Then it is easy to check that $P_1Q_1=P_2Q_2=P_3Q_3=P_4Q_4$ implies
\begin{equation}
x_1^2-2x_2^2+x_3^2+2=0,\,\,\text{and}\,\,x_2^2-2x_3^2+x_4^2+2=0.
\end{equation}
However, this is impossible due to the following
Fact. If $x^2-2y^2+z^2+2=0$ then $x\equiv z \equiv 0 \pmod 2$ and $y\equiv 1 \pmod 2$.
Indeed, it is clear that $x\equiv z \pmod 2$. If $x$ and $z$ are both odd then
 $x^2-2y^2+z^2+2\equiv 2, 4 \pmod 8$, impossible. So, $x\equiv z\equiv 0 \pmod 2$. But this forces $y\equiv 1 \pmod 2$ otherwise  $x^2-2y^2+z^2+2\equiv 2 \pmod 4$, contradiction.
Using now this fact in the first equation above, it follows that $x_1$, and $x_3$ are even, and $x_2$ is odd.
Using it in the second equation it follows that $x_2$, $x_4$ are even and $x_3$ is odd.
The last two statements are clearly contradictory..
