Let $R$ be the set of all possible remainders when a number of the form $2^n$, $n$ a nonnegative integer, is divided by $10000$. Let $S$ be the sum of the elements in $R$. Find the remainder when $S$ is divided by 1000.
The remainders are $1,2,4,8$, and from $2^4$ on a cycle of length $500$ (the order of $2$ mod $625$).
That cycle is exactly the $500$ multiples of $16$ below $10000$ not divisible by $5$, whose sum is $16\bigl(\sum_{k=1}^{624}k-5\sum_{j=1}^{124}j\bigr)=16(195000-38750)=2500000$.