Chapter 1 Divisibility Theory

advertisement

Chapter 1

Divisibility Theory

1.1

The Division Algorithm

Definition 1.1

(divides) .

Let a, b ∈

Z if there is an integer c such that b = ac .

with a = 0 . Then a divides b , denoted a | b ,

• a is called a divisor of b .

• a is called a factor of b .

• b is called a multiple of a .

The notation a

b means that a does not divide b .

Example 1.1.

Answer each of the following questions, and prove that your answer is correct.

1. Does 2 | 6?

2. Does − 7 | 21?

Note: When talking about divisors, we restrict ourselves to positive divisors.

Theorem 1.

Let a, b, c ∈

Z

. If a | b and b | c , then a | c .

Proof.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 1

Theorem 2.

Let a, b, c ∈ arbitrary integers.

Z

. If c | a and c | b , then c | ( ax + by ) where x and y are

Proof.

Example 1.2.

Prove or disprove the following statements:

1. For every positive integer n , the integer 4 n − 1 is divisible by 3.

2. For every positive integer n , the integer n

4 − n is divisible by 4.

Question : What is 14 ÷ 5?

Example 1.3.

When asked “What is − 5 divided by 3?” Mikey exclaimed “By the division algorithm, the answer is − 1 with a remainder of − 2!” Is Mikey correct?

Dr. Allen’s Math 4110 Class Notes and Problem Sets 2

Theorem 3 (Division Algorithm) .

If a and b are integers with b > 0 , then there exist unique integers q (called the quotient ) and r (called the remainder ) with 0 ≤ r < b such that a = qb + r .

Note: The Division Algorithm also holds when b is a negative integer. A more generalized statement of the division algorithm is the following:

If a and b are integers with b = 0 , then there exist unique integers q (called the quotient ) and r (called the remainder ) with 0 ≤ r < | b | such that a = qb + r .

Example 1.4.

Find q and r for each pair of a and b (where b is the divisor).

1.

a = − 26 and b = 6.

2.

a = 17 and b = − 3.

Example 1.5.

Let a ∈

Z

. Use the division algorithm to show that a can be expressed in either of the form 2 k or 2 k + 1.

Example 1.6.

Show that the fourth power of any integer is either of the form 5 k or 5 k + 1.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 3

Exercise Set 1.1.

Either type your solutions or neatly print (using pencil) your solutions. All work should be justified clearly. Use only the front side of paper

(that is, do not write on the back), and do not use spiral torn paper. All work that you turn in should be very neat. Write the problem number, the original problem, and then your solution. In addition, you should be prepared to discuss or present your solutions in class.

Problem 1.1.

Consider the following claim: Let a, b , and c be integers. If a | b and a | c , then a | bc .

1. Prove the claim.

2. If possible, weaken the hypothesis of the claim and still prove the claim.

3. If possible, keep the same hypothesis in the original claim, but replace the conclusion with a stronger conclusion and prove the new result.

Problem 1.2.

Consider the statement given in Problem 1 on Page 19.

1. Illustrate the statement with an example using actual numbers.

2. Page 19, Problem 1

Problem 1.3.

Page 19, Problem 3a

Problem 1.4.

Page 19, Problem 4

Problem 1.5.

1. Page 19, Problem 6

2. Page 19, Problem 9

Problem 1.6.

Page 24, Problems 2c,d

Problem 1.7.

Page 24, Problem 4b

Problem 1.8.

Page 24, Problem 5

Problem 1.9.

Page 25, Problem 9

Dr. Allen’s Math 4110 Class Notes and Problem Sets 4

1.2

Greatest Common Divisor

Definition 1.2

(greatest common divisor) .

If a and b are integers with at least one nonzero, then a positive integer d is the greatest common divisor of a and b , denoted gcd( a, b ) , if the following 2 conditions hold:

1.

d | a and d | b .

2. If c | a and c | b , then c ≤ d .

In other words, the greatest common divisor of a and b (with at least one nonzero) is the greatest integer dividing both a and b .

Example 1.7.

1. Find gcd(45 , 60).

2. Find gcd(0 , n ) with n = 0.

Theorem 4.

If a and b are integers with at least one non-zero, then there exist integers m and n such that am + bn = gcd( a, b ) . Furthermore,

{ ax + by : x, y ∈

Z

} = { k gcd( a, b ) : k ∈

Z

} .

Note: In other words, the greatest common divisor of two numbers a and b can be written as as linear combination of a and b . In fact, the gcd( a, b ) is the smallest positive integer that can be written as a linear combination of a and b .

Example 1.8.

Write gcd(45 , 60) as a linear combination of 45 and 60.

Question: Are the integers m and n in Theorem 4 unique?

Definition 1.3

(relatively prime integers) .

Two integers a and b , with at least one non-zero, are relatively prime if gcd( a, b ) = 1 .

Dr. Allen’s Math 4110 Class Notes and Problem Sets 5

Theorem 5.

Let a and b be integers, not both 0. Then gcd( a, b ) = 1 if and only if there exist integers x and y such that 1 = ax + by .

Proof.

Theorem 6 (Euclid’s Lemma) .

If a and b are relatively prime integers and a | bc , then a | c .

Proof.

Example 1.9.

For any integer a , are the integers 5 a + 2 and 7 a + 3 relatively prime? Justify.

Exercise Set 1.2.

Either type your solutions or neatly print (using pencil) your solutions. All work should be justified clearly. Use only the front side of paper

(that is, do not write on the back), and do not use spiral torn paper. All work that you turn in should be very neat. Write the problem number, the original problem, and then your solution. In addition, you should be prepared to discuss or present your solutions in class.

Page 25, Problems 12, 14a,c, 20b

Dr. Allen’s Math 4110 Class Notes and Problem Sets 6

1.3

The Euclidean Algorithm

In elementary school, how did you learn to compute the greatest common divisor of

2 numbers? For example, how would you find the greatest common divisor of 12 and

20? Or of 77 and 119?

Now using your elementary school methods, try finding the greatest common divisor of 3 , 073 , 531 and 304 , 313 or of 1 , 160 , 718 , 174 and 316 , 258 , 250. What is the moral?

QUESTION: How do we compute the greatest common divisor of two large numbers a and b , and then how do we find integers x and y such that gcd( a, b ) = ax + by ?

To find the greatest common divisor of 2 numbers, we can use the Euclidean algorithm , which uses the division algorithm repeatedly. This algorithm produces a systematic method for not only finding the greatest common divisor of integers a and b (even if these are large), but also for finding integers x and y such that gcd( a, b ) = ax + by .

Example 1.10.

1. Use the Euclidean algorithm to find the gcd(252 , 198).

2. Find integers x and y such that 252 x + 198 y = gcd(252 , 198).

3. Can 6 be expressed as a linear combination of 252 and 198? Explain.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 7

Theorem 7 (The Euclidean Algorithm) .

Let a and b be positive integers. Set r

0 and r

1

= b . Define r

2

, r

3

, . . . , r n +1 and n by the equations

= a r r

0

1

= r

1 q

1

= r

2

.

..

q

2

+ r

2

+ r

3 r n − 2

= r n − 1 q n − 1

+ r r n − 1

= r n q n

+ r n +1 n with 0 < r

2 with 0 < r

3

.

..

< r

1

< r

2 with 0 < r n

< r with r n +1

= 0 n − 1 where each q j and r j are integers. Then gcd( a, b ) = r n

.

Lemma 1.

If a = qb + r , then gcd( a, b ) = gcd( b, r ) .

Practice Problems:

1. Find the gcd(3073531 , 304313).

2. Find integers x and y such that 3073531 x + 304313 y = gcd(3073531 , 304313).

3. Prove that for all positive integers n , the fraction

21 n + 4

14 n + 3 is irreducible.

(This problem is from the First International Mathematical Olympiad. The

International Mathematical Olympiad is the World Championship Mathematics Competition for high school students and is held annually in a different country. The first one was held in 1959 in Romania.)

Dr. Allen’s Math 4110 Class Notes and Problem Sets 8

Exercise Set 1.3.

Either type your solutions or neatly print (using pencil) your solutions. All work should be justified clearly. Use only the front side of paper

(that is, do not write on the back), and do not use spiral torn paper. All work that you turn in should be very neat. Write the problem number, the original problem, and then your solution. In addition, you should be prepared to discuss or present your solutions in class.

Problem 1.10.

Page 31, Problems 1, 2a,c

Problem 1.11.

1. Define least common multiple .

2. State an equation that shows the relationship between the greatest common divisor and the least common multiple of two positive integers a and b .

3. Use the equation above as well as the Euclidean Algorithm to find the least common multiple of 143 and 227.

Problem 1.12.

1. Apply the Euclidean algorithm is find gcd(4076 , 1024).

2. Using the Euclidean algorithm, express gcd(4076 , 1024) as a linear combination of 4076 and 1024.

Problem 1.13. Prove that 7 has no expression as an integral linear combination of

18209 and 19043.

Problem 1.14.

Find two rational numbers with denominators 11 and 13, respec-

7 tively, and a sum of .

143

Dr. Allen’s Math 4110 Class Notes and Problem Sets 9

1.4

Linear Diophantine Equations

“The childhood of Diophantus was one-sixth of his life. He grew a beard after one-twelfth more. He married after one-seventh more. Five years later his only child was born. The child lived to half the age of the father. After his child’s death, Diophantus lived four more years, drowning his pain in the study of numbers. Then he gave up his life. How long did

Diophantus live?”

Example 1.11.

Hilary has two more than three times as many class participation plusses as Brad.

How many plusses does Hilary have?

Example 1.12.

1. By inspection, find a few integer solutions, if possible, to 6 x + 2 y = 4.

2. By inspection, find a few integer solutions, if possible, to 6 x + 2 y = 3.

Definition 1.4

(linear Diophantine equation) .

A linear Diophantine equation in two unknowns is an equation of the form ax + by = c where a, b, c ∈

Z with a = 0 and b = 0 . A solution to a Diophantine equation is a pair of integers ( x

0

, y

0

) which when substituted in the equation will satisfy it. To solve a Diophantine equation means to find all pairs of integers x and y which will satisfy it.

In general, a Diophantine equation is any equation in one or more unknowns that is to be solved in the integers.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 10

Problem 1.15.

Brad, Hilary, Zach, Whitney, and Chris survive a shipwreck and swim to a tiny deserted island (called Number Theory Island). They are greeted by a monkey. During the remainder of the day, they gather coconuts for food. Since they are quite tired by now, they decide to retire for the night and agree that in the morning, they will divide the coconuts equally among them. While the others sleep, Brad wakes up and divides the coconuts into five equal piles, with one left over, which he throws out for the monkey. Realizing that he cannot trust the others, Brad hides his share, puts the remaining coconuts together, and goes back to sleep. Later, Hilary gets up and she, too, does not think she can trust the others (especially Brad and Zach). So Hilary divides the pile into five equal shares with one coconut left over which she, too, discards for the monkey. Hilary hides her share, puts the remaining coconuts together, and goes back to sleep. One by one, Zach, Whitney, and Chris repeat this process.

Finally morning comes and they all awake. Brad, Hilary, Zach, Whitney, and Chris each try to look quite innocent. No one makes a remark about the diminished pile of coconuts, and no one decides to be honest and admit that he/she has already taken his/her share. Instead, they divide the pile equally among them with one coconut left over, which they throw out for the monkey.

Find the smallest possible number of coconuts in the original pile .

Question:

When does a linear Diophantine equation have a solution? How do we find all solutions? How do we characterize all solutions?

Example 1.13.

Determine if the following Diophantine equations can be solved.

1. 6 x + 7 y = 4

2. 6 x + 8 y = 4

3. 6 x + 9 y = 4

Dr. Allen’s Math 4110 Class Notes and Problem Sets 11

Theorem 8.

The linear Diophantine equation ax + by = c has a solution if and only if gcd( a, b ) | c .

Proof.

Theorem 9.

Let ( x

1

, y

1

) be a solution to ax + by = c . Suppose d = gcd( a, b ) . Then the solutions to ax + by = c are given by x = x

1 b

+ t d and y = y

1

− t a d where t ∈

Z

.

Proof.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 12

Example 1.14.

Determine if the following Diophantine equations can be solved. Justify.

1. 12 x + 18 y = 30

2. 2 x + 3 y = 4

3. 6 x + 8 y = 25

Example 1.15.

Does the equation 275 x + 93 y = 52 have a solution? If so, find all solutions.

Exercise Set 1.4.

Problem 1.16.

Page 37, Problems 1, 2, 3

Problem 1.17.

Find the complete set of integer solutions in x and y to 907 x +

2009 y = 4110 .

Problem 1.18.

Zach wishes to mail an important encrypted letter to Mikey, and he reaches the post office 3 minutes before closing. He was in such a rush to get to the post office that he forgot his wallet. He manages to find 82 cents in his pocket, and he finds a penny on the floor (thus, he only has 83 cents). The postal clerk determines the cost of postage to be 83 cents, and Zach breathes a sigh of relief. Then the clerk informs him that only 6-cent and 15-cent stamps are available. Will Zach be able to mail his top-secret letter? Justify your answer completely (use results from this class

– try setting up a linear Diophantine equation – be sure to label any variables you use).

Problem 1.19.

Pages 37-38, Problems 6, 8a, 8c

Problem 1.20.

Fill in the details and complete Problem 1.15.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 13

Chapter 2

Primes

2.1

The Fundamental Theorem of Arithmetic

Definition 2.1

(prime) .

An integer p > 1 is prime if the only positive divisors of p are 1 and p .

Definition 2.2

(composite) .

An integer n > 1 that is not prime is composite .

Note: 1 is neither prime nor composite.

Example 2.1.

List the first few

• primes

• composites

Example 2.2.

What is the prime factorization of 12? of 20? Are these factorizations unique except for the order in which the primes occur?

Every integer n > 1 can be factored as a product of primes in essentially one way. This significant fact is known as the Fundamental Theorem of Arithmetic. Is it necessary to prove such a familiar fact?

Dr. Allen’s Math 4110 Class Notes and Problem Sets 14

Example 2.3.

For the moment, consider the even number world . In other words, the only known numbers are the even numbers. Let

E

= { . . . , − 10 , − 8 , − 6 , − 4 , − 2 , 0 , 2 , 4 , 6 , 8 , 10 , . . .

} .

Define an even integer to be prime (or an e -prime) if it is positive and cannot be factored into a product of even integers.

1. Is 6 an e -prime?

2. Is 8 an e -prime?

3. Is 10 an e -prime?

4. Is 12 an e -prime?

5. List the first few primes ( e -primes) in the even number world.

6. Does unique factorization hold in the even number world; that is, can every positive number in the

E

-world be factored as a product of e -primes in essentially one way?

Example 2.4.

Consider all complex numbers of the form a + b ( i

5) where a and b are integers.

Theorem 10 (The Fundamental Theorem of Arithmetic) .

1. Every integer n > 1 can be written uniquely as a product of primes except for the order in which the primes occur.

2. Every integer n > 1 can be written uniquely as a product of primes in the form n = p e

1

1 p e

2

2

· · · p e r r where p

1 integers.

< p

2

< · · · < p r are distinct primes and e

1

, e

2

, . . . , e r and r are positive

Dr. Allen’s Math 4110 Class Notes and Problem Sets 15

Lemma 2.

If p is a prime and a and b are integers such that p | ab , then either p | a or p | b .

Proof.

Corollary 1.

If p | a

1 a

2

. . . a n

, then p | a least one factor a i of the product).

1 or p | a

2 or · · · or p | a n

(that is, p divides at

Proof of the Fundamental Theorem of Arithmetic.

1.

Existence:

2.

Uniqueness:

Dr. Allen’s Math 4110 Class Notes and Problem Sets 16

Exercise Set 2.1.

Practice Problems: Page 43, Problems 1, 2, 7, 9, 12

Problem 2.1.

Page 43, Problem 3a,c,e

Problem 2.2.

Page 43, Problem 4

Problem 2.3.

Page 43, Problem 6a,b

Problem 2.4.

Page 43, Problem 10

Problem 2.5.

Page 44, Problem 16

Problem 2.6.

Page 44, Problem 17

Problem 2.7.

Find the first three powerful numbers. (For a definition of powerful number, see problem 19 on page 44. ) Then do Problem 19.

Problem 2.8.

Suppose you live in the

M

− World, where the only numbers that exist are positive integers that are congruent to 1 modulo 4 (that is, n is congruent to 1 modulo 4 if the remainder is 1 when n is divided by 4). In other words, the only numbers are

M

= { 1 , 5 , 9 , 13 , 17 , 21 , . . .

} .

In the

M

− World, we cannot add numbers, but we can multiply them, since if a and b are both congruent to 1 modulo 4, then their product ab is congruent to 1 modulo 4.

In the

M

− World, we say that m divides n if n = mk where k ∈

M

. A prime in the

M

− World (an

M

-prime) is a number whose only divisors are 1 and itself. (1 itself is not considered to be prime.)

1. Find the first seven

M

-primes.

2. Find an integer in

M that has two different factorizations as a product of

M

primes (in other words, unique factorization does not hold in the

M

− World).

Problem 2.9. Prove or disprove with a counterexample and explanation: If n is a nonnegative integer, then n 2 − 79 n + 1601 is a prime number.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 17

2.2

Are there infinitely many primes?

Theorem 11.

If n is an integer ≥ 2 which is composite, then n has a prime divisor which is ≤ n .

Proof.

Question: Consider the number n = 4 , 294 , 967 , 297. Is n prime? How could you determine if n is prime?

Example 2.5.

Determine if 509 is prime.

Discuss the Sieve of Eratosthenes .

Dr. Allen’s Math 4110 Class Notes and Problem Sets 18

Example 2.6.

Are there infinitely many primes?

Recall that Brad, Hilary, Zach, Whitney, and

Chris are stranded on a deserted island (but remember that there is a monkey to keep them company). The next morning, Jessica, Nick, William, Jamie, Jess, Jonathan,

Miriam, Andrew, Katharine, and Steven are also shipwrecked and safely swim to the same deserted island! The fifteen students decide that they will entertain themselves by discussing number theory. They have no books, so they try to recall as many results as possible. They realize that they will have to “ discover ” further results for themselves. The first question they investigate is the following: Are there infinitely many primes?

Hilary suggests that they make a list of their favorite prime numbers.

She tells them that they can use this list of primes to construct new primes. Hilary states,“ You take the product of all of your favorite primes and add 1 to the product.

This new number will be a product of primes, none of which are on the original list.

Add the new primes to the list, and again add 1 to the product of all the primes on the expanded list. Keep repeating this process. Therefore, there must be infinitely many primes!”

The other fourteen students (and of course Hilary herself) think that Hilary’s suggestion is quite interesting, and they decide to test out Hilary’s method of producing new primes. They decide to construct new primes from a “favorite list of prime numbers.”

Andrew suggests that perhaps they should only start with a couple of their favorite small primes since they do not have a calculator. Zach shouts that his favorite small prime is 2 since “2 is the oddest prime!” and Nick chimes in that 3 is his favorite small prime since “3 is the smallest odd prime!” The students now diligently work on exploring Hilary’s claim starting with p

1

= 2 and p

2

= 3.

1. Investigate Hilary’s construction of primes starting with p

1 using at least five iterations.

= 2 and p

2

= 3 and

Dr. Allen’s Math 4110 Class Notes and Problem Sets 19

2. Jessica asks “Why is the new number never divisible by the primes in the list of new primes constructed from the favorite primes?” Steven responds, “Excellent question! Let’s investigate!!!”

The students agree with Hilary that this method will always produce a new prime, but Jess insists that they come up with a formal proof that there are infinitely many primes but in doing so, they can use a construction similar to what they were doing with their favorite primes. Chris is very pleased that Jess suggested a formal proof, and he suggests a proof by contradiction.

Theorem 12.

There exist infinitely many primes.

Proof.

(Euclid)

After the completion of the proof, Katharine poses the following question:

Is N = 2 · 3 · 5 · 7 · · · · · p + 1 always a prime number?

Proof.

(another proof)

Is N = q ! + 1 always a prime number?

Dr. Allen’s Math 4110 Class Notes and Problem Sets 20

Example 2.7.

The stranded number theory students have concluded with confidence that there are infinitely many primes. They now decide to investigate the number of primes of the form 4 k + r (where r = 0 , 1 , 2 , 3).

1. How many primes are there of the form 4 k ? (Come up with a theorem and proof)

2. How many primes are there of the form 4 k + 1? (Come up with a conjecture – we do not have enough results yet to prove the correct conjecture)

3. How many primes are there of the form 4 k + 2? (Come up with a theorem and proof)

4. How many primes are there of the form 4 k + 3? (Come up with a theorem and proof))

Dr. Allen’s Math 4110 Class Notes and Problem Sets 21

2.3

The Distribution of Primes

After proving that there are infinitely many primes and after investigating the number of primes of the form 4 k + r , the enthusiastic stranded number theory students decide to take a very brief break from number theory. They decide to take a walk along the beautiful beach. As they are walking, Hilary notices a bottle being washed to shore. Zach leaps in front of Hilary and snatches the bottle. Zach shouts, “it looks like a message inside!” Now Brad grabs the bottle from Zach and reads the message to everyone (Chris is disappointed that the message is not encrypted. He hopes to encounter some encrypted messages on the island.)

You are being challenged to a

Prime Scavenger Hunt

. Please find as many of the items below as quickly as possible.

The items on the list appear very interesting, so the stranded number theory students decide to take the challenge!

1.

(a) Find all primes less than 200 using the Sieve of Eratosthenes.

(b) Find a precise definition of Sophie Germain primes. (list source)

(c) Find all Sophie Germain primes < 100.

(d) Find the largest known Sophie Germain prime and when it was discovered.

(list source)

2.

(a) Find a precise definition of twin primes. (Give source)

(b) Find all twin primes ≤ 100.

(c) Find the largest known pair of twin primes to date. (list source and include the date of the discovery)

(d) Find the number of decimal digits in the largest known pair of twin primes to date. (List source)

(e) Find a precise statement of the Twin Prime Conjecture. (Give source)

3.

(a) Find the largest known prime to date. (list source and give the date when this prime was discovered)

(b) Find the number of decimal digits in the largest known prime to date.

(give source)

(c) Find the second largest prime to date. (list source and give the date when this prime was discovered)

4.

(a) Find a precise definition of Fermat number (denoted F n

). (list source)

(b) Find the statement of Fermat’s conjecture about the primality of the Fermat numbers. (list source)

(c) Find as many prime Fermat numbers as possible.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 22

(d) Find the number of Fermat numbers that are known to be composite as of today. (list source)

5.

(a) Find 5 consecutive integers that are composite.

(b) Find 1261 consecutive integers that are composite. (Justify)

(c) Given any positive integer n , find n consecutive composite integers.

Prove your result.

6.

(a) Find a precise definition of a Mersenne prime.

(b) Find the first five Mersenne primes.

(c) Find the current number of known Mersenne primes. (list source)

(d) Find the largest known Mersenne prime to date, and find when it was discovered. (list source)

(e) Find the number of decimal digits in the largest known Mersenne prime to date. (list source)

7.

(a) Find a precise statement of Goldbach’s Conjecture. (list source)

(b) Find expressions for 4, 6, 8, and 4110 that illustrate Goldbach’s conjecture.

(c) Find out whether the representation of an even integer given in Goldbach’s

Conjecture is unique.

(d) Find the number of even integers that Goldbach’s Conjecture has been verified. (list source)

8.

(a) Find out what the Great Internet Mersenne Prime Search is. (list source)

(b) Find out how a person can join in the Great Internet Mersenne Prime

Search. (list source)

(c) Find the amount of award money for the first person (or group)to discover a prime number with at least 100 , 000 , 000 decimal digits.

(d) Find the amount of award money for the first person (or group) to discover a prime number with at least 1 , 000 , 000 , 000 decimal digits.

9. Let π ( x ) denote the number of primes ≤ x .

(a) Find π (10), π (40), and π (100).

(b) How many 4-digit primes are there?

(c) How many 10-digit primes are there?

(d) Find a statement of the Prime Number Theorem. (list source)

(e) Find an approximation for π ( x ) for sufficiently large x . (hint: use the

Prime Number Theorem)

Dr. Allen’s Math 4110 Class Notes and Problem Sets 23

Chapter 3

Congruences

3.1

Modulo Arithmetic and Basic Properties of

Congruences

Definition 3.1

(congruent modulo n ) .

Let n ∈

Z

+ . Two integers a and b are said to be congruent modulo n , denoted by a ≡ b (mod n ) , if n | ( a − b ) .

Example 3.1.

Determine if the following are true or false. Justify.

1.

− 2 ≡ 8 (mod 5)

2.

− 15 ≡ − 64 (mod 7)

3. 25 ≡ 12 (mod 7)

Note: a 6≡ b (mod n ) means that n n .

-

( a − b ), and we say a is incongruent to b mod

Example 3.2.

Theorem 13.

Let a, b ∈

Z

.

a ≡ b (mod n ) if and only if a and b have the same remainder when divided by n .

Dr. Allen’s Math 4110 Class Notes and Problem Sets 24

Theorem 14 (Properties of Congruences) .

Let a, b, c ∈

Z and n ∈

Z

+ . Then each of the following holds.

1.

a ≡ a (mod n ) (reflexive property)

2. If a ≡ b (mod n ), then b ≡ a (mod n ). (symmetric property)

3. If a ≡ b (mod n ) and b ≡ c (mod n ), then a ≡ c (mod n ). (transitive property)

4. If a ≡ b (mod n ) and c ≡ d (mod n ), then a + c ≡ b + d (mod n ).

5. If a ≡ b (mod n ) and c ≡ d (mod n ), then ac ≡ bd (mod n ).

6. If a ≡ b (mod n ), then a + c ≡ b + c (mod n ).

7. If a ≡ b (mod n ), then ac ≡ bc (mod n ).

8. If a ≡ b (mod n ), then a k ≡ b k

(mod n ) for any positive integer k .

9. If a ≡ b (mod n ) and d | n , then a ≡ b (mod d ).

Example 3.3.

1. What is the remainder when

397998100520096754341105653 × 12345678910111213141516171819 is divided by 5?

2. Is 1! + 2! + 3! + 4! + · · · + 2007! + 2008! + 2009! divisible by 9?

3. What is the remainder when 16

53 is divided by 7?

4. What is the last digit in 7

2009

?

Dr. Allen’s Math 4110 Class Notes and Problem Sets 25

Prove or disprove : If ab ≡ ac (mod n ), then b ≡ c (mod n ). (In other words, does the cancellation law hold for congruence?)

Theorem 15.

Suppose that a and n are relatively prime. Suppose ax ≡ ay (mod n ) .

Then x ≡ y (mod n ) .

Proof.

Question: Does the zero product property hold for congruences?

Theorem 16.

Let n ∈

Z

+ . Let a be an integer relatively prime to n . Then there is an integer x such that ax ≡ 1 (mod n ) .

Note: x is called the inverse of a modulo n , and x is unique modulo n .

Example 3.4.

1. What is the inverse of 3 (mod 5)?

2. What is the inverse of 2 (mod 5)?

3. What is the inverse of 7 (mod 9)?

Exercise Set 3.1.

Problem 3.1.

Pages 67-68, Problems 1, 2, 3, 4, 5, 6b, 8b

Problem 3.2.

Using the Euclidean Algorithm, find the inverse of 17 modulo 101.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 26

3.2

Divisibility Tests

After discussing some basic properties of congruences, Jess suggests that they can use congruences to explain why the divisibility tests they learned in elementary school are valid. Chris says that sounds like an excellent idea and that the divisibility tests may prove useful if they have to divide more coconuts among themselves. Brad responds that the divisibility tests for 2, 3, 5, and 10 are obvious. Jamie asks Brad to explain why you add the digits in a number and if the sum is divisible by three, then the original number is divisible by three. Brad says “well, that’s the rule that my third grade teacher told me.” Hilary points out that explanation would earn 0 and possibly even negative points on Dr. Allen’s test, and furthermore, if they can explain the usual tests for divisibility by 2, 3, 4, 5, 6, 9, 10, and 11, then they could develop their own divisibility tests for other interesting positive integers such as 99. After hearing

Hilary’s rationale, Brad eventually concurs that it would be fun to know why the divisibility tests work and even more fun to develop their own. The stranded enthusiastic students start working immediately on explaining why the usual divisibility tests work.

Steven suggests that they start by writing N in expanded notation. So

N = d r

10 r

+ d r − 1

10 r − 1

+ · · · + d

1

10 + d

0

, where 0 ≤ d j

≤ 9 and d j

Z

.

• Test for 2:

• Test for 3:

• Test for 9:

• Test for 4:

Dr. Allen’s Math 4110 Class Notes and Problem Sets 27

• Test for 5:

• Test for 10:

• Test for 6:

• Test for 11:

Example 3.5.

Zach asks, “does 8 divide 1007200941104081303021501261126249504300451985562211647376?”

Miriam says that they forgot to come up with a divisibility test for 8, but that she thinks they could develop one that would be similar to the divisibility test for 4.

Example 3.6.

Does 99 divide 753124680?

Exercise Set 3.2.

Problem 3.3.

Pages 73-74, Problems 4, 9

Problem 3.4.

1. Develop (with proof) a divisibility test for 32.

2. Use your divisibility test for 32 to see if the integer

100720094110408130302150126112624950430032880 is divisible by 32.

Problem 3.5.

Is 10 2009 + 1 divisible by 11? Justify.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 28

3.3

An Application of Modulo Arithmetic: Check

Digits

The stranded number theory students decide to explore “their” island. As they hike inland, Hilary spots a small rectangular metal box. (She is careful not to let Zach leap in front of her this time.) The students are very excited about Hilary’s discovery, and Zach says, “Maybe there is treasure inside the box!” The students eagerly look on as Hilary opens the box. Hilary removes the following contents from the box: an airplane ticket, a blank check (Zach is very thrilled with this!), UglyDoll Tray (all the number theory students are happy to see Tray since she has three brains!), and a bag of m&m’s (Brad is thrilled with this because he’d much prefer to divide

(or steal) m&m’s instead of coconuts.) Chris tells Hilary that she made an excellent discovery, and he asks the group, “Do you know what relates these four items together?” This question leads the students into a discussion about check digits.

Each of the above items contains an identification number which is assigned an extra digit, called a check digit . This check digit is based on some algorithm that makes use of previous digits in the identification number. The check digit is used to detect against errors (such as entering the number wrong by reversing two adjacent digits) or to detect forgery.

For example, an airline ticket has a 14-digit identification number. Let’s call it N .

An extra digit, called a check digit, which we will denote by d is added to it. The check digit, d , is the number that satisfies the following: N ≡ d (mod 7).

Example 3.7.

Jessica, Chris, and Brad each have a plane ticket

(but they are glad that there is no airport on the island because they are not ready to leave Number Theory Island yet) with the following ticket numbers, respectively: 00623156675120, 00623156675131 and 00623156675142. Are these consecutive ticket numbers? Justify.

Recall the following definition from linear algebra:

Definition 3.2

(dot product) .

The dot product or inner product of the n vectors a and b is the sum of the products of corresponding entries; that is, if a = n

X

( a

1

, a

2

, . . . , a n

) and b = ( b

1

, b

2

, . . . , b n

) , then a · b = a

1 b

1

+ a

2 b

2

+ · · · + a n b n

= a j b j

.

j =1

Dr. Allen’s Math 4110 Class Notes and Problem Sets 29

Example 3.8.

Every bank check has an eight-digit identification number d

1 d

2 check digit d , defined by ( d

1

, d

2

. . . d

8 followed by a

, · · · , d

8

, d ) · (7 , 3 , 9 , 7 , 3 , 9 , 7 , 3 , 9) ≡ 0 (mod 10) .

Is

0 4 4 0 0 0 8 0 4 be a valid bank identification number?

Example 3.9.

The Universal Product Code (UPC) contains a check digit. A UPC number consists of 12 digits d

1

, d

2

, . . . , d

12 where the last digit, d

12

, is the check digit. This check digit must satisfy the condition ( d

1

, d

2

, · · · , d

12

) · (3 , 1 , 3 , 1 , 3 , 1 , 3 , 1 , 3 , 1 , 3 , 1) ≡ 0 (mod 10) .

Is the UPC, 826451510512, valid on UGLYDOLL Tray ?

3.4

Linear Congruences

Brad is ready to get into the bag of m&m’s, but Jamie says that they should make sure the UPC is valid. Brad starts to read off the digits in the UPC: “zero, four, zero, zero, zero, zero, three, four, this digit is smeared and is illegible!, one, four, and the last digit is nine.” Jamie says that they should figure out what the missing digit is, and Chris exclaims that this is an excellent idea. He tells the students that they will end up with a linear congruence to solve. All the students are very excited about having a discussion on solving linear congruences.

Example 3.10.

Find the missing digit in the UPC for the m&m’s.

A linear congruence is a congruence in the form ax ≡ b (mod n ) where x is an unknown integer.

A solution to a linear congruence ax ≡ b (mod n ) is an integer x

0

(mod n ).

such that ax

0

≡ b

Dr. Allen’s Math 4110 Class Notes and Problem Sets 30

The Number Theory Island students try to answer the following questions about linear congruences:

• When does ax ≡ b (mod n ) have a solution?

• If ax ≡ b (mod n ) does have a solution, how do we find all solutions?

• If ax ≡ b (mod n ) does have a solution, how do we characterize all solutions?

Example 3.11.

The students start by considering small examples and looking for patterns or generalizations. They also use what they have discovered about solving linear Diophantine equations. Solve the following congruences.

1. 3 x ≡ 4 (mod 5)

2. 4 x ≡ 1 (mod 2)

3. 2 x ≡ 4 (mod 6)

4. 5 x ≡ 3 (mod 8)

5. 15 x ≡ 9 (mod 12)

6. 10 x ≡ 35 (mod 42)

Dr. Allen’s Math 4110 Class Notes and Problem Sets 31

After looking at the small examples, Steven poses the following research questions which all the students try to answer.

1.

Research Question 1: For the congruence ax ≡ b (mod n ), what are the conditions on a , b , and n for there to be at least one solution?

2.

Research Question 2: Suppose that a , b , and n satisfy the conditions given in response to question 1. Describe a method for finding the solutions (other than trial and error) to ax ≡ b (mod n ).

3.

Research Question 3: Suppose that a , b , and n satisfy the conditions given in response to question 1. How many incongruent solutions modulo n , does the linear congruence ax ≡ b (mod n ) have?

Theorem 17.

Let a , b , n be integers with n ≥ 1 . Let d = gcd( a, n ) .

1. If

2. If modulo n .

, then ax ≡ b (mod n ) has no solutions.

, then ax ≡ b (mod n ) has exactly one solution

3. If solutions modulo n .

, then ax ≡ b (mod n ) has exactly d incongruent

Example 3.12.

Determine if the following congruences are solvable. Find the number of incongruent solutions when a congruence is solvable.

1. 8 x ≡ 10 (mod 6)

2. 2 x ≡ 3 (mod 4)

3. 4 x ≡ 7 (mod 5).

Example 3.13.

Solve the congruence 12 x ≡ 48 (mod 18) .

Dr. Allen’s Math 4110 Class Notes and Problem Sets 32

Example 3.14.

Drew, who is not too excited about the Euclidean Algorithm, suggests that rather than use the Euclidean Algorithm to solve linear Diophantine equations, why not turn the Diophantine equation into a linear congruence, and use properties of congruences to find the solution set. Find the general solution of the linear Diophantine equation

12 x + 20 y = 28 by viewing it as a linear congruence.

Exercise Set 3.3.

Problem 3.6.

(Practice Problems) Page 82, Problems 1a,c,d,f, 2a, b

Problem 3.7.

Pages 75, Problems 26

Problem 3.8.

Determine whether each linear congruence is solvable. Justify. If solvable, determine the number of incongruent solutions of each linear congruence.

1. 12 x ≡ 18 (mod 15)

2. 28 x ≡ 119 (mod 91)

3. 49 x ≡ 94 (mod 36)

4. 91 y ≡ 119 (mod 28)

5. 48 y ≡ 144 (mod 84)

6. 2076 x ≡ 3076 (mod 1076)

Problem 3.9.

Use properties of congruences to find the incongruent solutions of each linear congruence.

1. 5 x ≡ 3 (mod 6)

2. 19 x ≡ 29 (mod 16)

3. 2076 x ≡ 564 (mod 1776)

Dr. Allen’s Math 4110 Class Notes and Problem Sets 33

Problem 3.10.

Use linear congruences to solve each of the following linear diophantine equations.

1. 15 x + 21 y = 39

2. 48 x + 84 y = 144

Problem 3.11.

Now that Drew realizes that he can view a linear Diophantine equation as a linear congruence, he is ready to find the smallest possible number of coconuts in the original pile that the original stranded students collected.

Brad, Hilary, Zach, Whitney, and Chris survive a shipwreck and swim to a tiny deserted island

(called Number Theory Island). They are greeted by a monkey. During the remainder of the day, they gather coconuts for food. Since they are quite tired by now, they decide to retire for the night and agree that in the morning, they will divide the coconuts equally among them. While the others sleep, Brad wakes up and divides the coconuts into five equal piles, with one left over, which he throws out for the monkey. Realizing that he cannot trust the others, Brad hides his share, puts the remaining coconuts together, and goes back to sleep. Later, Hilary gets up and she, too, does not think she can trust the others (especially Brad and Zach). So Hilary divides the pile into five equal shares with one coconut left over which she, too, discards for the monkey. Hilary hides her share, puts the remaining coconuts together, and goes back to sleep. One by one, Zach, Whitney, and

Chris repeat this process. Finally morning comes and they all awake. Brad, Hilary, Zach, Whitney, and Chris each try to look quite innocent. No one makes a remark about the diminished pile of coconuts, and no one decides to be honest and admit that he/she has already taken his/her share.

Instead, they divide the pile equally among them with one coconut left over, which they throw out for the monkey.

Find the smallest possible number of coconuts in the original pile .

Let n = the number of coconuts in the original pile.

Brad

Hilary

Zach dividing the pile amount stolen monkey diminishing pile n = 5 x

4 x

1

= 5

1 x

2

+ 1

+ 1

4 x

2

= 5 x

3

+ 1

Whitney

Chris

4 x

4 x

3

4 next morning 4 x

5

= 5 x

4

= 5 x

5

+ 1

+ 1

= 5 z + 1 x x x x x z

1

2

3

4

5

1

1

1

1

1

1

4 x

4 x

4 x

4 x

4 x

1

2

3

4

5

Starting with the last equation and using substitution and some basic algebra, we ended up with the following linear Diophantine equation: 15625 z − 1024 n = − 11529.

1. Use congruences to solve this equation.

2. What is the smallest possible number of coconuts in the original pile?

3. What is the minimum number of coconuts that Brad stole?

Dr. Allen’s Math 4110 Class Notes and Problem Sets 34

3.5

The Chinese Remainder Theorem

Example 3.15.

Brad has strategically hidden the coconuts that he stole during that first night on the island. One afternoon, Brad goes to one of the places where he hid some coconuts.

He is completely unaware that Hilary has followed him. Hilary can tell that Brad has less than 29 coconuts but she cannot tell exactly how many there are (which is driving her crazy). Hilary (who stays hidden from Brad) observes Brad first arranging his coconuts into piles of 4 with one left over. Next, Brad arranges the coconuts into piles of 5 with two left over. In each case, Hilary cannot see how many piles of 4 and then piles of 5 there are. She realizes, however, that she has enough information to determine how many coconuts Brad has hidden in this particular spot, and she hurries off to share this information with the rest of stranded number theory students, who are very interested in determining how many coconuts Brad has hidden in one of his “secret” places.

Theorem 18 (Chinese Remainder Theorem) .

Let m

1

, m

2

, . . . , m k tively prime positive integers. Let b

1

, b

2

, . . . , b k be pairwise relabe arbitrary integers. Then the system x ≡ b

1 x ≡ b

2

.

..

x ≡ b k has a unique solution modulo m

1 m

2

· · · m k

.

(mod m

(mod m

1

2

)

)

(mod m k

)

Dr. Allen’s Math 4110 Class Notes and Problem Sets 35

Proof.

Proof of the Chinese Remainder Theorem

Existence.

Uniqueness.

Example 3.16.

Use the Chinese Remainder Theorem to solve the system of congruences in Example

3.15.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 36

Example 3.17.

Find a number that leaves a remainder of 1 when divided by 3, a remainder of 2 when divided by 5, and a remainder of 3 when divided by 7. (puzzle by first century mathematician Sun-Tsu)

Example 3.18.

Looking for Hidden Coconuts: Drew and Billy, who missed out on the initial division of the coconuts, hear from Hilary that Brad has piles of coconuts buried in various places. During the night, Drew and Billy (accompanied by the monkey) look for Brad’s hidden places. As Billy is digging, he finds a bag of gold coins! Each coin is of equal denomination. Drew and Billy are very excited about this discovery, and they forget all about Brad’s hidden coconuts. As Drew and Billy are discussing NOT telling the others about the discovery and before they have a chance to count how many gold coins there are, fifteen pirates approach Drew and Billy and steal the sack of gold coins!! The pirates attempt to divide the coins evenly among themselves but find two coins are left over. Instead of tossing out the two leftover coins for Drew and

Billy, the pirates quarrel over these two coins, and one pirate ends up being killed!

Another attempt is made to divide the coins evenly but this time one coin is left over. Instead of throwing the leftover coin to the monkey, another quarrel erupts and another pirate is killed! A third attempt to divide the coins evenly succeeds, and as the pirates leave with the gold, they spot Nick hiding behind a huge rock, and they capture him!! After watching all this pirate activity, Drew and Billy are still curious to how many gold coins they found (and subsequently, lost ). Find the smallest number of gold coins that could have been in the sack initially.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 37

Exercise Set 3.4.

Problem 3.12.

(Practice Problems) Pages 82-83, Problems 4, 5

Problem 3.13.

Solve the following linear system.

x ≡ 1 (mod 3) x ≡ 3 (mod 4) x ≡ 4 (mod 7) x ≡ 7 (mod 11)

Problem 3.14.

Find the largest integer less than 6000 that leaves the remainders

0 , 2 , 3 , 5 when divided by 3 , 5 , 7 , 13 respectively.

Problem 3.15.

Show that the system x ≡ 2 (mod 4) x ≡ 3 (mod 6) is not solvable.

Problem 3.16.

Find the smallest positive integer n such that 2 | n , 3 | n + 2, 7 | n + 3, and 11 | n + 4.

Problem 3.17.

In spite of the little pirate incident, Drew and Billy are still determined to find some of Brad’s coconuts. As Billy is digging, he finds another bag of gold coins, but this time they are very quiet about it because they do not want the pirates to come back. When they arrange the gold coins in groups of seven, there are five left over; if they are grouped in elevens, there are six left over; if they are grouped in thirteens, eight will be left over. Determine the least number of gold coins in the bag.

Problem 3.18. Prove: The linear system x ≡ a (mod m ) x ≡ b (mod n ) is solvable if and only if gcd( m, n ) | ( a − b ).

Problem 3.19.

Solve the linear system x ≡ 3 (mod 6) x ≡ 5 (mod 8) .

Problem 3.20.

Brad decides to check on one of his “secret” places where he has hidden over 500 coconuts! Instead of directly counting his coconuts, Brad decides to arrange his coconuts in piles of 12 with 5 leftover. Next, he arranges his coconuts in piles of 16, but this time he has 9 leftover. Finally, Brad diligently distributes his coconuts in piles of 18, but there are 11 coconuts leftover. Brad is happy because he now has enough information to determine how many coconuts he has put in this particular hiding place. Find the least number of coconuts that Brad has.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 38

Chapter 4

Special Congruences

A Little Math Magic: The stranded students on Number Theory Island gather to discuss some number theory. Before they start, Brad tells them that he has a magic trick. Brad says, “choose a positive integer less than my favorite prime, which is 101.

Do not pick 1 because that would not be very interesting for my trick. Do not tell me your number.” After the other thirteen students have selected their numbers, Brad says, “I will predict the remainder when you raise your number to the 100th power and divide it by 101.” The diligent students do their calculations. Brad hands each of the students an envelope which contains his prediction. Zach finally completes his calculation, opens the envelope and exclaims, “Brad predicted the remainder for my number correctly!” One by one the students open the envelopes and each time, Brad predicted the correct remainder without knowing what the selected numbers were.

How did Brad do this? Chris is quite pleased with Brad’s trick, and he informs the group that they should investigate why Brad’s trick works.

Example 4.1.

Find the least nonnegative residue modulo m of each integer n below.

1.

n = 2

6

, m = 7

2.

n = 4110 6 , m = 7

3.

n = 4 10 , m = 11

4.

n = 3

12

, m = 13

5.

n = 5 16 , m = 17

6.

n = 6

18

, m = 19

7. Formulate a conjecture based on the limited numerical evidence above.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 39

4.1

Fermat’s Little Theorem

Theorem 19 (Fermat’s Little Theorem) .

1. For any prime p and any integer a , a p

(mod p ) .

− a is divisible by p ; that is, a p ≡ a

2. If p is a prime and a is an integer with gcd( a, p ) = 1 (thus, p

a ), then a p − 1

(mod p ) .

≡ 1

Proof.

Example 4.2.

Find the remainder when 3 201 is divided by 11.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 40

Example 4.3.

After discovering Fermat’s Little Theorem, Jess notices that Fermat’s Little Theorem implies a test for compositeness. Explain the reasoning for this, and use Fermat’s

Little Theorem to show that 63 is composite.

After seeing how Fermat’s Little Theorem can be used to show that a number n is composite, Steven poses the question, “Is the converse of Fermat’s Little Theorem true?” And Chris responds, “Let’s investigate!”

Example 4.4.

Show that 2 341 ≡ 2 (mod 341), but 341 = 11 · 31 is not prime.

Lemma 3.

Suppose that m and n are relatively prime. If a ≡ b (mod m ) and a ≡ b

(mod n ) , then a ≡ b (mod mn ) .

Using Lemma 3, we show 2 341 ≡ 2 (mod 341).

Dr. Allen’s Math 4110 Class Notes and Problem Sets 41

Exercise Set 4.1.

Problem 4.1.

Use Fermat’s Little Theorem to find the remainder when 24

1947 divided by 17.

is

Problem 4.2.

Use Fermat’s Little Theorem to find the remainder when 2

100

+ 3

123 is divided by 11.

Problem 4.3.

Use Fermat’s Little Theorem to verify the compositeness of 33.

Problem 4.4.

Page 92, Problems 1, 2b, 4b, 6a

Problem 4.5.

Divide 2

10282009 by 101. What is the remainder?

4.2

Pseudo-primes, Probable Primes, Absolute Pseudoprimes

Definition 4.1

(pseudo-prime) .

A pseudo-prime is a composite number n > 1 satisfying 2 n ≡ 2 (mod n ) .

An example of a pseudo-prime is 341. In fact, 341 is the smallest pseudo-prime.

Definition 4.2

(probable prime) .

A probable prime is an integer n > 1 satisfying

2 n ≡ 2 (mod n ) .

Example 4.5.

F n

= 2 prime.)

2 n

+ 1 is a probable prime. (Note: For n ≥ 5, F n is really probably not a

Dr. Allen’s Math 4110 Class Notes and Problem Sets 42

Definition 4.3

(absolute pseudo-prime) .

An absolute pseudo-prime or Carmichael number is a composite number n > 1 such that a n ≡ a (mod n ) for every integer a .

Example 4.6.

561 is an absolute pseudo-prime. To show this result, we again make use of Lemma

3 and of the following lemma.

Lemma 4.

Let p be a prime, and n an integer > 1 . If ( p − 1) | ( n − 1) , then a n

(mod p ) for all integers a .

≡ a

Now using Lemma 3 and Lemma 4, we show that 561 is an absolute pseudo-prime.

Exercise Set 4.2.

Problem 4.6.

Suppose that m and n are relatively prime. If a ≡ b (mod m ) and a ≡ b (mod n ), then a ≡ b (mod mn ).

Problem 4.7. Prove: Let p be a prime, and n an integer > 1. If ( p − 1) | ( n − 1), then a n ≡ a (mod p ) for all integers a .

Problem 4.8.

Show that 1105 and 1729 are absolute pseudo-primes.

Problem 4.9. Prove: There exist infinitely many pseudo-primes.

Problem 4.10.

Pages 92-93, Problems 9a, 11a, 11b, 20

Dr. Allen’s Math 4110 Class Notes and Problem Sets 43

4.3

Wilson’s Theorem

The stranded students gather for their next discussion of congruences and primes.

Jonathan has been impressed with the power of congruences, and he is interested in exploring congruences involving factorials. The students decide to investigate the following problems.

Example 4.7.

1. Does 2 divide 1! + 1?

2. 3 divide 2! + 1?

3. 5 divide 4! + 1?

4. 7 divide 6! + 1?

5. 11 divide 10! + 1?

6. Make a conjecture based on the above.

Example 4.8.

The students decide to use their new conjecture to find the least nonnegative residue modulo m of each integer n below.

1.

n = 88!, m = 89

Dr. Allen’s Math 4110 Class Notes and Problem Sets 44

2.

n = 21!, m = 23

3.

n =

31!

22!

, m = 11.

4.

n = 2(100!), m = 103.

Example 4.9.

Use the conjecture to prove the following:

If p is an odd prime, then 2( p − 3)!

≡ − 1 (mod p ).

Dr. Allen’s Math 4110 Class Notes and Problem Sets 45

Chris is quite pleased with their new conjecture, but now he insists that they prove the conjecture. He suggests that they start by proving the following lemma.

Lemma 5.

Let p be prime and let a ∈ only if a ≡ ± 1 (mod p ) .

Z

. Then a is its own inverse (mod p ) if and

Proof.

Theorem 20 (Wilson’s Theorem) .

If p is a prime, then ( p − 1)!

≡ − 1 (mod p ) .

Proof.

Brad claims that the converse of Wilson’s Theorem is true. Furthermore, he explains that they can use that result to test whether or not an integer is prime. Chris says to Brad, “Prove the converse for us!” Brad, who has been studying up on logic and proof techniques in his spare time on the island, replies “Okay, we will do a proof by contradiction. We will suppose that there does exist a counterexample, and we will eventually obtain an impossible situation (although, I am not sure what this impossible situation will be at this point, but I’m confident that I can reach one).

Thus, there are no counterexamples to the converse and hence the converse is true.”

Dr. Allen’s Math 4110 Class Notes and Problem Sets 46

Theorem 21 (Converse of Wilson’s Theorem) .

If n is an integer > 1 for which

( n − 1)!

≡ − 1 (mod n ) , then n is a prime.

Proof.

After convincing the students that the converse is true, Brad says, “Wilson’s theorem and its converse give us a way of testing whether or not a number is prime. In other words, if ( n − 1)!

≡ − 1 (mod n ), then n is prime; otherwise, n is composite. Let’s use this primality test to show that 6 is not prime.” Whitney is very excited about using this test to show that 6 is not prime.

Jessica says “Brad, that’s nice, but I do not think this primality test is very practical.” Explain why Jessica does not think this primality test is practical.

Brad offers the suggestion that since they have already investigated solutions to linear congruences, maybe they should begin to look at solutions to quadratic congruences.

Chris exclaims, “Brad, what a most excellent idea!!”

What is a

• linear congruence

• quadratic congruence

Dr. Allen’s Math 4110 Class Notes and Problem Sets 47

The students decide to investigate the following question:

Question: Consider x 2 + 1 ≡ 0 (mod p ), where p is an odd prime. When does this congruence have a solution, and what is a solution?

The students start by investigating solutions for small values of p and then they make a conjecture based on their limited amount of evidence.

1. Give the solution set for x 2 + 1 ≡ 0 (mod 3).

2. Give the solution set for x 2 + 1 ≡ 0 (mod 5).

3. Give the solution set for x 2 + 1 ≡ 0 (mod 7).

4. Give the solution set for x 2 + 1 ≡ 0 (mod 11).

5. Give the solution set for x

2

+ 1 ≡ 0 (mod 13).

6. Give the solution set for x 2 + 1 ≡ 0 (mod 17).

7. Summarize the results for x 2 + 1 ≡ 0 (mod p ) having solutions for small values of p . What are the two types of odd primes? Based on the results make a conjecture about when the congruence x 2 + 1 ≡ 0 (mod p ) has a solution.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 48

Theorem 22.

Let p be an odd prime. Then x 2 + 1 ≡ 0 (mod p ) has a solution if and only if p ≡ 1 (mod 4) .

Comment.

The proof makes use of both Wilson’s Theorem and Fermat’s Little Theorem.

Proof.

Example 4.10.

Find a solution to x 2 6≡ − 1 (mod 17).

Dr. Allen’s Math 4110 Class Notes and Problem Sets 49

Chapter 5

Number-Theoretic Functions

Define the following terms.

• number-theoretic function

• multiplicative function

5.1

The Tau Function (Counting Divisors)

Brad is tried of counting coconuts; Drew and Billy are somewhat weary of counting gold coins; and Hilary still has lots of energy in keeping up with the counts and trying to find all the hiding places. The number theory students decide to count the number of positive divisors a positive integer n has. So they start by listing the factors of 1, 2,

3, 4, 5, 6, 7, 8, 9, 10, 11, 12, etc. After they list the factors, they count them. Hilary interrupts the counting, and poses the following question, “Do you think that there is a formula for the number of divisors of a positive integer?” Jess is pleased with

Hilary’s question, and she suggests that they discover such a formula. Chris suggests some useful notation: “Let’s use τ ( n ) to represent the number of positive divisors of n .” The number theory students agree on the notation, and they refer to this as the tau function .

Definition 5.1

(tau function) .

Let n be a positive integer. The number of divisors function, denoted τ ( n ) , denotes the number of positive divisors of n ( τ ( n ) = the number of (positive) divisors of n ).

Note: τ ( n ) =

X

1.

d | n

Dr. Allen’s Math 4110 Class Notes and Problem Sets 50

We find a formula for τ ( n ).

Example 5.1.

Find τ ( n ) for the first 16 positive integers.

9

10

11

12

7

8

5

6

13

14

15

16

2

3

4 n

1 factors

Observations:

• n is prime if and only if τ ( n ) = prime factorization τ ( n )

.

• For p prime and k ≥ 1, τ ( p k

) = .

Example 5.2.

1. Find τ (32).

2. Find τ (18).

Dr. Allen’s Math 4110 Class Notes and Problem Sets 51

3. Find τ (3500).

4. Find a formula for τ ( n ).

Example 5.3.

Find a given that 2 3 · 3 a · 11 5 has 96 positive divisors. Justify.

Example 5.4.

Give all of the possible forms of the prime factorization of n if n has 18 positive factors. Justify.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 52

5.2

The Sigma Function (Summing Divisors)

The number theory students are quite pleased with themselves for coming up with a formula for τ ( n ). Steven asks, “Now that we know how many factors a positive number has, what is the sum of the positive factors?” Chris is quite pleased with Steven’s question, and he promptly exclaims, “Let’s investigate this!” Jamie responds,“okay, but for convenience, let’s let σ ( n ) denote the sum of all the positive factors of n .”

The students refer to this as the sigma function , and they are determined to find a formula for σ ( n ). They start by considering σ ( n ) for small values of n , and they look for patterns.

Definition 5.2

(sigma function) .

Let n be a positive integer. The sum of divisors function, denoted σ ( n ) , denotes the sum of all positive divisors of n .

Example 5.5.

Calculate σ (6).

Note: σ ( n ) =

X d .

d | n

Example 5.6.

Find σ ( n ) for the first 16 numbers.

11

12

13

14

7

8

9

10

15

16

4

5

6

2

3 n

1 factors

Note: n is prime if and only if σ ( n ) = prime factorization σ ( n )

.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 53

Example 5.7.

Find σ ( n ) if n is a power of a prime.

Example 5.8.

Now consider when n is a product of different primes. Consider n = 24. Find σ (24).

Example 5.9.

Find a formula for σ ( n ).

Example 5.10.

1. Find σ (35).

2. What is the sum of the positive divisors of 150?

3. What is σ (3

10

)?

Dr. Allen’s Math 4110 Class Notes and Problem Sets 54

Assignment: (Be prepared to have a class discussion on these on Wednesday, Nov.

18.)

1. Calculate τ ( n ) for the following values of n .

(a) 4110

(b) 2

32 , 582 , 657

2. If n is the product of k distinct primes, what is τ ( n )?

3. What are the possible forms of the prime factorization of n if n has 12 positive factors? Justify your answer.

4. What is the smallest number that has exactly 18 divisors? Justify.

5.

Prove or disprove : If p is prime, then p 2 − 2 is prime.

6.

Prove or disprove : If p is an odd prime, then τ (3 + p ) = τ (3) + τ ( p ).

7. Find a given that 2 4 · 5 a · 7 2 · 36 has 315 positive divisors. Justify.

8. Calculate σ ( n ) for the following values of n .

(a) 4110

(b) 2

32 , 582 , 657 − 1

9. What is 1 + 6 + 6 2 + 6 3 + 6 4 + 6 5 ? Is this σ (6 5 )? Justify.

10. Let p be a prime. Find all values of p for which σ ( p ) is odd.

11. Let n be the product of a pair of twin primes with p being the smaller of the two.

(a) Find τ ( n ).

(b) Show that σ ( n ) = ( p + 1)( p + 3).

12. Page 110, Problem 5

13. Page 110, Problem 7a

14. Page 111, Problem 13

15. Page 111, Problem 14

16. Page 111, Problem 15

17. Page 111, Problem 17

18. Page 111, Problem 18

19. Page 111, Problem 19

Dr. Allen’s Math 4110 Class Notes and Problem Sets 55

5.3

Euler’s Theorem

After discovering Fermat’s Little Theorem, Wilson’s Theorem, and formulas for the tau and sigma functions, the stranded number theory students pose the following questions:

1. Does Fermat’s Little Theorem hold if the prime modulus is replaced with a composite modulus?

2. If not, can we use the idea of Fermat’s Little Theorem to extend to congruences with a composite modulus?

What is Fermat’s Little Theorem ? (Give a very precise statement.)

(another way to state Fermat’s Little Theorem):

Does Fermat’s Little Theorem hold if the prime modulus is replaced with a composite modulus?

Can the idea of Fermat’s Little Theorem be extended to congruences where the moduli is not prime?

Note: If there does exist a positive integer f ( m ) such that a f ( m ) gcd( a, m ) = 1.

≡ 1 (mod m ), then

Example 5.11.

Determine if there exists a positive integer f ( m ) such that a f ( m ) ≡ 1 (mod m ) for m = 6 , 9 , and 10 where a is a positive integer ≤ m and relatively prime to it.

• Take m = 6, and a ∈ { 1 , 5 } .

a

2 a

1

5

Conclusion: If a ∈

Z with gcd( a, 6) = 1, then a ≡ 1 (mod 6).

Dr. Allen’s Math 4110 Class Notes and Problem Sets 56

• Take m = 9, and a ∈ { 1 , 2 , 4 , 5 , 7 , 8 } .

a

2 a

7

8

4

5

1

2

Conclusion: If a ∈

Z with gcd( a, 9) = 1, then a ≡ 1 (mod 9).

Based on your results in Example 5.11, make a conjecture about the integer f ( m ).

Definition 5.3

(Euler’s Phi Function) .

Let n be a positive integer.

Euler’s Phi

Function , denoted φ ( n ) , is the number of positive integers ≤ n which are relatively prime to n .

Theorem 23 (Euler’s Theorem) .

For every positive integer n and for every integer a relatively prime to n , a φ ( n ) ≡ 1 (mod n ) .

Example 5.12.

An example to illustrate the idea of the proof of Euler’s Theorem. Take n = 12 and a = 35.

1. By Euler’s Theorem (with n = 12 and a = 35), .

2. The positive integers less than or equal to 12 that are relatively prime to 12 are

.

3. Multiply each of the numbers above by a (where a = 35).

4. Look at each of the products above modulo 12. (What do you observe about these products)

5. Conclusion (use the information above and the properties of congruence to show

35 4 ≡ 1 (mod 12):

Dr. Allen’s Math 4110 Class Notes and Problem Sets 57

Example 5.13.

Find the remainder when 245

1040 is divided by 18.

Example 5.14.

Use Euler’s Theorem to prove Fermat’s Little Theorem.

Assignment: (In preparation for final exam)

Problem 5.1.

Illustrate Euler’s Theorem with n = 24.

Problem 5.2.

1. Using Fermat’s Little Theorem, find the units digit of 3

100

.

2. Using Euler’s Theorem, find the units digit of 3 100 .

Problem 5.3.

Use Euler’s Theorem to evaluate 2

100000

(mod 77).

Problem 5.4.

Page 140, Problems 1a, 2

5.4

Euler’s Phi Function

The stranded number theory students try to discover a formula for φ ( n ) like they did for the tau and sigma functions. The students are eager to find a formula.

Example 5.15.

Calculate the following.

1.

φ ( p ) where p is prime.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 58

2.

φ ( pq ) where p and q are distinct primes.

3.

φ ( p k ) where p is a prime and k is a positive integer.

Theorem 24.

Let m and n be relatively prime positive integers. Then

φ ( mn ) = φ ( m ) φ ( n ) .

In other words, the Phi Function is multiplicative.

Let e j

∈ n ∈

Z

+ . Write n = p e

1

1 p e

2

2

· · · p e r r

Z

+ . Find a formula for φ ( n ).

where p

1

, p

2

, . . . , p r are distinct primes and each

Example 5.16.

Calculate the following.

1.

φ (100)

Dr. Allen’s Math 4110 Class Notes and Problem Sets 59

2.

φ (140)

Example 5.17

(Using Euler’s Phi Function to show there exists infinitely many primes) .

After the students discover the formula for Euler’s Phi Function, Zach exclaims “let’s use Euler’s Phi Function to prove that there are infinitely many primes! Here’s how the proof by contradiction goes.”

(Hilary still likes her “favorite list of primes method” better.)

Assignment : (In preparation for the final exam)

Problem 5.5.

Page 135, Problems 1, 2, 4a, 4b, 4c

Problem 5.6.

Find the smallest positive integer k such that a k every integer a which is relatively prime to 756.

≡ 1 (mod 756) for

Dr. Allen’s Math 4110 Class Notes and Problem Sets 60

5.5

Primitive Roots

Definition 5.4

(order of a (mod n )) .

Let a be an integer, and n a positive integer with gcd( a, n ) = 1 . Then the order of a modulo n , denoted ord n

( a ) , is the least positive integer d such that a d ≡ 1 (mod n ) .

Example 5.18.

Calculate the order of 5 modulo 13.

Example 5.19.

Consider a e ≡ 1 (mod 7). Find the order of a modulo 7 for a ∈ { 1 , 2 , 3 , 4 , 5 , 6 } . What, if anything, can you say about the relationship between the order of a (mod 7) and

φ (7)?

Theorem 25.

Let a be a positive integer such that gcd( a, n ) = 1 and suppose a has order k modulo n . Then a h ≡ 1 (mod n ) if and only if k | h .

Corollary 2.

Let a be a positive integer such that gcd( a, n ) = 1 and suppose a has order k modulo n . Then k | φ ( n ) .

Example 5.20.

Calculate the order of 5 modulo 21.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 61

Example 5.21.

1. For a = 3 and n = 7, what is the exponent k guaranteed by Euler’s Theorem?

2. What is the order of 3 (mod 7)?

Definition 5.5

(primitive root) .

If an integer a has order φ ( n ) modulo a positive integer n , then a is a primitive root modulo n .

By Example 5.21, 3 is a primitive root of 7.

Example 5.22.

Verify that 2 is primitive root modulo 9.

Question: Given any positive integer n , does there exist a primitive root modulo n ?

Comment: There exists a primitive root modulo n if and only if n is 2, 4, p r , or

2 p r where p denotes an odd prime and r denotes a positive integer.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 62

5.6

An Application of Euler’s Theorem: Public-

Key Encryption

Drew and Billy, inspired by Euler’s Theorem, decide to develop a secure cryptosystem, and they decide to use a public-key encryption. They realize not only does this cryptosystem have the advantage of being secure, but it has the added benefit that they can announce to Brad and Zach (and the entire world) how to encode messages sent to them (but, unfortunately, Brad and Zach will not be able to decode the messages if Drew and Billy have used smart choices for their primes).

One day soon after discovering Euler’s Theorem, Drew posts the following message on a coconut tree for all to see (including Brad, Zach, the monkey, and the pirates):

If someone wishes to send me, Drew, a message, use the following. Let N =

307829 and e = 1229. As your alphabet use the following.

A B C D E F G H I J K L M N O P Q R

00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18

S T U V W X Y Z 1 2 3 4 5 6 7 8 9 0

19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

Suppose your message is M . (Keep M < N . If the message M is too long, break it into blocks of digits, M

1

, . . . , M k of appropriate size.) Let

C ≡ M e

(mod N ) where 0 ≤ C < N . Then M is your actual message, and C is the encrypted message. Post C on this tree, and I alone will know your actual message M .

Note: To do this properly, one needs N to be considerably larger.

The following day, a message to Drew from Billy appears on the coconut tree.

Drew, I really like your idea for having secret messages sent to you so that no one else can know what’s being said besides you. This is especially nice since

Brad, Zach, Hilary, and the others will not be able to read the location of the new gold and some supplies that I discovered. Here is the location:

C = 7527; 13993; 178446; 236781; 291288; 213721; 300406

Sincerely, Billy

What is the secret? How can Drew and Drew alone, decode the message?

Dr. Allen’s Math 4110 Class Notes and Problem Sets 63

The number N is a product of two large primes (sufficiently large so only Drew knows how N factors). In reality, one needs to choose two primes with each having at least two hundred digits.

Show the secret.

Where is the location of the gold?

Assignment: (In preparation for the final exam)

Problem 5.7.

Where is the location of the gold? Explain how you decoded Billy’s message.

Problem 5.8.

The ciphertext (encrypted message) 5859 was obtained from the RSA algorithm using n = 11413 and e = 7467. Using the factorization 11413 = 101 · 113, find the plaintext (the original message).

Problem 5.9.

Suppose your RSA modulus is n = 55 and your encrption exponent is e = 3.

1. Find the decryption modulus d .

2. Assume that gcd( m, 55) = 1. Show that if c ≡ m 3 then the plaintext is m ≡ c d

(mod 55) is the ciphertext,

(mod 55). Do not quote the fact that RSA decryption works. That is what you are showing in this specific case.

Dr. Allen’s Math 4110 Class Notes and Problem Sets 64

Download