[Math] Using mod 1000 to get the last 3 digits of a product

number theory

$\text{Find the last 3 digits of} \space 1 \times 3 \times 5 \times \cdots \times2017.$

$\text{Any ideas? All I can say is that we need to get its remainder mod 1000 but I still think it is too much.}$

$\text{How can I use the fact that} \space 7 \times 11 \times 13 \equiv 1 \space (mod \space 1000) \space and \space 27 \times 37 \equiv -1 \space (mod \space 1000) \space ?$

Best Answer

You are almost there. To evaluate the given product in modulo $1000$, note first that $1000 = 8\times 125$. Hence, it suffices to evaluate the given product in modulo $8$ and $125$.

Modulo $125$ is simple, as we have $5\times15\times25$ dividing the given product, it is congruent to $0$ modulo $125$.

For modulo $8$, note the following pattern in the product, which you can rigorize too: $$ 1\times 3\times5\times\cdots\times2017 \equiv \underbrace{1\times3\times(-3)\times(-1)}_{\equiv 1}\times1\times\cdots\times 1 \equiv 1^{253}\equiv 1 \pmod{8}. $$

Hence, the given product is of form $125t$ for some $t \in \{0,1,\dots,9\}$ satisfying $$ 125t\equiv1\pmod{8}\implies5t\equiv 1\pmod{8}\implies p\equiv5\pmod{8}. $$ Hence, the last three digits are $5\times125=625$.

Related Question