## KingGeorge 3 years ago [SOLVED] Number Theory Challenge (not actually that hard) Find $$89^{307}\pmod{713}$$ without using any kind of electronic aid. Please at least attempt it before resorting to Wolfram. Hint: $$713=23\cdot31$$.

1. KingGeorge

Since I ran out of space on the question: I only decided to ask this because when I was first doing this problem, I quickly discovered I didn't need an electronic aid.

2. KingGeorge

Hint 2: Use the Chinese Remainder Theorem. You will find it isn't as bad as it usually is.

3. zzr0ck3r

4. KingGeorge

It's a number theory function. So $$a\pmod{n}$$ returns the remainder of some number a when divided by n. There are a bunch of interesting applications for this, and when $$n$$ is prime, you get a bunch of awesome properties.

5. KingGeorge

It's also called "Clock arithmetic" sometimes http://en.wikipedia.org/wiki/Modular_arithmetic

6. zzr0ck3r

ahhh ok we used this in computer science

7. zzr0ck3r

so 8mod(3) = 2?

8. KingGeorge

Right.

9. zzr0ck3r

hmm

10. zzr0ck3r

one more hint, i dont see how the 23* 31 helps unless we could break up the top. into some multiple of 23 or 31

11. KingGeorge

You need to look at $$89^{307}\pmod{23}$$ and $$89^{307}\pmod{31}$$ independently. Since these are prime, a bunch of nice properties apply, and you can simplify each to a number between 0 and 23/31. Once you have that, apply Chinese Remainder Theorem. I've got to say though, if this is the first time you've ever really used modular arithmetic, this is still a hard problem.

12. zzr0ck3r

thats the fun of it:) I got to eat but will be back in a bit to try more

13. KingGeorge

Extra hints just for you. You need to be somewhat familiar with Fermat's Little Theorem. You also need to know how to find an inverse mod p using the Extended Euclidean Algorithm, and use successive squaring. These are all fairly basic number theory algorithms, and with a little practice, you should be able to get them.

14. Ishaan94

$89^{307}\pmod{23}=15$$89^{307}\pmod{31} = 15$15?

15. KingGeorge

Right on. Technically it requires an application of CRT at the end (which is not easy to do by hand), but since both are congruent to 15, you can skip that step.

16. Ishaan94

Thank you for helping me through.

17. KingGeorge

How much were you able to do by hand?

18. Ishaan94

I used calculator for 13*12*20 (mod 23) and for verifying my answers.

19. KingGeorge

Excellent job! However, there was an alternative, if slightly roundabout way of finding $$89^{307}\pmod{23}$$ without using successive squaring.

20. Ishaan94

oh hmm can you show me? or maybe a hint?

21. KingGeorge

Basically, notice the following.$89^{307}\equiv 20^{21}\pmod{23}$By Fermat's Little Theorem, you have that $20^{22}\equiv1\pmod{23}$so$20^{22}\equiv20^{21}\cdot20\equiv1\pmod{23}$Hence, $20^{21}\equiv20^{-1}\pmod{23}$So you just need to solve the congruence$20x\equiv1\pmod{23}$

22. KingGeorge

Got to go eat dinner now. Feel free to ask more questions on this and I'll answer them when I get back.

23. Ishaan94

I like it, it's much better and simpler than mine. Thank you.

24. KingGeorge

I love it when I can use it. It was a little trick I learned in my cryptography class.

Find more explanations on OpenStudy