-1

Suppose I have a number $x$ such that, $$ x \equiv 31^{29} \text{ (mod 57)} $$ How can I find $x$ using properties of modular arithmetic. Will it involve a special theorem?

  • 2
    $57=3*19$ so you can reduce it to solving that equation mod 3 and 19. From there use Fermat’s little theorem to reduce to exponent and the rest is probably just a little bit of brute force (for the 19 case in particular). –  Apr 12 '20 at 18:29
  • 1
  • @TokenToucan Binary method would be better than shear brute force, and could honestly be applied directly with fair ease. – HackerBoss Apr 12 '20 at 19:19
  • I am not familiar with the binary method. "Brute force" in this situation is actually quite easy. It isn't necessary at all for the mod 3 part, and the mod 19 part should only take a couple small computations to simplify. Perhaps post your technique as an answer for others unfamiliar with it. –  Apr 12 '20 at 19:32
  • @TokenToucan I got $31^{29} \equiv 31 $ mod $3$, but after using Fermat's Little Theorem how do i simplify $31^{18} \equiv 1$ mod $19$ – MathFan420 Apr 12 '20 at 19:46
  • @HackerBoss: In this case, as $31\equiv 1\bmod 3$, I think it simplifies greatly the computations if one has to do them by hand. – Bernard Apr 12 '20 at 21:23

1 Answers1

1

Here is one solution. By the Chinese Remainder Theorem, one reduces to solving the same equation mod 3 and mod 19, as we can patch those together at the end.

Mod 3: the easy case $$31^{29} = 1^{29} = 1$$

Mod 19: just a long chain of combining small groups of multiplications and reducing mod 19 as frequently as possible to keep the arithmetic easy $$31^{29} = 31^{11} = 12^{11} = 12*(12)^{2*5} = 12*(144)^5 = 12*(11)^5= 12*11*(11)^4$$ $$=12*11*(121)^2 = 12*11*7^2 = 12*11*49 = 12*11*11 = 12*7 = 84 = 8$$

So altogether the solution is congruent to 1 mod 3 and 8 mod 19, which we see lifts to 46 mod 57 (as usual for the CRT, just start with one solution, 8 mod 19, and add multiples of 19 until it is congruent to 1 mod 3).

Sometimes there are tricks to speed things up but these numbers look sort of "random" to me.

  • 1
    We could use $\bmod 19!:\ 31^6\equiv 1,$ by $,31^3\equiv (-7)^3\equiv -1,$ so $31^{29}\equiv 31^5\equiv -7(-8)^2\equiv 8\ \ $ – Bill Dubuque Apr 12 '20 at 23:14
  • Ah good eye, -7 would have been easier to handle than 12. –  Apr 13 '20 at 00:47