Using modular arithmetic to help calculate Greatest Common Divisors

In a recent FPM class we discussed how to determine GCD(21,270+5).
[See also my earlier post on Greatest Common Divisors]
The answer here was that 21|270+5 and so

GCD(21,270+5)=21.

We discussed various ways to prove this. Some students had shown separately that 3|270+5 and 7|270+5, from which it follows, e.g. by prime factorization (Fundamental Theorem of Arithmetic, FTA), or by more elementary means, that 21|270+5 too.

In the Engagement Session we showed, instead, that 27024=16  (mod 21), which gives us

270+516+5=210  (mod 21)

and so 21|270+5.
We discovered that 27024  (mod 21) by looking at powers of 2 mod 21, and spotting that we had a repeating pattern with period 6 , so that

270=24+6624 (mod 21)

We then made this slightly more formal by noting that 26=64=3×21+1, so that

261 (mod 21),

which explains the repeating pattern. If you want to use the other approach (divisibility by 3 and by 7), I would note that

22=41 (mod 3),

and

23=81 (mod 7).

Then 270=(22)35135=1 (mod 3), which gives us

270+51+5=60 (mod 3),

and so 3|270+5 .
[An alternative is to use 21 (mod 3), so that 270(1)70=1 (mod 3), etc.] Similarly 269=(23)23123=1 (mod 7), which gives us

270+5=2×269+52×1+5=70 (mod 7)

and so 7|270+5 .

Comments

Popular posts from this blog

A rule of thumb for when to use the Ratio Test

An introduction to the Hahn-Banach extension theorem: Part VI

An introduction to the Weierstrass M-test: Part I