3

I started learning number theory, specifically modular arithmetic, and need help to understand the last equivalence in the following example :

$$561 \mid 128^{561} - 128 \iff 128^{561} \equiv128 \pmod{561} \iff (2^7)^{561} = 2^{3927} \equiv 2^7 \pmod{561}$$ $$\iff 2^{3920} \equiv 1 \pmod{561}.$$

As I said, I don't understand the very last equivalence, specifically why are we able to "divide" by $2^7$ (and why division is allowed if we are truly dividing)?

  • One super short version: because $\gcd(2^7,561)=1$ (you should check this!), the (extended) Euclidean algorithm gives an explicit 'inverse' for $2^7 \pmod {561}$. – Steven Stadnicki Sep 19 '17 at 00:04
  • 2
    If $,2,$ is coprime to $,m,$ then it is invertible (so cancellable) $\bmod m,$ (e.g. by Bezout). Explicitly $!\bmod 2k!-!1!:\ 2k\equiv 1,\Rightarrow, k\equiv 2^{-1}\ \ \ $ – Bill Dubuque Sep 19 '17 at 00:04
  • 1
    See this answer for elaboration on my prior comment (including a proof). – Bill Dubuque Sep 19 '17 at 00:26
  • @BillDubuque Thank you for the great reference. This will be most useful to me in the future. –  Sep 19 '17 at 00:32

2 Answers2

4

Because $561$ is odd, it is coprime to $2^7$, which means that $2^7$ has a multiplicative inverse modulo $561$ -- that is, some number $x$ such that $x\cdot 2^7 \equiv 1 \pmod{516}$. You don't need to know which number that is, just that it exists.

Now multiply by $x$ on both sides of $2^{3927}\equiv 2^7 \pmod{561}$.

  • If one is going to answer such a question, then one should at least justify why it is invertible. – Bill Dubuque Sep 19 '17 at 00:09
  • @BillDubuque: I did: Because it is coprime to the modulus. – hmakholm left over Monica Sep 19 '17 at 00:09
  • That's a claim, without justification. If the OP knew why that inference was true they probably would not ask this queston. – Bill Dubuque Sep 19 '17 at 00:11
  • Perfectly clear. Thank you. I went through the proof of the existence of multiplicative inverses so there is no need to add anything. Using the extended euclidean algorithm we can actually find the multiplicative inverse of $2^7$ in the ring $\mathbb{Z}_{561}$ but we only need to know it exists here as you said. –  Sep 19 '17 at 00:26
2

We have $$ 561 \mid 128^{561} - 128 \iff 561 \mid 2^{3927} - 2^7 \iff 561 \mid 2^7(2^{3920} - 1) \iff 561 \mid 2^{3920} - 1 $$ The last equivalence is a special case of

If $\gcd(a,m) = 1$, then $m$ divides $ab$ iff $m$ divides $b$.

lhf
  • 216,483