# Last two digits of odd products

Is there any proof where we can find the last two digits of odd number product.

$$1\cdot3\cdot5\cdot7\cdot\ldots\cdot99 = a_i$$ Find the last two digits of $$a_i$$. The answer would be $$75$$ as any multiples of $$5$$ will always end with $$5$$.

Are there any solid proof or trick to find the last two digits of the above product?

• Have you tried Wilson's Theorem? Commented Dec 22, 2018 at 16:04
• Yeah. But that provides the answer as a whole(! Format). Considering this the answer for the problem should be 50!/(2^25)25! but to find the last two digit from this format is tediuos? Ofcourse last 2 digit is 75 but how Commented Dec 22, 2018 at 16:08

One of the terms in $$1\cdot3\cdot5\cdot...\cdot99$$ will be $$25$$, so indeed the answer is either $$25$$ or $$75$$. Note that $$25k$$ ends in $$25$$ if $$k\equiv1$$ (mod $$4$$) and $$25k$$ ends in $$75$$ if $$k\equiv3$$ (mod $$4$$). We have $$1\cdot3\cdot5\cdot...\cdot99\equiv1\cdot3\cdot1\cdot...\cdot1\cdot3=3^{25}=(3^2)^{12}\cdot3\equiv1^{12}\cdot3=3\mbox{ (mod }4)$$ and $$25\equiv1$$ (mod $$4$$), so $$k\equiv3$$ (mod $$4$$). Conclusion: The last two digits of $$1\cdot3\cdot5\cdot...\cdot99$$ are $$75$$.

Indeed, as Bill Dubuque pointed out, our key observation can be written as $$25k\mbox{ (mod }25\cdot4)=25\cdot(k\mbox{ (mod }4))$$. In this particular case it can be easily seen by just a little bit of experimentation and a proof by induction is also not very difficult, however writing it in this form shows that this is a particular case of a much more general fact. See the mod distributive law for details.

• Implicitly used above is $\ 25k\bmod 25\cdot 4\, =\, 25(k\bmod 4).\$ This is worth explicit mention because this identity has widespread application in number theory and algebra. It is an operational form of CRT that frequently simplifies proofs. Follow the link in the comment on my answer to learn more. Commented Dec 22, 2018 at 17:28
• I'll admit, I didn't quite observe the general fact yet when writing this. I've added an explicit mention :) Commented Dec 22, 2018 at 17:54

Hint $$\ \ \ 25\mid n\:\Rightarrow\: n\bmod 100 = 25(n/25 \bmod 4) = 25(\color{#c00}{n\bmod 4}) = 25\cdot\color{#c00}3$$

since here $$\!\color{#c00}{\bmod 4\!:\ n }\equiv (1\cdot 3)(5\cdot 7)\cdots (97\cdot 99)\equiv (1\cdot(-1))^{\large25}\!\equiv -1\equiv\color{#c00} 3$$

• We used $\ ab\bmod ac = a(b\bmod c),\,$ the mod Distributive Law, to factor out $\, a = 25\ \$ Commented Dec 22, 2018 at 16:45

Hint: The number $$5^{10}$$ ends with $$25$$. On the other hand, if $$k$$ is odd, then the number $$25k$$ ends with:

• $$25$$ if $$k=4n+1$$ for some non-negative integer $$n$$;
• $$75$$ if $$4=4n+3$$ for some non-negative integer $$n$$.

$$1,4 + 1=5, 2*8+1=9,....,4*24+1=97$$ are are $$1 \pmod 4$$

$$3,7,......, 4*24+3=99$$ are all $$-1\pmod 4$$.

So $$N = 1\cdot 3.... \cdot 97\cdot 99 \equiv 1^{25}(-1)^{25}\equiv -1\equiv 3\pmod 4$$.

And obviously $$N \equiv 0 \pmod {25}$$.

So by Chinese Remainder theorem we can always solve $$N\pmod{100 = 4*25}\equiv 75$$.

...

Most statements of CRT give the formula for solving but I can never remember the proper variables so I always do it by hand each time.

In this case $$3 + 4k = 25j;0\le k < 24; 0\le j < 4;$$. So $$3 + 4k= j + 4(6j)$$. $$j = 3; k=6j=18$$

and $$N \equiv 3+4k = 25j = 75 \pmod {100}$$

• This is exactly the same as the method I posted 15 mins prior, except you use CRT but I instead use MDL = Mod Distributive Law, an operational form of CRT which is easier to apply in many cases (see the last paragraph here for further details) Commented Dec 22, 2018 at 17:01
• Yes. But I used the CRT instead of MDL. (and you hadn't posted when I had begun typing). Commented Dec 22, 2018 at 17:05
• You should learn MDL - it makes problems like this much easier (I did this in 10 secs mentally) Commented Dec 22, 2018 at 17:07
• And for that matter your and my answers are both exactly the same as SmileyCraft who answered before either of us. Commented Dec 22, 2018 at 17:07
• "it makes problems like this much easier." For certain values of "easy".... Commented Dec 22, 2018 at 17:09