## anonymous 3 years ago Why is the last two digits of $$91^{71}$$ the same as 91mod100? Similarly, why is it true that the last two digits of $$81^{81}$$ the same as 81mod100, and that of $$71^{91}$$ the same as 71mod100?

1. anonymous

Maybe I should edit my question a bit. It should be "how do I know if the last two digits of $$91^{71}$$ is the same as 91mod100? What if I need to find last two digits of$$91^{70}$$?

2. anonymous

there the same thing, how much modular arithmetic do you know

3. anonymous

I only know how to find x^y mod (n) using the trick that express y in binary number first, then take mod.

4. anonymous

Why are you deleting your comment?

5. anonymous

oh your refering to the binary exponentiation algorithm

6. anonymous
7. anonymous

$$91^{71}\equiv 91 \text{ mod 100}$$ is what you are trying to show

8. anonymous

Wait!

9. anonymous

ok

10. anonymous

Suppose the question is find the last two digits of $$91^{71}$$. How would you start?

11. anonymous

Do you know what the mod operator does?

12. anonymous

if I were to write 91^71 in base 10

13. anonymous

it would be $$91^{71}=a+b10+c10^2+d10^3...$$

14. anonymous

now we can reduce that modulo 100, ok

15. anonymous

Ehh!!! So, finding the last two digits of n is the same as finding n mod 100?

16. anonymous

so $$91^{71}\text{ mod 100}=a+10b$$ Where a is are first digit and b are second digit

17. anonymous

yes pretty much

18. anonymous

And finding the last n digits of m is the same as finding m mod (10^n)?

19. anonymous

yes

20. anonymous

Which you can compute using your exponentiation by squaring algorithm or using a variety of other techniques

21. anonymous

though for small numbers like yours, I wouldn't use that technique

22. anonymous

What technique would you use?

23. anonymous

Don't tell me calculator ~_~

24. anonymous

well for $$91^{71}\text{ mod 100}$$

25. anonymous

I would reduce the 91 modulo 100, so I get,

26. anonymous

$$91^{71} \text{ mod 100} = (-9)^{71} \text{ mod 100}= -9^{71} \text{ mod 100}$$

27. anonymous

"reduce the 91 modulo 100"?

28. anonymous

Yes, I think maybe you should read up a little on modular arithmetic,

29. anonymous

$$91\equiv -9 \text{ mod 100}$$

30. anonymous

therefore

31. anonymous

$$91^{71}\equiv (-9)^{71}\text{ mod 100}$$

32. anonymous

so now we just have to compute -9 to the 71st power modulo 100

33. anonymous

but $$(-1)^{71}=-1$$

34. anonymous

so its just computing $$-9^{71}\text{ mod 100}$$

35. anonymous

Now 9 is coprime to 100

36. anonymous

and $$\phi(9)=6$$

37. anonymous

$$9^{6}\equiv 1 \text{ mod 100}$$

38. anonymous

raising both sides to the 12th power, gives

39. anonymous

$$9^{72}\equiv 1 \text{ mod 100 }$$

40. anonymous

$$-9^{72}\equiv -1 \text{ mod 100}$$

41. anonymous

but wqe want $$-9^{71} \text{ mod 100}$$

42. anonymous

if we let $$-9^{71}=x$$

43. anonymous

we have $$9x\equiv -1 \text{ mod 100}$$

44. anonymous

now all we have to do is solve for x modulo 100, and we have are solution, I know this looked like it took a while but its because I had to type over this chat, also there is many ways to solve somthing like this, if your just using a computer an algorithm like yours might be better.

45. anonymous

But if your doing it by hand, its helpful to be familear with some of this stuff, because sometimes there are 'easyier' ways to do things.

46. anonymous

I'll tag you if I have questions. I need to work it out myself to see if I really understand it. Sleep well :)

47. anonymous

alright later

48. anonymous

@Jack17 Problem problem problem "Now 9 is coprime to 100" "and ϕ(9)=6" " $$9^6≡1 mod 100$$" But isn't it $$a^{\phi(n)} ≡ 1 (\mod n)$$ ? Why would we find ϕ(9)???

49. anonymous

nice catch, this changes how you would proceed

50. anonymous

We want $$\phi(100)$$

51. anonymous

which is 40

52. anonymous

Don't be so lazy... :(

53. anonymous

Yay!!! Thanks!! :)

54. anonymous

$$9^{10}\equiv 1 \text{ mod 100 }$$

55. anonymous

Which you can get by exponentiation by squaring

56. anonymous

nvm im being stupid the original problem was $$-9^{71} \text{ mod 100}$$

57. anonymous

this is the same as $$-3^{142} \text{ mod 100}$$

58. anonymous

ahh maybe you should use your algorithm, i am to lazy to figure this out

59. anonymous

142 is a LARGE number!!!

60. anonymous

61. anonymous

use the fact $$9^{10}\equiv 1 \text{ mod 100}$$

62. anonymous

so $$9^{70}\equiv 1 \text{ mod 100}$$

63. anonymous

$$9^{71}\equiv 9\text{ mod 100}$$

64. anonymous

9^(40) ≡1 mod 100 since phi(100) is 40 o_o

65. anonymous

$$-9^{71}\equiv -9 \text{ mod 100}$$

66. anonymous

$$-9^{71}\equiv 91 \text{ mod 100}$$

67. anonymous

$$91^{71}\equiv 91 \text{ mod 100}$$

68. anonymous

the first two digits of $$91^{71}$$ are 1 and 9

69. anonymous

9^(10) ≡1 mod 100 <- How do you work this out?

70. anonymous

$$9^2\equiv -19 \text{ mod 100}$$

71. anonymous

$$9^4\equiv 19^2 \text{ mod 100}$$

72. anonymous

$$9^4\equiv -39 \text{ mod 100}$$

73. anonymous

$$9^8 \equiv 39^2 \text{ mod 100}$$

74. anonymous

$$9^8\equiv 21 \text{ mod 100}$$

75. anonymous

$$9^{10}\equiv 21*9^2 \text{ mod 100}$$

76. anonymous

$$9^{10}\equiv 1 \text{ mod 100}$$

77. anonymous

Got it! Have never thought that it works in this way... Another problem is that how you can draw the conclusion "so $$9^{70}≡1 \mod 100$$" from $$9^{10}≡1 \mod 100$$ quickly?

78. anonymous

I raised both sides to the 7th power

79. anonymous

Ok, I didn't notice that, sorry!!

80. anonymous

If $$a\equiv b \text{ mod m}$$ and $$c\equiv d \text{ mod m}$$ then $$ac\equiv bd \text{ mod m}$$

81. anonymous

Thanks!!! It looks pretty good now :) Btw, if you want to type LaTeX in the same line as the words, use \( instead of \[ . Thanks again for your help :)

82. anonymous

ye no problem