What is $(7^{2005}-1)/6 \pmod {1000}$? What is $$\frac{7^{2005}-1}{6} \quad(\operatorname{mod} 1000)\:?$$
My approach:
Since $7^{\phi(1000)}=7^{400}=1 \bmod 1000, 7^{2000}$ also is $1 \bmod 1000$.
So, if you write $7^{2000}$ as $1000x+1$ for some integer $x$, then we are trying to $((1000x+1)\cdot(7^5)-1)/6 = (16807000x + 16806)/6 \pmod {1000}$.
Obviously, this must be an integer, so $x=3y$ for some $y$. Then, we are trying to find $16807000\cdot 3y/6+2801 \pmod {1000} = 500y+801 \pmod {1000}$. However, this value can be $301$ or $801$, and I am not sure how to find which one is correct.
Any help is appreciated!
By geometric sum formula we have
$$\frac{7^{2005}-1}{6} = \frac{7^{2005}-1}{7-1} = 1+7+7^2+\dots+7^{2004}$$
The sequence $1,7,7^2,\dots$ has period $20 $ modulo $1000$ (since $7^{20} \equiv 1 \pmod{1000}$).
$$1+7+7^2+\dots+7^{2004} \equiv 100(1+\dots+7^{19})+1+7+7^2+7^3+7^4 \equiv 100\cdot 0+801\equiv 801 \pmod{1000} $$
If $k$ and $n$ are not co-prime, you have to be very careful when dividing by $k\bmod n$ $-$ there may be more than one answer, as you saw. So $806/6\bmod 1000$ is not well-defined, because both $6\cdot 301$ and $6\cdot 801$ are equal to $806\bmod 1000$.
But in this case the problem is well-defined, because the expression $\dfrac{7^{2005}-1}{6}$ is an integer. So we can calculate it before reducing $\bmod 1000$. hgmath's answer shows one way to do this (and Raffaele's answer doesn't).