Find $N$ with $N^2=10^4M+N$ I'm a high school student in France and I participated in a math olympiad, and there was a question which I found impossible to solve. Maybe they are here some people who can help me:

We take a number $N$ which can be written by numbers $a,b,c$ and $d$ in
  the same order.
so $N=a(10^3)+b(10^2)+c10+d$. And $M\in \mathbb{Z}$ with
  $N^2=M(10^4)+N$
Find $M$.


$$N^2-N=10^4 \cdot M$$
$$N(N-1)=2^4\cdot 5^4\cdot M$$
$N(N-1)=16\cdot 625\cdot M$
$\gcd(N,N-1)=1$ 
Then 1)$$N=2^4k; N-1=5^4l, k,l \in \mathbb N$$ or 2)$$N-1=2^4k; N=5^4l, k,l \in \mathbb N$$
1) $10^4\le N-1=5^4l \le 10^5 \Rightarrow 2\le l \le 15$ and $16|N$
2)$10^4\le N=5^4l \le 10^5 \Rightarrow 2\le l \le 15$ and $16|(N-1)$
1) $l=2, N-1=1250$, but $16 \not |N=1251$
$l=3, N-1=1875$, but $16 \not |N=1876$
and so on ...
$l=15, N-1=9375, N=9376=586 \cdot 16$
$$N^2=9376^2=87909376=10^4\cdot 8790+9376$$
$$M=8790$$
