# Get the last two digits of $16^{100}$ and $17^{100}$

I try to get the last two digits of $16^{100}$ and $17^{100}$

I started with:

$6^{1} = 6$

$6^{2} = 36$

$6^{3} = 216$ means last digit for $6$ is always $6$

That is why the last digit for $16^{100}$ is $6$

And for $17^{100}$ i calculated:

$7^{1} = 7$

$7^{2} = 49$

$7^{3} = 343$

$7^{4} = 2401$

$7^{5} = 16807$

And because $4*25 = 100$ or better said $100mod4 = 0$

The last digit for $17^{100}$ is $1$

But how do i get the penultimate digits? Thanks

• Im asking about $16$ and $17$! But i thought it would be not important for the last digit if i only take the last digit of the number, thats why $6$ and $7$! Hope you understood me? – John Smith Dec 15 '13 at 14:47
• No sorry i would like to know the last two digits! But i tried to show i i got the last digit! DO you have any solution for the last two digits? Thanks – John Smith Dec 15 '13 at 14:52
• Brute force method, alpertron.com.ar/BIGCALC.HTM 17^100 ends in(07), 16^100 ends in(76) – Optionparty Dec 15 '13 at 16:06

## 2 Answers

As $(17,100)=1,$ and using Carmichael function $\displaystyle\lambda(100)=20$

$\displaystyle\implies17^{20}\equiv1\pmod{100}$

$16^{100}=(2^4)^{100}=2^{400}$

As $(2^{400},100)=4=2^2\ne1$ let us find $2^{400-2}\pmod{25}$

As $\displaystyle\lambda(25)=\phi(25)=20, 2^{20}\equiv1\pmod{25}$

and $\displaystyle400-2\equiv18\pmod{20}\implies 2^{400-2}\equiv2^{18}\pmod{25}$

Now, $\displaystyle2^9=512\equiv12\pmod{25}\implies 2^{18}=(2^9)^2\equiv12^2=144\equiv19\pmod{25}$

$\displaystyle\implies 2^{400-2}\equiv19\pmod{25}\ \ \ \ (1)$

Now as $\displaystyle a\equiv b\pmod m\implies a\cdot n\equiv b\cdot n\pmod{m\cdot n}$ for any integer $n,$

multiply either sides of $(1)$ by $4$

• Thanks four your great answer! I only have one more question i calculated the last digit with $mod10$ so i conclude that when i count with $mod100$ i would get the last two digits? Is that right? So is there any easier solution? Thanks – John Smith Dec 15 '13 at 14:34
• @user2724695, yes, determining the last $n$ digits mean $\pmod{10^n}$ for integer $n\ge1$. I am not sure of an easier solution – lab bhattacharjee Dec 15 '13 at 14:37
• Sorry but is the correct answer for 16Y100 mod 100 = 16 ? – John Smith Dec 15 '13 at 15:07
• @user2724695, nothing to be sorry, I think the answer must be $76$. What's the source of the problem? – lab bhattacharjee Dec 15 '13 at 15:11

Another way for $16$

We have already found $\displaystyle16^{100}=2^{400}$

$\displaystyle2^{10}=1024\equiv24\pmod{100}\implies 2^{20}\equiv24^2=576\equiv76$

Now, $\displaystyle2^{20a+b}-2^b=2^b(2^{20a}-1)\equiv0\pmod{100}$

if $4$ divides $2^b\iff$ integer $b\ge2$

and $2^{20a}-1$ is divisible by $2^{20}-1$ for any positive integer $a$ and $2^{20}\equiv1\pmod{25}$ by the other answer

So, $\displaystyle2^{20a+b}\equiv2^b\pmod{100}$ if integer $b\ge2,a\ge1$

Setting $\displaystyle b=20\implies2^{20(a+1)}\equiv2^{20}\pmod{100}\equiv76$

Now, set $a+1=20$

• @user2724695, another check for $\displaystyle16^{100}\pmod{100}$ – lab bhattacharjee Dec 15 '13 at 15:43
• @BenMillwood, thanks for your observation. It should be $20^b$ – lab bhattacharjee Dec 16 '13 at 3:19