PROBLEM STATEMENT :
Suppose there are $160$ pigeons and $ n$ holes. The first pigeon flies to the $1st$ hole, the second pigeon flies to the $4th$ hole, and so on, such that the $i^{th}$ pigeon flies to the $$( i^2 \ mod \ n )^{th} \ hole. $$ Find the minimum value of $n$ such that there is at most one pigeon per hole .
MY WORKING:
This is how I could interpret the problem:
We have to find minimum n such that the following equality holds
$$i^2 \equiv k_{i}\pmod n$$ Where $i \in {1,2,...,160} $, and $k_{i} \equiv k_{j} $ if and only if $i=j$.
Simple analysis shows that $n≥160×2=320 $. I further checked for $n=320,321,...$, but couldn't find a valid n.
After spending some time, I came to the conclusion that $p=n$ satisfies the problem condition if and only if there exists no integral solution to the following equation : $$p+ x^2=y^2.$$
It seems that I am using more of number theory approaches to a combinatorics problem, and thus ending up with more complications.
Is my approach correct? How should I move further? Any hints or solutions will be much appreciated.
Thanks.
To satisfy the problem requirement, the following condition is necessary and sufficient: for every pair of distinct integers $x$ and $y$ with $1 \leq x, y \leq 160$, we have $$n \not \mid x^2 - y^2.$$
We will proceed by finding the smallest possible $n$ satisfying the above condition.
As you mentioned, $n$ must be at least $320$. Indeed, if $n \leq 319$, then we could set $x = n - 160$ and $y = 160$. We would have $1 \leq x < y \leq 160$ and $$x^2 - y^2 = (x+y)(x-y) = n(n-320)$$ is clearly divisible by $n$.
We now check the next few numbers. We utilise the factorisation $x^2 - y^2 = (x+y)(x-y)$ repeatedly.
Let us now look at $n = 326$. We will prove that the condition is satisfied when $n = 326$ using contradiction.
Suppose $326 | (x+y)(x-y)$ for some distinct integers $x$ and $y$ with $1 \leq x, y \leq 160$. Then at least one of $(x+y)$ and $(x-y)$ must be divisible by $163$. (Notice that $163$ is one of the prime factors of $326$.)
We cannot have $163 | (x-y)$. (Why? Consider the fact that $0 < |x-y| \leq 159 < 163$.) So, we know that $163 | (x+y)$, i.e., $x+y$ is a (positive) multiple of $163$. But $x+y$ obviously cannot be larger than $159 + 160 = 319$, so $x+y$ can only be $163$.
Since $x + y = 163$, we know $x+y$ is odd. Observe that $x+y$ and $x-y$ must have the same parity for any integers $x$ and $y$. (Why?) Hence, $x-y$ is odd too. But this means $(x+y)(x-y)$ is odd, which implies it cannot be divisible by the even number $326$. This is a contradiction.
So, the smallest possible number of holes is $326$.