Square of four digit number $a$ A natural number $a$ had four digits and $a^{2}$ ends with same four digits as that of $a$. Find the value of $(10080-a)$
Please provide some hints to get start with this problem.
 A: We can build this up digit by digit.
find a such that $a^2 \equiv a \pmod {10}$  A quick trial and error and we settle on $6$
$(10b + 6)^2 \equiv 10 b + 6 \pmod{100}\\
(100b + 120b + 36) \equiv 10 b +6\pmod{100}\\
20b + 36 \equiv 10b+6 \pmod{10}\\
10b\equiv -30\pmod{100}\\
b= 7$
And this pattern will repeat for the remaining digits.
$(1000c + 76)^2 \equiv 2000c + 776\equiv 1000c + 76\pmod{1000}$
$c=3$
$376^2$ ends $1376$
the next digit is a $9$
If you wanted to keep going.
$109376, 7109376, 27109376$
A: We have $10000 | a^2- a$  
or $2^4 5^4 | (a-1)a $
We can show $625 | a $   or $625|a-1$ (Consecutive numbers together cannot both be multiples of 5)
We therefore take various possibilities of odd multiples 625 and see whether the preceding or succeeding number is divisible by 16.  (Odd multiples because even multiples succeeding or preceeding are always odd and they are at most divisible by 8, as 625* 16 enters 5 digit realm)
Working out, you get $a= 625 * 15+1 = 9376$
And ${9376}^2 = 87909376$
