Mas4203 Class Notes1

Post on 13-Oct-2014

68 views 4 download

transcript

Bibliography:

1. Elementary Number Theory, James Tattershall, Cambridge 1999.

2. Elements of Number Theory, I.A. Barnett, Prindle, Weber andSchmidt 1969

PR (FIU) MAC 4203 1 / 89

1. Introduction

Number Theory: Area of mathematics whose aim is to uncover themany deep subtle relationships between different sorts of numbers.

Some classical unsolved problems in number theory

Are there infinitely many twin primes? (That is pairs of primenumbers (p, p + 2). Examples: 3,5 5,7 11,13 17,19

Are there infinitely many primes of the form N2 + 1?, Examples:5,17,37, ...

PR (FIU) MAC 4203 2 / 89

1. Introduction

Number Theory: Area of mathematics whose aim is to uncover themany deep subtle relationships between different sorts of numbers.

Some classical unsolved problems in number theory

Are there infinitely many twin primes? (That is pairs of primenumbers (p, p + 2). Examples: 3,5 5,7 11,13 17,19

Are there infinitely many primes of the form N2 + 1?, Examples:5,17,37, ...

PR (FIU) MAC 4203 2 / 89

Assignments

1. Add up the first few odd numbers and see if the numbers you getsatisfy some sort of pattern. Express the pattern as a formula. Provethat the formula is correct.

2.

(a) Do you think that there are infinitely many primes of the formN2 − 1?

(b) Do you think that there are infinitely many primes of the formN2 − 2?

(c) How about the form N2 − 3? How about N2 − 4?

(d) Which values of a do you think give infinitely many primes of theform N2 − a?

PR (FIU) MAC 4203 3 / 89

2. Divisibility

Notation: "m divides n": m | n, meaning n = mk for some integer k .

Such an m is called a divisor of n.

m - n: m doesn’t divide n.

The greatest common divisor of a,b is the largest number that dividesboth a and b.

Notation: gcd(a,b) or simply (a,b).

PR (FIU) MAC 4203 4 / 89

2. Divisibility

Notation: "m divides n": m | n, meaning n = mk for some integer k .

Such an m is called a divisor of n.

m - n: m doesn’t divide n.

The greatest common divisor of a,b is the largest number that dividesboth a and b.

Notation: gcd(a,b) or simply (a,b).

PR (FIU) MAC 4203 4 / 89

Example: (14,35) = 7

Euclidean Algorithm for gcd

Example: Compute (36,132)

132 = 3× 36 + 24

36 = 1× 24 + 12

24 = 2× 12 + 0

(36,132) = 12

PR (FIU) MAC 4203 5 / 89

Example: (14,35) = 7

Euclidean Algorithm for gcd

Example: Compute (36,132)

132 = 3× 36 + 24

36 = 1× 24 + 12

24 = 2× 12 + 0

(36,132) = 12

PR (FIU) MAC 4203 5 / 89

General Euclidean Algorithm: A = Q × B + R

(a,b) = rn, where

r−1 = a

r0 = b

a = q1 × b + r1

b = q2 × r1 + r2... =

...

rn−2 = qn × rn−1 + rn

rn−1 = qn+1rn + 0

PR (FIU) MAC 4203 6 / 89

Verification: For i = 1,2, ....,n − 1,

ri−1 = qi+1 × ri + ri+1

So moving backward from last step: rn | rn−1, rn | rn−2, ..... onereaches rn | r2 = and rn | r1, which implies that rn | b and rn | a by firststep.

Why is rn the gcd of a and b?

Suppose d is any divisor of a and b.

a = q1 × b + r1 implies that d | r1

b = q2 × r1 + r2 implies that d | r2. Inductively, d | ri−1 and d | ri impliesthat d | ri+1 (follows from ri−1 = qi+1 × ri + ri+1).

Eventually, one reaches d | rn.

PR (FIU) MAC 4203 7 / 89

Verification: For i = 1,2, ....,n − 1,

ri−1 = qi+1 × ri + ri+1

So moving backward from last step: rn | rn−1, rn | rn−2, ..... onereaches rn | r2 = and rn | r1, which implies that rn | b and rn | a by firststep.

Why is rn the gcd of a and b?

Suppose d is any divisor of a and b.

a = q1 × b + r1 implies that d | r1

b = q2 × r1 + r2 implies that d | r2. Inductively, d | ri−1 and d | ri impliesthat d | ri+1 (follows from ri−1 = qi+1 × ri + ri+1).

Eventually, one reaches d | rn.

PR (FIU) MAC 4203 7 / 89

Assignment

Let b = r0, r1, r2, ... be the successive remainders in the Euclideanalgorithm applied to a and b. Show that every two steps reduces theremainder by at least one half. In other words, verify that

ri+2 <12

ri

for every i = 0,1,2, ... Conclude that the Euclidean algorithm willterminate in at most 2 log2 b steps.

PR (FIU) MAC 4203 8 / 89

Least Common Multiple

The least common multiple (lcm) of a and b is the smallest number ofwhich a and b are divisors.

Notation lcm(a,b) = [a,b].

Claim: ab = (a,b)[a,b].

PR (FIU) MAC 4203 9 / 89

Least Common Multiple

The least common multiple (lcm) of a and b is the smallest number ofwhich a and b are divisors.

Notation lcm(a,b) = [a,b].

Claim: ab = (a,b)[a,b].

PR (FIU) MAC 4203 9 / 89

Proof: (Skip!!) [a,b] = ak with b | ak .

If d = (a,b), then a = da′ and b = db′, with (a′,b′) = 1.

Since b | ak = da′k , then db′ | da′k , that is b′ | k .

In other words, k = b′t , and

[a,b] = ab′t = a(bd)t = (

ad)bt

The least common multiple is obtained when t is the smallest naturalnumber, that is t = 1. Hence

[a,b] =ab

(a,b).

PR (FIU) MAC 4203 10 / 89

Divisibility by 4 and 8; 5 and 25

In base 10, every integer N has a unique expression

N = an10n + an−110n−1 + ...+ a110 + a0

Claim: N is divisible by 2k if and only if ak−110k−1 + ...+ a0 is divisibleby 2k .

Proof:k−1∑i=0

ai10i = N −∑i≥k

ai10i

Each term in the summation on the right side is divisible by 2k , so thesummation on the left side is divisible by 2k if and only if N is divisibleby 2k .

PR (FIU) MAC 4203 11 / 89

Examples: 2455314 is not divisible by 4 = 22, because 14 is notdivisible by 4.

2477312 is divisible by 8 = 23 because 312 is divisible by 8.

PR (FIU) MAC 4203 12 / 89

Examples: 2455314 is not divisible by 4 = 22, because 14 is notdivisible by 4.

2477312 is divisible by 8 = 23 because 312 is divisible by 8.

PR (FIU) MAC 4203 12 / 89

It follows easily from 10 = 2× 5 that

N is divisible by 5k if and only if

k−1∑i=0

ai10i

is divisible by 5k

Assignments

1. The last 3 digits of an integer N are X24. Find the missing integer Xif N is divisible by 8.

2. The last three digits of an integer N are 2X4. Find the missing digitX if N is divisible by 8.

PR (FIU) MAC 4203 13 / 89

It follows easily from 10 = 2× 5 that

N is divisible by 5k if and only if

k−1∑i=0

ai10i

is divisible by 5k

Assignments

1. The last 3 digits of an integer N are X24. Find the missing integer Xif N is divisible by 8.

2. The last three digits of an integer N are 2X4. Find the missing digitX if N is divisible by 8.

PR (FIU) MAC 4203 13 / 89

Remainder when dividing by 9

Claim: If N =∑n

i=0 ai10i and

N = 9×Q + R, with R 6= 0

thenn∑

i=0

ai = R

We can use this fact to find the least remainder when N is divided by 9.

Add up the digits of N: an + ...+ a1 + a0.

If the sum is > 9, add up the digits of the sum

repeat this process until the sum of digits comes up < 9.

This method is called The method of casting out nines

PR (FIU) MAC 4203 14 / 89

Example Find the (least) remainder when 13578 is divided by 9.

1+3+5+7+8=24

2+4=6

The least remainder is equal to 6.

PR (FIU) MAC 4203 15 / 89

Proof of the claim behind the method:

LetN = 9×Q + R

ThenN9

= Q +R9

So

N9

=an10n + ...+ a110 + a0 − (an + ...+ a1 + a0) + (an + ...+ a1 + a0)

9

=an(10n − 1) + ...+ a1(10− 1)

9+

an + ...+ a0

9

=9Q9

+an + ...+ a0

9

= Q +an + ...+ a0

9

PR (FIU) MAC 4203 16 / 89

EquivalentlyN = 9×Q + an + ...+ a0

soR = an + ...+ a1 + a0

As a consequence:

N is divisible by 9 if and only if the sum of its digits is divisible by 9

Another consequence is:

N is divisible by 3 if and only if the sum of its digits is divisible by 3

PR (FIU) MAC 4203 17 / 89

EquivalentlyN = 9×Q + an + ...+ a0

soR = an + ...+ a1 + a0

As a consequence:

N is divisible by 9 if and only if the sum of its digits is divisible by 9

Another consequence is:

N is divisible by 3 if and only if the sum of its digits is divisible by 3

PR (FIU) MAC 4203 17 / 89

EquivalentlyN = 9×Q + an + ...+ a0

soR = an + ...+ a1 + a0

As a consequence:

N is divisible by 9 if and only if the sum of its digits is divisible by 9

Another consequence is:

N is divisible by 3 if and only if the sum of its digits is divisible by 3

PR (FIU) MAC 4203 17 / 89

Proof:N − 9×Q = an + ...+ a0

If N is divisible by 3, then so is an + ...+ a0 since 9×Q is clearlydivisible by 3. Conversely, if an + ...+ a0 is divisible by 3, then so isN = 9×Q + an + ...+ a0.

PR (FIU) MAC 4203 18 / 89

Assignments

1. Check 62085 for divisibility by 3 and 9.

2. Check each of the following for divisibility by 6 and 12.

a) 23082

b) 14064

c) 241224

(Divisibility by 6 means by 2 and 3; divisibility by 12 means by 3 and 4)

3. The number X203X is divisible by 24 (= 23.3). Find the missingdigits.

PR (FIU) MAC 4203 19 / 89

3. Linear diophantine equations

A diophantine equation is one of the form:

ax + by = c

a, b and c are integers and integer solutions (lattice points) are sought.

Example:2x + 3y = 11

some solutions are (1,3) (7,−1),...

PR (FIU) MAC 4203 20 / 89

Here is an example without any solution:

2x + 4y = 3

Any solution (x0, y0) would have to satisfy

2(x0 + 2y0) = 3

but this is impossible because 3 is not divisible by 2.

PR (FIU) MAC 4203 21 / 89

Ifax + by = c

has a solution, then gcd(a,b) | c.

Before we prove the converse, let us look at the casec = d = gcd(a,b).

Solvingax + by = gcd(a,b)

Example: Solve22x + 60y = gcd(22,60)

PR (FIU) MAC 4203 22 / 89

The Euclidean Algorithm for gcd(22,60) goes:

60 = 2× 22 + 16

22 = 1× 16 + 6

16 = 2× 6 + 4

6 = 1× 4 + 2

4 = 2× 2 + 0

PR (FIU) MAC 4203 23 / 89

gcd(22,60) = 2 and going through the algorithm, with a = 60, b = 22,one has:

16 = 60− 2× 22

6 = 22− 1× 16

= 22− 60 + 2× 22

= 3× 22− 60

4 = 16− 2× 6

= 60− 2× 22− 6× 22 + 2× 60

= 3× 60− 8× 22

2 = 6− 1× 4

= 3× 22− 60− 3× 60 + 8× 22

2 = 11× 22− 4× 60

PR (FIU) MAC 4203 24 / 89

How to get all solutions

For gcd(a,b) = 1, solveax + by = 1.

Let (x1, y1) be a solution.

Observation: (x1 − kb, y1 + ka), k = 0,±1,±2, .... is also a solution!

Proof:

(x1 − kb)a + b(y1 + ka) = x1a + y1b − k(ba) + (kba) = 1.

Claim: This procedure gives all solutions

PR (FIU) MAC 4203 25 / 89

Proof: Suppose (x1, y1) and (x2, y2) are two solutions.

ax1 + by1 = 1

ax2 + by2 = 1

Multiply the first identity by y2, the second by y1 to obtain:

y2ax1 + by2y1 = y2

y1ax2 + y1by2 = y1

PR (FIU) MAC 4203 26 / 89

Substract the second from the first identity:

a(y2x1 − y1x2) = y2 − y1

Repeat this with x2 and x1 to get

b(x2y1 − y2x1) = x2 − x1

Let k = (x2y1 − y2x1). Then we see that

x2 = x1 + kb

andy2 = y1 − ka

This settles the case gcd(a,b) = 1. What if gcd(a,b) > 1?

PR (FIU) MAC 4203 27 / 89

Let gcd(a,b) = d . We know that

ax + by = d

has at least one solution (x1, y1). But also, it is clear that (x1, y1) is asolution of

ad

x +bd

y = 1 (∗)

with gcd( ad ,

bd ) = 1

Any other solution of (∗) is given by

x2 = x1 + kbd, y2 = y1 − k

ad

This completes the description of all solutions of ax + by = d .

PR (FIU) MAC 4203 28 / 89

Let gcd(a,b) = d . We know that

ax + by = d

has at least one solution (x1, y1). But also, it is clear that (x1, y1) is asolution of

ad

x +bd

y = 1 (∗)

with gcd( ad ,

bd ) = 1

Any other solution of (∗) is given by

x2 = x1 + kbd, y2 = y1 − k

ad

This completes the description of all solutions of ax + by = d .

PR (FIU) MAC 4203 28 / 89

Examples: Find all solutions for 14x + 35y = 7.

35 = 2× 14 + 7

14 = 2× 7 + 0

So7 = 35− 2× 14

(x1, y1) = (−2,1) is a solution. Any other solution is of the form

x2 = −2 + 5k , y2 = 1− 2k , k = ±1,±2, ....

PR (FIU) MAC 4203 29 / 89

Examples: Find all solutions for 14x + 35y = 7.

35 = 2× 14 + 7

14 = 2× 7 + 0

So7 = 35− 2× 14

(x1, y1) = (−2,1) is a solution. Any other solution is of the form

x2 = −2 + 5k , y2 = 1− 2k , k = ±1,±2, ....

PR (FIU) MAC 4203 29 / 89

We have seen that if ax + by = c has a solution, then gcd(a,b) | c.We will show that

conversely, if gcd(a,b) | c, then ax + by = c has a solution.

Proof:

Let d = (a,b). There are integers x0 and y0 such that

ax0 + by0 = d

These are determined by solving for the remainders and substituting inthe last step of the Euclidean algorithm for gcd .

PR (FIU) MAC 4203 30 / 89

Multiply both sides of the equation by c/d

a(x0

dc) + b(

y0

dc) = c

Let x1 = x0d c, y1 = y0

d c. Then

ax1 + by1 = c

showing that ax + by = c has a solution.

PR (FIU) MAC 4203 31 / 89

Example

Find a solution for4x + 6y = 12.

Observe gcd(4,6) = 2 and 2 | 12. So there is a solution. To find one,first solve

4x + 6y = 2

or equivalently2x + 3y = 1

PR (FIU) MAC 4203 32 / 89

The Euclidean algorithm goes:

3 = 1× 2 + 1

2 = 2× 1 + 0

Solving for remainders:

gcd(2,3) = 1 = 3− 1× 2

2× (−1) + 3× 1 = 1

So x0 = −1, y0 = 1.

PR (FIU) MAC 4203 33 / 89

Multiplying this identity by 12, we get:

2× (−12) + 3× (12) = 12

or equivalently:

4× (−6) + 6× 6 = 12

So a solution of 4x + 6y = 12 is given by x = −6, y = 6

PR (FIU) MAC 4203 34 / 89

ax + by = c has a solution if and only if d = gdc(a,b) divides c, inwhich case it is given by x = x0

d c, y = y0d c, where (x0, y0) is a solution

ofad

x +bd

y = 1.

PR (FIU) MAC 4203 35 / 89

Assignments: solve

a) 3x+4y=1

b) 6x+9y=2

c) 117x+52y=26

PR (FIU) MAC 4203 36 / 89

Direct method of finding solutions

Example: Suppose a man makes a purchase of $1.15 and gives theclerk two $1 bills. In how many ways may he receive his change indimes and quarters?

0 ≤ d = number of dimes

0 ≤ q = number of quarters

10d + 25q = 85

Equivalently2d + 5q = 17

PR (FIU) MAC 4203 37 / 89

Direct method of finding solutions

Example: Suppose a man makes a purchase of $1.15 and gives theclerk two $1 bills. In how many ways may he receive his change indimes and quarters?

0 ≤ d = number of dimes

0 ≤ q = number of quarters

10d + 25q = 85

Equivalently2d + 5q = 17

PR (FIU) MAC 4203 37 / 89

Solve for the variable with smallest coefficient:

2d = 17− 5q

d = 8 +12− 2q − q

2= 8− 2q +

1− q2

t = 1−q2 must be an integer and, following the rule above

q = 1− 2t

Substituting in the expression of d , we get:

d = 8− 2(1− 2t) + t = 6 + 5t

PR (FIU) MAC 4203 38 / 89

All solutions are obtained by letting t = 0,±1,±2, ... but only few ofthese meet the requirement d ≥ 0, q ≥ 0.

d ≥ 0⇒ 6 + 5t ≥ 0⇒ t ≥ −65

q ≥ 0⇒ 12 ≥ t .

so −65 ≤ t ≤ 1

2 , thus t = −1 or t = 0. The solutions are (d ,q) = (1,3)and (d ,q) = (6,1).

PR (FIU) MAC 4203 39 / 89

Another example: A man cashes a check at his bank and the tellermistakenly interchanges dollars and cents. After leaving the bank, theman spends 68 cents and then discover that he now has twice theamount of the original check. What was the amount of the check?

PR (FIU) MAC 4203 40 / 89

Let 0 ≤ d ≤ 100 denote the number of dollar bills and 0 ≤ c ≤ 100 thatof pennies.

100d + c − 68 = 2(d + 100c)

That is98d − 199c = 68

gcd(98,199)=1 and 1 | 68, so we expect a solution to exist.

PR (FIU) MAC 4203 41 / 89

Solve for d which has the smallest coefficient:

d = 2c +3c + 68

98

z = 3c+6898 must be an integer, and solving for c (which has the smallest

coefficient in this equation)

c = 32z − 22 +2z − 2

3

Again, u = 2z−23 must be an integer and solving for z gives

z = u + 1 +u2

PR (FIU) MAC 4203 42 / 89

t = u2 must be an integer and

u = 2t

Back substituting, one gets:

z = 3t + 1

c = 98t + 10

d = 199t + 21

0 ≤ c ≤ 100 and 0 ≤ d ≤ 100 imply that t = 0 is the only acceptablevalue and the solution is c = 10 and d = 21. The amount of the checkwas $10.21.

PR (FIU) MAC 4203 43 / 89

Assignment:

1. Five times a nonnegative integer added to seven times anothernonnegative integer give a sum of 100. Find all possible integers.

5n + 7m = 100

2. Solve:33x + 14y = 113

PR (FIU) MAC 4203 44 / 89

Linear diophantine equations in more than 2unknowns

a1x1 + ....+ anxn = b

We will focus on 3 unknowns

ax + by + cz = k

PR (FIU) MAC 4203 45 / 89

gcd and lcm when prime factorization is known

a = p1a1 ...pk

ak

b = p1b1 ...pk

bk

gcd(a,b) = p1sm(a1,b1)...pk

sm(ak ,bk )

lcm(a,b) = p1la(a1,b1)...pk

la(ak ,bk )

The definitions can be extended to 3 or more numbers.

PR (FIU) MAC 4203 46 / 89

ax + by + cz = k

Necessarily, gcd(a,b, c) divides k for a solution to exist.

Conversely, suppose d = gcd(a,b, c) divides k . Find integersx ′, y ′, z ′ such that

ax ′ + by ′ + cz ′ = d .

Then

(x ′kd

,y ′kd

,z ′kd

)

is a solution of

au + bv + cw = k

PR (FIU) MAC 4203 47 / 89

Example: Find positive solutions to

15x + 12y + 8z = 400

gcd(15,12,8)=1 and 1 | 400 so there is a solution! At each stage, solvefor the unknown with smallest coefficient:

z = 50− x − 7x8− y − 4y

8= 50− x − y − (

7x + 4y8

)

u = 7x+4y8 must be an integer and from 8u = 7x + 4y , we solve for y :

y = 2u − x − 3x4

PR (FIU) MAC 4203 48 / 89

Again, v = 3x4 must be an integer and solving for x gives

x = v +v3

t = v3 must be an integer and

v = 3t

PR (FIU) MAC 4203 49 / 89

Recap:v = 3t

x = 3t + t = 4t

y = 2u − 7t

z = 50− 3u + 3t

Solutions are given by two nonindependent integer parameters t andu, each taking values 0,±1,±2, ....

PR (FIU) MAC 4203 50 / 89

We need now to determine u and t so that x , y , z are positive integers!

t ≥ 0

u ≥ 7t2

u ≤ 503

+ t

and503

+ t − 72

t ≥ 0⇒ t ≤ 203.

So0 ≤ t ≤ 20

372

t ≤ u ≤ 503

+ t

PR (FIU) MAC 4203 51 / 89

t=0 u=0,1,...,16t=1 u=4,5,...,17t=2 u=7,8,...,18t=3 u=10,11,...,19t=4 u=14,15,...,20t=5 u=17,18,...,21t=6 u=21,22

Assignment: Find gcd(60,144,280).

Solve60x + 144y + 280z = 4

PR (FIU) MAC 4203 52 / 89

Solving systems

To solve the system

15x + 12y + 8z = 400

x + y + z = 40

Solve the first equation:

x = 4t

y = 2u − 7t

z = 50− 3u + 3t

PR (FIU) MAC 4203 53 / 89

Then substitute into the second equation:

−u + 50 = 40

Thusu = 10

Sox = 4t

y = 20− 7t

z = 20 + 3t

PR (FIU) MAC 4203 54 / 89

The requirement x ≥ 0, y ≥ 0 and z ≥ 0 imply:

t ≥ 0

20 ≥ 7t ⇒ t ≤ 2

The solution set consists of

(x , y , z) = (0,20,20), (4,13,23), (8,6,26)

PR (FIU) MAC 4203 55 / 89

A simpler method

Eliminate one of the unknowns, say z, from the system. Obtaining asingle equation in two unknowns. Proceed as before!

Assignment:

1. Solve the system:x + 3y − 4z = 8

2x + y + 3z = 39

2. There are 1000 seats in an auditorium. If men are charged $5 perseat, women $4 and children $0.75, in how many different ways couldthe house be sold to realize $ 3000?

PR (FIU) MAC 4203 56 / 89

4. Factorization and the Fundamental Theorem ofArithmetic

Claim: Let p be a prime number. If p | ab, then p | a or p | b.

Proof of claim: Suppose p | ab and p - a, then

ab = kp ⇒ k =abp

→ bp

is an integer

⇒ p | b.

PR (FIU) MAC 4203 57 / 89

4. Factorization and the Fundamental Theorem ofArithmetic

Claim: Let p be a prime number. If p | ab, then p | a or p | b.Proof of claim: Suppose p | ab and p - a, then

ab = kp ⇒ k =abp

→ bp

is an integer

⇒ p | b.

PR (FIU) MAC 4203 57 / 89

Alternate proof: Suppose p | ab and p - a. Then gcd(p,a) = 1 and sothe diophantine equation

px + ay = 1

has integer solutions. It follows that

bpx + bay = b

has also integer solutions.

Since p | bpx and p | bay , it follows that p | b.

PR (FIU) MAC 4203 58 / 89

Prime divisibility property

Let p be a prime number.

If p | a1a2...an, then p | aj for at least one j , 1 ≤ j ≤ n.

The Fundamental Theorem of Arithmetic:

Every integer n ≥ 2 can be factored into a product of primes

n = p1p2...pr

in exactly one way.

PR (FIU) MAC 4203 59 / 89

Proof:2 = 2

3 = 3

4 = 2.2

Suppose ∀n ≤ N, n = p1np2n ...prn

If N + 1 is composite, then N + 1 = n1n2 with

2 ≤ n1, n2 ≤ N

Son1 = p1n1

...prn1; n2 = p1n2

...prn2

PR (FIU) MAC 4203 60 / 89

Multiplying, we get a prime factorization for N + 1.

N + 1 = n1n2 = p1n1...prn1

p1n2...prn2

Supposen = p1...pr = q1...qs

are two prime factorizations for n. Then p1 | n⇒ p1 | qj for some1 ≤ j ≤ s. So p1 = qj . We may assume after rearranging terms thatp1 = q1.

PR (FIU) MAC 4203 61 / 89

Nowp2...pr = q2...qs

repeating the same argument, we reach the fact that

pr = qr

So r = s and qi = pi , for 1 ≤ i ≤ r .

Assignments

1. Suppose that gcd(a,b)=1 and suppose further that a divides theproduct bc. Show that a must divide c.

PR (FIU) MAC 4203 62 / 89

Nowp2...pr = q2...qs

repeating the same argument, we reach the fact that

pr = qr

So r = s and qi = pi , for 1 ≤ i ≤ r .

Assignments

1. Suppose that gcd(a,b)=1 and suppose further that a divides theproduct bc. Show that a must divide c.

PR (FIU) MAC 4203 62 / 89

5. Congruences

a is congruent to b modulo m is denoted and defined by:

a ≡ b(mod m)⇔ m | a− b

m is called the modulus of the congruence.

Congruences with common modulus can be added, but generally notdivided! This allows us to solve equations like:

Find x ifx + 12 ≡ 5 (mod 8)

x ≡ 5− 12 ≡ −7 (mod 8)

x ≡ 1 (mod 8).

PR (FIU) MAC 4203 63 / 89

Modular arithmetic

Theorem: If ai ≡ bi (mod m), for i = 1,2, ...,n, then

a)∑n

i=1 ai ≡∑n

i=1 bi (mod m)

b)∏n

i=1 ai ≡∏n

i=1 bi (mod m)

PR (FIU) MAC 4203 64 / 89

If a ≡ b (mod mi), for i = 1,2, ..., k , where m1,m2, ...,mk are pairwiseco-prime, then a ≡ b (mod m) where m =

∏ki=1 mi .

In modular arithmetic, the cancelation law

ac ≡ bc (mod m)⇒ a ≡ b (mod m)

doesn’t necessarily hold.

Theorem:If ac ≡ bc (mod m), then

a ≡ b (modmd)

where d = gcd(c,m).

PR (FIU) MAC 4203 65 / 89

Proof:If ac ≡ bc (mod m), then ac − bc = km for some integer k .

Let d = gcd(c,m). Then

(a− b)(cd) = k(

md),

with gcd( cd ,

md ) = 1. Hence, m

d divides a− b or equivalently,

a ≡ b (modmd).

Corollary: If ac ≡ bc (mod m) and gcd(c,m) = 1, then a ≡ b(mod m).

PR (FIU) MAC 4203 66 / 89

Exercises:

1. Solve: 4x ≡ 3 (mod 19)

Multiply by 5:

20x ≡ 15 (mod 19)

But 20 ≡ 1 (mod 19), so: 20x ≡ x (mod 19), hence:

x ≡ 15 (mod 19)

2. x2 + 2x − 1 ≡ 0 (mod 7)

Try 1,2, ...,6

x ≡ 2 (mod 7), x ≡ 3 (mod 7).

3. x2 ≡ 3 (mod 10) has no solution.

PR (FIU) MAC 4203 67 / 89

Exercises:

1. Solve: 4x ≡ 3 (mod 19)

Multiply by 5:

20x ≡ 15 (mod 19)

But 20 ≡ 1 (mod 19), so: 20x ≡ x (mod 19), hence:

x ≡ 15 (mod 19)

2. x2 + 2x − 1 ≡ 0 (mod 7)

Try 1,2, ...,6

x ≡ 2 (mod 7), x ≡ 3 (mod 7).

3. x2 ≡ 3 (mod 10) has no solution.

PR (FIU) MAC 4203 67 / 89

Exercises:

1. Solve: 4x ≡ 3 (mod 19)

Multiply by 5:

20x ≡ 15 (mod 19)

But 20 ≡ 1 (mod 19), so: 20x ≡ x (mod 19), hence:

x ≡ 15 (mod 19)

2. x2 + 2x − 1 ≡ 0 (mod 7)

Try 1,2, ...,6

x ≡ 2 (mod 7), x ≡ 3 (mod 7).

3. x2 ≡ 3 (mod 10) has no solution.PR (FIU) MAC 4203 67 / 89

Solving ax ≡ c (mod m)

Find x so thatax − c = my

Equivalently:ax −my = c

Let d = gcd(a,m). If d - c, then no solution!

If d | c, then find a solution to au + mv = d . Say u = u0, v = v0 hasbeen found. Multiply the equation above by c

d .

acu0

d+ m

cv0

d= c

So x0 ≡ cu0d (mod m) is a solution to ax ≡ c (mod m).

PR (FIU) MAC 4203 68 / 89

To find other solutions, observe that if x1 is one, then m | ax1 − ax0. So

md| a(x1 − x0)

d

But gcd(m,a) = d , so md | (x1 − x0). In other words,

x1 = x0 + kmd, k = 0,1,2, ...,d − 1.

PR (FIU) MAC 4203 69 / 89

Assignments

1. Suppose that ac ≡ bc (mod m) and also assume thatgcd(c,m) = 1. Prove that a ≡ b (mod m).

2. Find all incongruent solutions to each of the following congruences:

(a) 7x ≡ 3 (mod 15)

(b) 6x ≡ 5 (mod 15)

(c) x2 ≡ 1 (mod 8)

(d) x2 ≡ 3 (mod 7)

(e) x2 ≡ 2 (mod 7)

PR (FIU) MAC 4203 70 / 89

Properties of divisibility by means of congruences

In the denary scale, any number N admits the expansion:

N = an.10n + ...+ a1.10 + a0

Divisibility by 4: For k ≥ 2,

102 ≡ 0 (mod 4),103 ≡ 0 (mod 4), ...,10k ≡ 0 (mod 4)

PR (FIU) MAC 4203 71 / 89

Properties of divisibility by means of congruences

In the denary scale, any number N admits the expansion:

N = an.10n + ...+ a1.10 + a0

Divisibility by 4: For k ≥ 2,

102 ≡ 0 (mod 4),103 ≡ 0 (mod 4), ...,10k ≡ 0 (mod 4)

PR (FIU) MAC 4203 71 / 89

Properties of congruences imply then:

an10n + ...+ a2102 ≡ 0 (mod 4)

Thus, if N is divisible by 4, then

a110 + a0 ≡ 0 (mod 4)

PR (FIU) MAC 4203 72 / 89

Since 10 ≡ 1 (mod 9), one has

N ≡ an + ...+ a1 + a0 (mod 9).

PR (FIU) MAC 4203 73 / 89

Since 10 ≡ −1 (mod 11), then 102 ≡ −10 ≡ 1 (mod 11)

103 ≡ −1 (mod 11), 10k ≡ 1 (mod 11) if k is even, and 10k ≡ −1(mod 11) if k is odd. So

N ≡ a0 − a1 + a2... = (a0 + a2 + ...)− (a1 + a3 + ...) (mod 11).

PR (FIU) MAC 4203 74 / 89

Example: Find the remainder if 2,087,190 is divided by 11.

(0 + 1 + 8 + 2)− (9 + 7 + 0) = −5 ≡ 6 (mod 11)

So, 2,087,190 ≡ 6 (mod 11)

PR (FIU) MAC 4203 75 / 89

Example: Find the remainder if 2,087,190 is divided by 11.

(0 + 1 + 8 + 2)− (9 + 7 + 0) = −5 ≡ 6 (mod 11)

So, 2,087,190 ≡ 6 (mod 11)

PR (FIU) MAC 4203 75 / 89

Application: Checking that ab = c by casting out ninesor 11

ab − c = 0 requires that ab − c be divisible by any integer m.

If m = 9, then ab and c may be replaced each by the sum of its digits!

(a0 + ...+ an)(b0 + ...+ bn) ≡ (c0 + ...+ cn) (mod 9)

PR (FIU) MAC 4203 76 / 89

If m = 11, then

(a0 − a1 + ...)(b0 − b1 + ....) ≡ (c0 − c1 + ...) (mod 11)

PR (FIU) MAC 4203 77 / 89

Example: Check(3145)(213) = 669,885

by casting out elevens.

(5− 4 + 1− 3)(3− 1 + 2) ≡ 5− 8 + 8− 9 + 6− 6 (mod 11)

(−1)(4) ≡ −4 (mod 11)

PR (FIU) MAC 4203 78 / 89

In radix r :

N = anrn + ...+ a1r + a0, 1 ≤ aj ≤ r − 1

r ≡ 1 (mod r − 1)

r2 ≡ 1 (mod r − 1)

r3 ≡ 1, ...., r k ≡ 1 (mod r − 1)

Therefore:

N = anrn + ...+ a1r + a0 ≡ an + an−1 + ...+ a1 + a0 (mod r − 1)

PR (FIU) MAC 4203 79 / 89

Assignment: Are these numbers divisible by 11?

a) 2,964,357

b) 225,860,351,672,202

PR (FIU) MAC 4203 80 / 89

6. Congruences, Powers and Fermat’s Little Theorem

Fermat’s Little Theorem: For prime p and a 6≡ 0 (mod p), one has:

ap−1 ≡ 1 (mod p).

PR (FIU) MAC 4203 81 / 89

Applications:

1. Compute 235 (mod 7).

We use the fact that 26 ≡ 1 (mod 7).

Write 35 = 6× 5 + 5 and use the law of exponents.

235 = 26.5+5 =(

26)5

.25 ≡ 1.25 ≡ 32 ≡ 4 (mod 7).

PR (FIU) MAC 4203 82 / 89

2. Solvex103 ≡ 4 (mod 11)

x is certainly 6≡ 0 (mod 11)

So,x10 ≡ 1 (mod 11)

(by Fermat’s Little Theorem)

x100 ≡ 1 (mod 11)

x103 ≡ x3 (mod 11)

PR (FIU) MAC 4203 83 / 89

We need only solvex3 ≡ 4 (mod 11)

which can be done by trying out x = 1,2, ...,10.

Fermat’s Little Theorem has allowed us to reduce the congruence’spower from 103 to 3.

PR (FIU) MAC 4203 84 / 89

x (mod 11) 0 1 2 3 4 5 6 7 8 9 10x3 (mod 11) 0 1 8 5 9 4 7 2 6 3 10

The solution isx ≡ 5 (mod 11).

PR (FIU) MAC 4203 85 / 89

Proof of Fermat’s Little Theorem

Lemma: If p is prime and a 6≡ 0 (mod p), then the list

a,2a,3a, ..., (p − 1)a (mod p)

is the same as, possibly in different order,

1,2,3, ...,p − 1 (mod p)

PR (FIU) MAC 4203 86 / 89

Proof of the lemma

a,2a, ..., (p − 1)a contains (p-1) numbers, none of which is divisible byp.

Suppose ja and ka are congruent:

ja ≡ ka (mod p)

Then, on one hand, p | (j − k)a and hence p | (j − k).

On the other hand, |j − k | < p − 1. Therefore, j − k = 0 and weconclude that for distinct j and k , ja and ka are distinct (mod p).

But we know there are only p − 1 distinct, nonzero values modulo p,namely 1,2, ...,p − 1

PR (FIU) MAC 4203 87 / 89

Proof of Fermat’s Little Theorem (continued)

a.(2a)....(p − 1)a ≡ 1.2.3....(p − 1) (mod p)

ap−1(p − 1)! ≡ (p − 1)! (mod p)

ap−1(p − 1)!− (p − 1)! = kp

So,(ap−1 − 1)(p − 1)! = kp

PR (FIU) MAC 4203 88 / 89

Since p - (p − 1)!, it follows that

(ap−1 − 1) = lp

and thus:

ap−1 ≡ 1 (mod p).

Assignments

1. Use Fermat’s Little Theorem to:

(a) Find a number 0 < a < 73 with a ≡ 9794 (mod 73).

(b) Solve x86 ≡ 6 (mod 29).

(c) Solve x39 ≡ 3 (mod 13)

PR (FIU) MAC 4203 89 / 89

Since p - (p − 1)!, it follows that

(ap−1 − 1) = lp

and thus:

ap−1 ≡ 1 (mod p).

Assignments

1. Use Fermat’s Little Theorem to:

(a) Find a number 0 < a < 73 with a ≡ 9794 (mod 73).

(b) Solve x86 ≡ 6 (mod 29).

(c) Solve x39 ≡ 3 (mod 13)

PR (FIU) MAC 4203 89 / 89