0% found this document useful (0 votes)
73 views10 pages

Modular

1. The document introduces modular arithmetic and congruences. It defines what it means for two integers a and b to be congruent modulo m, and provides examples. 2. Properties of modular arithmetic are discussed, including that congruences are transitive and that arithmetic operations preserve congruences. 3. Applications to solving problems involving remainders and divisibility are shown, such as computing remainders of powers and products.

Uploaded by

Mradul Tiwari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views10 pages

Modular

1. The document introduces modular arithmetic and congruences. It defines what it means for two integers a and b to be congruent modulo m, and provides examples. 2. Properties of modular arithmetic are discussed, including that congruences are transitive and that arithmetic operations preserve congruences. 3. Applications to solving problems involving remainders and divisibility are shown, such as computing remainders of powers and products.

Uploaded by

Mradul Tiwari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

MODULAR ARITHMETIC

PETER MCNAMRA
Bucknell University
and Trinity College Dublin
Motivating Problems.
(a) Find the remainder when 2123 is divided by 29.
(b) Do there exist integer solutions to

x2 + y2 = z2 ?

Yes: solutions are side-lengths of right-angled triangles, such as


3, 4, 5 or 5, 12, 13.
(c) Do there exist integer solutions to

x n + y n = z n for n > 2 ?

This is Fermat’s Last Theorem.


Pierre de Fermat 1637: conjectured “no.”
Andrew Wiles 1994: proved “no.”
Google “Nova the proof” for documentary (49 minutes)
or read “Fermat’s Last Theorem” by Simon Singh.

(d) Show there are no integer solutions to

x 2 + y 2 = 10z − 1 for z > 1.

This is an example of an exponential Diophantine equation. (Dio-


phantus of Alexandria, 3rd century)
3

1. MODULAR ARITHMETIC
Main definition. Integers a, b, m with m 6= 0.
We say “a is congruent to b modulo m” and write
a≡b (mod m) if
m | a−b i.e. m divides a − b.

Examples.
4 ≡ 9 (mod 5).
23 ≡ 1 (mod 2).
−5 ≡ 3 (mod 4).
In other words...
We say a≡b (mod m) if

◦ a and b have the same remainder when divided by m, or


◦ there exists an integer k such that a − b = km.
Properties.
1. If a ≡ b (mod m) and b ≡ c (mod m) then
a≡c (mod m).

e.g. 2013 ≡ 13 (mod 4) and 13 ≡ 1 (mod 4) so


2013 ≡ 1 (mod 4).

2. Suppose a1 ≡ b1 (mod m) and a2 ≡ b2 (mod m) then


a1 + a2 ≡ b1 + b2 (mod m), and
a1a2 ≡ b1b2 (mod m).
4

Proof of a1a2 ≡ b1b2 (mod m).


We have m | a1 − b1 and m | a2 − b2 and we wish to show that
m | a1a2 − b1b2.

a1a2 − b1b2 = a1a2 −b1a2 + b1a2 −b1b2

= a2(a1 − b1) + b1(a2 − b2).

Problem 1: just an example of previous identity. Find the


remainder of 46 × 23 (a.k.a. 46 . 23) on division by 7.

Solution. 46 ≡ 4 (mod 7) and 23 ≡ 2 (mod 7) so


46 . 23 ≡ 4 . 2 ≡ 8 ≡ 1 (mod 7).

Problem 2: look for a small partner. Compute 138 (mod 7).


What does this mean? The unique remainder r satisfying 0 ≤ r < 7.

Easiest solution. 138 ≡ (−1)8 ≡ 1 (mod 7).


5

Problem 3: multiple steps. Compute 2123 (mod 29).

Solution. Find a power of 2 that has a small remainder mod 29.


25 ≡ 3 (mod 29).

So
(25)k ≡ 3k (mod 29).

Repeat this idea:


33 ≡ 27 ≡ −2 (mod 29).

Now we have something useful:


215 ≡ (25)3 ≡ 33 ≡ −2 (mod 29).

Next,
2120 ≡ (215)8 ≡ (−2)8 (mod 29).

To save ourselves computing (−2)8 (mod 29), we can say

(−2)8 ≡ (−2)3(−2)5 ≡ (−8)(−32) ≡ (−8)(−3) ≡ 24 ≡ −5

Finally,

2123 ≡ 2120 . 23 ≡ −5 . 8 ≡ −40 ≡ −11 ≡ 18 (mod 29).

Answer: 18.
6

This page was added after the lecture.


A student asked the following question.
Question. Why does m dividing a − b mean that a and b have the
same remainer under division by m?

Answer. This is a good question since it requires some work to


give a complete proof.
By the definition of a “remainder,” we can write
a = im + r1,

where r1 is the remainder under division by m and satisfies


0 ≤ r1 ≤ m − 1.

Similarly,
b = jm + r2 with 0 ≤ r2 ≤ m − 1.

Then if m divides a − b, this means that m divides


im + r1 − jm − r2 = m(i − j) + r1 − r2.

Since m clearly divides m(i − j), we get that m divides r1 − r2.


We know that r1 and r2 are both between 0 and m − 1 inclusive,
which means that r1 − r2 is between −(m − 1) and m − 1 inclusive.
Therefore, the only possibility is that r1 − r2 = 0, so r1 = r2.
7

2. DIOPHANTINE EQUATIONS.
Main trick for today: pick an appropriate modulus.
Problem 4. Show there are no integer solutions to

x 2 + y 2 = 10z − 1 for z > 1.

Solution. Exercise in seats: find all possible values of x 2 (mod 4).


02 ≡ 0 (mod 4).
12 ≡ 1 (mod 4).
22 ≡ 0 (mod 4).
32 ≡ 1 (mod 4).
42 ≡ 0 (mod 4).
...

(i + km)2 ≡ i 2 + 2ikm + k 2m2 ≡ i 2 (mod m).

Key point:
x 2 + y 2 ≡ 0, 1 or 2 (mod 4).

Meanwhile,
10z − 1 ≡ 102 . 10z−2 − 1 ≡ −1 ≡ 3 (mod 4).

Since the mod 4 values are different, there are no solutions.

Why modulus 4? Because it works! (4 is good for squares, but


there’s not really a hard and fast rule.)
8

3. FERMAT’S LITTLE THEOREM.


Exercise in seats: pick any integers a and p. Then compute
ap−1 (mod p).

Fermat’s Little Theorem. For any prime p and any integer a


such that p 6 | a (i.e. p does not divide a),

ap−1 ≡ 1 (mod p).

Lots of nice proofs (Art of Problem Solving wiki has 4). Simple one
in Group Theory (college).
Example. a = 57 and b = 29:
5728 ≡ 1 (mod 29).

Problem 5. (1989 AIME) One of Euler’s conjectures was disproved


in the 1960s by two American mathematicians when they showed
there exists a positive integer n such that
1335 + 1105 + 845 + 275 = n5.

Find the value of n.

Question. How do we apply Fermat’s Little Theorem here?

Fermat’s Little Theorem restated. For any prime p and any


integer a,
ap ≡ a (mod p).
9

To see that it’s the same theorem as before note that:


◦ The case when p | a is trivial. So can assume p 6 | a.
◦ p divides ap−1 − 1 if and only if p divides ap − a = a(ap−1 − 1).

Solution to Problem 5.
First, apply Fermat’s Little Theorem:

1335 + 1105 + 845 + 275 ≡ 133 + 110 + 84 + 27 ≡ 4 (mod 5).

Try mod 2. LHS is even so n must be even.


Try mod 3.

1335 + 1105 + 845 + 275 ≡ 15 + (−1)5 + 05 + 05 ≡ 0 (mod 3).

So n is divisible by 2 and 3, has remainder 4 mod 5, and


must be greater than 133.
138, 144
144, 150, 156, 162, 168, 174
174, ... .
(preview of Chinese Remainder Theorem)

We’d like to show 174 is too big. One way:

1745 = (133 + 41)5 = 1335 + 5 . 1334 . 41 + other stuff + 415.

1335 = 1335.
415 > 275.

5 . 1334 . 41 = 205 . 1334 > 110 . 1334 + 84 . 1334 > 1105 + 845.

Answer: n = 144.
10

For the road...

Problem 6. Suppose 13 6 | m. Show that m4 + 8 is not the cube


of an integer (use arithmetic modulo 13).

Problem 7. Show that there are no integer solutions to


w 6 + x 6 + y 6 + z 6 = 1012 + 7

or
w 6 + x 6 + y 6 + z 6 = 1012 + 4.

(Pick an appropriate modulus for each.)

Problem 8. Now that you know Fermat’s Little Theorem, solve


Problem 3 in a (mildly) simpler way than before.

Problem 9.
(a) Show that an integer is divisible by 9 if and only if the sum of
its digits is divisible by 9.
(b) Show that an integer is divisible by 11 if and only if the alter-
nating sum (add the first digit, subtract the second, add the third,
subtract the fourth, etc.) of its digits is divisible by 11.

Problem 10. It’s nice when the number of things in a list is divisible
by 10. Discuss.

You might also like