<s>[INST] How to find the minimum $n$ 
Find the smallest $n$ such that the sequence 
   $1000n,1000n+1,1000n+2,\cdots,1000n+2013$ does not contain a perfect square.

My try:

$n=1$ does not work because 
  $$1000n=1000,1000n+1=1001,\cdots,1000n+4=1024,\cdots,1000n+2013=3013$$

contains the square numbers $32^2=1024,33^2=1089,\cdots\cdots,54^2=2916$
so $n\neq 1$

Similarly, when $n=2$,then
  $$1000n=2000,1000n=2001,\cdots,1000n+2013=4013$$
  it is easy find this sequence contains square numbers  $$45^2=2015,46^2=2116,\cdots,63^2=3969$$
  so  $n\neq 2$

$\cdots\cdots\cdots$
Thank you for your help
 [/INST] Let $x^2$ be the largest perfect square $\leq 1000n-1$. Then $(x+1)^2 \geq 1000n+2014$ so $(2x+1)=(x+1)^2-x^2 \geq 2015$ so $x \geq 1007$. 
Put $x=1000+y, y \geq 0$, so that $x^2 \equiv y^2 \pmod{1000}$. If $y \leq 30$, then $x^2 \equiv 0, 1, 4, \ldots ,900 \pmod{1000}$ so $x^2 \leq 1000n-100$. Thus $(2x+1)=(x+1)^2-x^2 \geq 2114$  so $x \geq 1057$ so $y \geq 57$, a contradiction.
Thus $y \geq 31$, so that $x \geq 1031$, and $n \geq \frac{1031^2+1}{1000}=1062.962$, so $n \geq 1063$. When $n=1063$, we have $1031^2=1062961<1063000=1000n<1000n+2013=1065013<1065024=1032^2$ so $n=1063$ is minimal.
</s>