# How to find the last two digits of $299^{33}$. Is there any trick?

Find the last two digits of the number $N=299^{33}$

Is there any trick of finding the last two digits of such a big number. If yes, then kindly share it with me

Since your question is tagged with GMAT, I am going to assume you are not a mathematician... I am not either, and all this talk of Euler's theorem and modulus will give me a headache ;)

So, simply put... the trick is that only the rightmost two digits of each number being multiplied can have any effect on the rightmost two digits of the answer. So you can just drop the "$2$" from $299$ because $299$ squared ends with same $2$ digits as $99$ squared.

$2$nd power: $99 \times 99 = 9801, \ldots$ now you can drop the "$98$" because it has no effect on the rightmost two digits of the answer.

$3$rd power: $01 \times 99 = 99$

$4$th power: $99 \times 99 = 9801, \ldots$ drop the "$98$" again

$5$th power: $01 \times 99 = 99$

etc... See the pattern? Even powers will end with "$01$" and odd powers will end with "$99$"

Hint:

$$299 = 300 -1$$

Hence $N \equiv (-1)^{33} \pmod {100}$

Edit:

The following page could be helpful.

Let $a, q, b, r \in \mathbb{Z}$, and $$a=bq+r$$

then we say $a \equiv r \mod q.$

Using modular arithmetic we are able to generally solve some elementary number theory problem by focusing on what we are interested. For example in your case, we can focus on the last two digits, or if your interest is whether a number is odd or even, just deal with $\mod 2$.

Some operations that we can do include:

if $a \equiv b \pmod q$ and $c \equiv d \pmod q$ then we have $$a+c \equiv b+d \pmod q$$

and $$ac \equiv bd \pmod q$$

and $$a^k \equiv b^k \pmod q$$

Since $$299 = 3\times 100 -1,$$

we have $$299 \equiv -1 \pmod{100}$$

$$299^{33} \equiv (-1)^{33} = -1 \pmod{100}$$

Note that $$99 \equiv -1 \pmod{100}$$

Hence the last two digits is $99$

• Didn't understand @SiongThyeGoh – Sakuzi Markel Aug 14 '17 at 16:56
• Why are we dividing by 100?@SiongThyeGoh – Sakuzi Markel Aug 14 '17 at 16:57
• Taking the remainder after dividing by $10$ gives us the last digit. taking the remainder after dividing by $100$ gives us the last two digits.Taking the reaminder after dividing by $1000$ gives us the last three digits. For example $12345=123 \times 100 + 45$, hence dividing by $100$ and take the remainder gives us $45$, which is the last two digits. – Siong Thye Goh Aug 14 '17 at 16:58
• @SiongThyeGoh: it's clear that the OP knows no modular arithmetic. – Martin Argerami Aug 14 '17 at 19:39
• I would definitely recommend the OP to learn modular arithmetic. But he cannot follow your answer because he knows nothing about it. – Martin Argerami Aug 14 '17 at 20:12

Note: $$299^{33}=(300-1)^{33}=300^{33}-33\cdot 300^{32}\cdot 1+\cdots +33\cdot 300\cdot 1^{32}-1^{33}=M\cdot 100-1=\cdots99.$$

You can rewrite $299^{33}$ as $(300-1)^{33}$. Last $2$ digits of sum of all terms in binomial expansion except the last term is $00$. Because they can be divided by $300$. When we add the last term $-1$ to $00$, answer is $99$.

You can use the Chinese remainder theorem for these kind of problems.

Solution:

$100 = 4 \times 25$ and $\gcd(4,25) = 1$

Now we know that

$299 \equiv -1 \pmod4$

So, $299^{33}\equiv -1 \pmod4 \equiv 3\pmod4$

Now we also know that

$299 \equiv -1 \pmod{25}$

$299^{33} \equiv -1 \pmod{25}$

Now: $299^{33} \equiv -1 \pmod4$

$299^{33} \equiv -1 \pmod{25}$

so, $299^{33} \equiv -1 \pmod{100} \equiv 99 \pmod{100}$

If you mean the two leftest digits, you can copmute this as follows:

Let $N:=\Bigg[33 . \log_{10} 299\Bigg]$, then we can easily see that : $10^N \leq 299^{33} < 10^{N+1}$, so the two leftest digits is equal to $\Bigg[\dfrac{299^{33}}{10^{N-1}}\Bigg]$. But one can see that it is equal to $\Bigg[ 10 ^ { 1+ \Big \{ 33.\log_{10}299 \Big\} } \Bigg]=49.$

But iff you mean the two rightest digits it is equal to $(-1)^{33}=-1\equiv 99 \mod100$.

• Last means those at the end of an order, which for digits of a number is those at the right-hand side in an English left-to-right reading pattern. – Nij Aug 15 '17 at 7:27

The plain answer to the question ("is there any trick") is to compute modulo$~100$, just like one would compute modulo$~10$ for finding just the final digit. If you need the last $17$ digits, compute modulo$~10^{17}$.

The example in the current question is exceptionally easy, as $299\equiv-1\pmod{100}$. If the question were a bit harder, say finding the last three digits of $169^{2017}$, then it helps to know the order $\phi(n)$ of the multiplicative group modulo$~n$, since $a^{\phi(n)}\equiv1\pmod n$ whenever $a$ is relatively prime to$~n$. For positive whole powers of $10$ one has $\phi(10^k)=4\cdot10^{k-1}$, so $2017\equiv17\pmod{400}$ implies $169^{2017}\equiv 169^{17}\pmod{1000}$, which still requires a couple of modular multiplications to be performed explicitly, but which using "exponentiation by squaring" remains quite doable even by hand (five multiplications are required here: $169^2\equiv561$, $169^4\equiv561^2\equiv721$, $169^8\equiv721^2\equiv841$, $169^{16}\equiv841^2\equiv281$, and finally $169^{17}\equiv281\times169\equiv489$, all modulo$~1000$, which is the answer).

• @TripeHound Of course, don't know how I slipped off that key without noticing. Thanks. – Marc van Leeuwen Aug 15 '17 at 9:18