Вы находитесь на странице: 1из 108

Bibliography:

1. Elementary Number Theory, James Tattershall, Cambridge 1999. 2. Elements of Number Theory, I.A. Barnett, Prindle, Weber and Schmidt 1969

PR (FIU)

MAC 4203

1 / 89

1. Introduction

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

PR (FIU)

MAC 4203

2 / 89

1. Introduction

Number Theory: Area of mathematics whose aim is to uncover the many deep subtle relationships between different sorts of numbers. Some classical unsolved problems in number theory Are there innitely many twin primes? (That is pairs of prime numbers (p, p + 2). Examples: 3, 5 5, 7 11, 13 17, 19 Are there innitely many primes of the form N 2 + 1?, Examples: 5, 17, 37, ...

PR (FIU)

MAC 4203

2 / 89

Assignments
1. Add up the rst few odd numbers and see if the numbers you get satisfy some sort of pattern. Express the pattern as a formula. Prove that the formula is correct. 2. (a) Do you think that there are innitely many primes of the form N 2 1? (b) Do you think that there are innitely many primes of the form N 2 2? (c) How about the form N 2 3? How about N 2 4? (d) Which values of a do you think give innitely many primes of the form N 2 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 doesnt divide n.

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 doesnt divide n. The greatest common divisor of a, b is the largest number that divides both a and b. Notation: gcd(a, b) or simply (a, b).

PR (FIU)

MAC 4203

4 / 89

Example: (14, 35) = 7

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 r1 = a r0 = b a = q 1 b + r1 b = q2 r1 + r2 . . = . . . . rn2 = qn rn1 + rn rn1 = qn+1 rn + 0

PR (FIU)

MAC 4203

6 / 89

Verication: For i = 1, 2, ...., n 1, ri1 = qi+1 ri + ri+1 So moving backward from last step: rn | rn1 , rn | rn2 , ..... one reaches rn | r2 = and rn | r1 , which implies that rn | b and rn | a by rst step.

PR (FIU)

MAC 4203

7 / 89

Verication: For i = 1, 2, ...., n 1, ri1 = qi+1 ri + ri+1 So moving backward from last step: rn | rn1 , rn | rn2 , ..... one reaches rn | r2 = and rn | r1 , which implies that rn | b and rn | a by rst step. 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 | ri1 and d | ri implies that d | ri+1 (follows from ri1 = 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 Euclidean algorithm applied to a and b. Show that every two steps reduces the remainder by at least one half. In other words, verify that 1 ri 2 for every i = 0, 1, 2, ... Conclude that the Euclidean algorithm will terminate in at most 2 log2 b steps. ri+2 <

PR (FIU)

MAC 4203

8 / 89

Least Common Multiple

The least common multiple (lcm) of a and b is the smallest number of which a and b are divisors. Notation lcm(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 of which 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 b a [a, b] = ab t = a( )t = ( )bt d d The least common multiple is obtained when t is the smallest natural number, 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 = an 10n + an1 10n1 + ... + a1 10 + a0 Claim: N is divisible by 2k if and only if ak 1 10k 1 + ... + a0 is divisible by 2k . Proof:
k 1

ai 10i = N
i=0 ik

ai 10i

Each term in the summation on the right side is divisible by 2k , so the summation on the left side is divisible by 2k if and only if N is divisible by 2k .
PR (FIU) MAC 4203 11 / 89

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

PR (FIU)

MAC 4203

12 / 89

Examples: 2455314 is not divisible by 4 = 22 , because 14 is not divisible 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

ai 10i
i=0

is divisible by 5k

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

ai 10i
i=0

is divisible by 5k Assignments 1. The last 3 digits of an integer N are X24. Find the missing integer X if N is divisible by 8. 2. The last three digits of an integer N are 2X4. Find the missing digit X if N is divisible by 8.

PR (FIU)

MAC 4203

13 / 89

Remainder when dividing by 9


Claim: If N =
n i i=0 ai 10

and with R = 0

N = 9 Q + R, then
n

ai = R
i=0

We can use this fact to nd 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: Let N =9Q+R Then N R =Q+ 9 9
an 10n + ... + a1 10 + a0 (an + ... + a1 + a0 ) + (an + ... + a1 + a0 ) 9 an (10n 1) + ... + a1 (10 1) an + ... + a0 = + 9 9 an + ... + a0 9Q + = 9 9 an + ... + a0 = Q+ 9

So
N 9 =

PR (FIU)

MAC 4203

16 / 89

Equivalently N = 9 Q + an + ... + a0 so R = an + ... + a1 + a0

PR (FIU)

MAC 4203

17 / 89

Equivalently N = 9 Q + an + ... + a0 so R = an + ... + a1 + a0 As a consequence: N is divisible by 9 if and only if the sum of its digits is divisible by 9

PR (FIU)

MAC 4203

17 / 89

Equivalently N = 9 Q + an + ... + a0 so R = 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 clearly divisible by 3. Conversely, if an + ... + a0 is divisible by 3, then so is N = 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 missing digits.

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

If ax + by = c has a solution, then gcd(a, b) | c. Before we prove the converse, let us look at the case c = d = gcd(a, b). Solving ax + by = gcd(a, b) Example: Solve 22x + 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 = 14+2 4 = 22+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 = 614 = 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, solve ax + 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) = x1 a + y1 b 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 rst identity by y2 , the second by y1 to obtain: y2 ax1 + by2 y1 = y2 y1 ax2 + y1 by2 = y1

PR (FIU)

MAC 4203

26 / 89

Substract the second from the rst identity: a(y2 x1 y1 x2 ) = y2 y1 Repeat this with x2 and x1 to get b(x2 y1 y2 x1 ) = x2 x1 Let k = (x2 y1 y2 x1 ). Then we see that x2 = x1 + kb and y2 = 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 a solution of a b x+ y =1 () d d
a b with gcd( d , d ) = 1

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 a solution of a b x+ y =1 () d d
a b with gcd( d , d ) = 1

Any other solution of () is given by b x2 = x1 + k , d y2 = y1 k a d

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.

PR (FIU)

MAC 4203

29 / 89

Examples: Find all solutions for 14x + 35y = 7. 35 = 2 14 + 7 14 = 2 7 + 0 So 7 = 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 in the last step of the Euclidean algorithm for gcd.

PR (FIU)

MAC 4203

30 / 89

Multiply both sides of the equation by c/d a( Let x1 =


x0 d c,

y0 x0 c) + b( c) = c d d

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 for 4x + 6y = 12. Observe gcd(4, 6) = 2 and 2 | 12. So there is a solution. To nd one, rst solve 4x + 6y = 2 or equivalently 2x + 3y = 1

PR (FIU)

MAC 4203

32 / 89

The Euclidean algorithm goes: 3 = 12+1 2 = 21+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, in which case it is given by x = x0 c, y = y0 c, where (x0 , y0 ) is a solution d d of a b x + y = 1. d d

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 nding solutions


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

PR (FIU)

MAC 4203

37 / 89

Direct method of nding solutions


Example: Suppose a man makes a purchase of $1.15 and gives the clerk two $1 bills. In how many ways may he receive his change in dimes and quarters? 0 d = number of dimes 0 q = number of quarters

10d + 25q = 85 Equivalently 2d + 5q = 17

PR (FIU)

MAC 4203

37 / 89

Solve for the variable with smallest coefcient: 2d = 17 5q d =8+ t=


1q 2

1 q 1q 2q = 8 2q + 2 2 2

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 of these meet the requirement d 0, q 0. d 0 6 + 5t 0 t 6 5 q0
1 2

t.

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

PR (FIU)

MAC 4203

39 / 89

Another example: A man cashes a check at his bank and the teller mistakenly interchanges dollars and cents. After leaving the bank, the man spends 68 cents and then discover that he now has twice the amount 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 that of pennies. 100d + c 68 = 2(d + 100c) That is 98d 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 coefcient: d = 2c + 3c + 68 98

z = 3c+68 must be an integer, and solving for c (which has the smallest 98 coefcient in this equation) c = 32z 22 + Again, u =
2z2 3

2z 2 3

must be an integer and solving for z gives z =u+1+ u 2

PR (FIU)

MAC 4203

42 / 89

t=

u 2

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 acceptable value and the solution is c = 10 and d = 21. The amount of the check was $10.21.
PR (FIU) MAC 4203 43 / 89

Assignment: 1. Five times a nonnegative integer added to seven times another nonnegative 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 2 unknowns

a1 x1 + .... + an xn = 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 = p1 a1 ...pk ak b = p1 b1 ...pk bk

gcd(a, b) = p1 sm(a1 ,b1 ) ...pk sm(ak ,bk ) lcm(a, b) = p1 la(a1 ,b1 ) ...pk la(ak ,bk ) The denitions 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 integers x , y , z such that ax + by + cz = d. Then ( is a solution of au + bv + cw = k xk yk zk , , ) d d d

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, solve for the unknown with smallest coefcient: 7x 4y 7x + 4y y = 50 x y ( ) 8 8 8

z = 50 x u=
7x+4y 8

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

PR (FIU)

MAC 4203

48 / 89

Again, v =

3x 4

must be an integer and solving for x gives x =v+ v 3

t=

v 3

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 and u, 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 7t u 2 50 u +t 3 and 7 20 50 +t t 0t . 3 2 3 20 3 7 50 t u +t 2 3 0t


PR (FIU) MAC 4203 51 / 89

So

t=0 t=1 t=2 t=3 t=4 t=5 t=6

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

Assignment: Find gcd(60,144,280). Solve 60x + 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 rst 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 Thus u = 10 So x = 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 a single 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 per seat, women $4 and children $0.75, in how many different ways could the house be sold to realize $ 3000?

PR (FIU)

MAC 4203

56 / 89

4. Factorization and the Fundamental Theorem of Arithmetic

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

PR (FIU)

MAC 4203

57 / 89

4. Factorization and the Fundamental Theorem of Arithmetic

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 = ab p

b is an integer p p | b.

PR (FIU)

MAC 4203

57 / 89

Alternate proof: Suppose p | ab and p a. Then gcd(p, a) = 1 and so the 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 | a1 a2 ...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 = p1 p2 ...pr in exactly one way.

PR (FIU)

MAC 4203

59 / 89

Proof: 2=2 3=3 4 = 2.2 Suppose n N, n = p1n p2n ...prn If N + 1 is composite, then N + 1 = n1 n2 with 2 n1 , n2 N So n1 = p1n1 ...prn1 ; n2 = p1n2 ...prn2

PR (FIU)

MAC 4203

60 / 89

Multiplying, we get a prime factorization for N + 1. N + 1 = n1 n2 = p1n1 ...prn1 p1n2 ...prn2 Suppose n = p1 ...pr = q1 ...qs are two prime factorizations for n. Then p1 | n p1 | qj for some 1 j s. So p1 = qj . We may assume after rearranging terms that p1 = q1 .

PR (FIU)

MAC 4203

61 / 89

Now p2 ...pr = q2 ...qs repeating the same argument, we reach the fact that pr = qr So r = s and qi = pi , for 1 i r .

PR (FIU)

MAC 4203

62 / 89

Now p2 ...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 the product 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 dened 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 not divided! This allows us to solve equations like: Find x if x + 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) b)


n i=1 ai n i=1 ai

n i=1 bi n i=1 bi

(mod m) (mod m)

PR (FIU)

MAC 4203

64 / 89

If a b (mod mi ), for i = 1, 2, ..., k , where m1 , m2 , ..., mk are pairwise co-prime, then a b (mod m) where m = k mi . i=1 In modular arithmetic, the cancelation law ac bc (mod m) a b (mod m)

doesnt necessarily hold. Theorem:If ac bc (mod m), then ab where d = gcd(c, m). (mod m ) d

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 m c (a b)( ) = k ( ), d d
c with gcd( d , m ) = 1. Hence, d m d

divides a b or equivalently, (mod m ). d

ab

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)

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. x 2 + 2x 1 0 (mod 7) Try 1, 2, ..., 6 x 2 (mod 7), x 3 (mod 7).

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. x 2 + 2x 1 0 (mod 7) Try 1, 2, ..., 6 x 2 (mod 7), x 3 (mod 7). 3. x 2 3 (mod 10) has no solution.
PR (FIU) MAC 4203 67 / 89

Solving ax c (mod m)
Find x so that ax c = my Equivalently: ax my = c Let d = gcd(a, m). If d c, then no solution! If d | c, then nd a solution to au + mv = d. Say u = u0 , v = v0 has c been found. Multiply the equation above by d . a So x0
cu0 d

cu0 cv0 +m =c d d

(mod m) is a solution to ax c (mod m).


MAC 4203 68 / 89

PR (FIU)

To nd other solutions, observe that if x1 is one, then m | ax1 ax0 . So m a(x1 x0 ) | d d But gcd(m, a) = d, so
m d

| (x1 x0 ). In other words, m , k = 0, 1, 2, ..., d 1. d

x1 = x0 + k

PR (FIU)

MAC 4203

69 / 89

Assignments

1. Suppose that ac bc (mod m) and also assume that gcd(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) x 2 1 (mod 8) (d) x 2 3 (mod 7) (e) x 2 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

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: an 10n + ... + a2 102 0 (mod 4) Thus, if N is divisible by 4, then a1 10 + 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.

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 So, 2, 087, 190 6 (mod 11) (mod 11)

PR (FIU)

MAC 4203

75 / 89

Application: Checking that ab = c by casting out nines or 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 (1)(4) 4 (mod 11)

(mod 11)

PR (FIU)

MAC 4203

78 / 89

In radix r : N = an r n + ... + a1 r + a0 , 1 aj r 1 r 1 (mod r 1) r 2 1 (mod r 1) r 3 1, ...., r k 1 (mod r 1) Therefore:

N = an r n + ... + a1 r + a0 an + an1 + ... + 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 Fermats Little Theorem

Fermats Little Theorem: For prime p and a 0 (mod p), one has: ap1 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. Solve x 103 4 (mod 11) x is certainly 0 (mod 11) So, x 10 1 (mod 11) (by Fermats Little Theorem) x 100 1 (mod 11) x 103 x 3 (mod 11)

PR (FIU)

MAC 4203

83 / 89

We need only solve x3 4 (mod 11) which can be done by trying out x = 1, 2, ..., 10. Fermats Little Theorem has allowed us to reduce the congruences power from 103 to 3.

PR (FIU)

MAC 4203

84 / 89

x (mod 11) x 3 (mod 11) The solution is

0 0

1 1

2 8

3 5

4 9

5 4

6 7

7 2

8 6

9 3

10 10

x 5 (mod 11).

PR (FIU)

MAC 4203

85 / 89

Proof of Fermats Little Theorem

Lemma: If p is prime and a 0 (mod p), then the list a, 2a, 3a, ..., (p 1)a is the same as, possibly in different order, 1, 2, 3, ..., p 1 (mod p) (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 by p. 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 we conclude 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 Fermats Little Theorem (continued)

a.(2a)....(p 1)a 1.2.3....(p 1) ap1 (p 1)! (p 1)!

(mod p)

(mod p)

ap1 (p 1)! (p 1)! = kp So, (ap1 1)(p 1)! = kp

PR (FIU)

MAC 4203

88 / 89

Since p (p 1)!, it follows that (ap1 1) = lp and thus: ap1 1 (mod p).

PR (FIU)

MAC 4203

89 / 89

Since p (p 1)!, it follows that (ap1 1) = lp and thus: ap1 1 (mod p).

Assignments 1. Use Fermats Little Theorem to: (a) Find a number 0 < a < 73 with a 9794 (mod 73). (b) Solve x 86 6 (mod 29). (c) Solve x 39 3 (mod 13)
PR (FIU) MAC 4203 89 / 89