CMIMC 2021 Algebra and Number Theory Problem 2

Suppose there are 160 pigeons and n holes. The 1^{st} pigeon flies to the 1^{st} hole, the 2^{nd} pigeon flies to the 4^{th} hole, and so on, such that the i^{th} pigeon flies to the \left(i^{2} \bmod n\right)^{th} hole, where k \bmod n is the remainder when k is divided by n. What is minimum n such that there is at most one pigeon per hole?