# Finding Remainder Using Binomial Theorem

Find the remainder when $$7^{98}$$ is divided by $$5$$.

What I am doing here is expanding $${(5+2)}^{98}$$ using binomial theorem and writing it as $$5k + 2$$, where $$k$$ is a positive integer but the answer is $$4$$ and I'm getting $$2.$$

They are expanding $${(50 - 1)}^{49}$$ using binomial theorem and then writing $$50k - 1$$ and getting $$4$$ as a reminder.

How those two methods are different?

• $4$ is correct, so you made an error somewhere. If you seek help debugging your calculation then you need to show your work. The point of using BT is that it reduces it to computing $(-1)^{49},\,$ which is simpler than computing $\,2^{98}\pmod 5\ \$ – Bill Dubuque Jan 26 at 16:35
• But BT isn't needed: $\large\bmod 5\!:\, 7^{\large 98}\!\equiv (7^{\large 2})^{\large 49}\!\equiv (-1)^{\large 49}\!\equiv -1\equiv 4,\$ [or $\large\, 7\equiv 2\,$ and $\large\,2^{\large 2}\equiv -1$], by using standard congruence arithmetic rules. – Bill Dubuque Jan 26 at 16:47

The binomial theorem tells you $$(5+2)^{98} = \binom{98}{0}\cdot 5^{98}+\binom{98}{1}\cdot 5^{91}2^1+ \binom{98}{2}\cdot 5^{90}2^2+\cdots + \binom{98}{97}\cdot 5\cdot 2^{97}+ \binom{98}{98}\cdot 2^{98} = 5k+2^{98}.$$ So you need to find the remainder when $$2^{98}$$ is divided by $$5$$, not the remainder when $$2$$ is divided by $$5$$.
The method using $$(50-1)^{49}$$ is a little easier because $$(-1)^{49}=-1$$.
• Also $2^4 \equiv 1 \pmod 5$ and $2^{98}=2^{4 \cdot 24+2}$. – Mohammad Zuhair Khan Jan 26 at 16:30
With your method, you have to check the divison by 5 of $$2^{98} = 4\cdot (2^4)^{24} = 4\cdot (3\cdot 5 +1)^{24}$$ and, using the Binomial theorem again, you end up with a rest after division of $$4 \cdot 1^{24} = 4$$ which is also the "other" result.
When you expand $${(5+2)}^{98}$$, you will get $$5k+2^{98}$$, for some $$k\in\Bbb N$$.
If you know Fermat's little theorem, you have $$2^4\equiv 1\pmod 5$$. Hence $$2^{98}\equiv 2^{2}\equiv 4\pmod 5$$. So the remainder is $$4$$.