Você está na página 1de 12

Congruences

Note: I have attempted to restore as much of the fonts as I could, unfortunately I do not have the
original document, so there could be some minor mistakes.

It all started a long time ago when someone noticed that when you add two integers, the
remainders get added too. He probably ran and told this to a friend who asked him " Hey,
what about multiplication?" They found it worked for multiplication too. Think of two
integers and add them up. Now consider the remainders left by these integers when
divided by another integer.

Consider 9 + 10 = 19, and consider the remainders when these numbers are divided by 7.

2 + 3 = 5.

Now try multiplication 9 * 10 = 90, and the remainders,

2 * 3 = 6.

It seems that in those times, the Greeks, Indians and Chinese talked to each other a lot
about these things, and developed quite a bit of knowledge about this kind of things. The
Indians and Chinese particularly enjoyed creating and solving a variety of interesting
problems ( most of which had very little to do with everyday life! ), the solutions of
which involved thinking about remainders. It was tough though, because they did not
even have the algebraic notation that we take for granted today. Even after the advent of
Algebra, it took a couple of hundred years before Gauss in Europe, came up with the
notation we use today for congruences. This notation probably opened the floodgates, for
in the next couple of hundred years we saw a major outpouring of discoveries,
conjectures, and theorems dealing with integers that formalized and rigorized those ideas.

Gauss came up with the congruence notation to indicate the relationship between all
integers that leave the same remainder when divided by a particular integer. This
particular integer is called the modulus, and the arithmetic we do with this type of
relationships is called the Modular Arithmetic. For example, the integers 2, 9, 16, all
leave the same remainder when divided by 7. The special relationship between the
numbers 2, 9, 16 with respect to the number 7 is indicated by saying these numbers are
congruent to each other modulo 7, and writing,

16 9 2 ( mod7).

Thus the intuitive idea behind the congruency concept is as follows.


Intuitive idea : If two numbers a and b leave the same remainder when divided by a
third number m, then we say "a is congruent to b modulo m", and write a b ( mod m ).

The following definition formalizes this concept.

Defintion: a b ( mod m ) if and only if m | (a - b).

Using the definition of "divides", m | (a - b) can be translated to a - b = km for some


integer k.

Although some books give this as a lemma or theorem, it is always best to think of this as
an immediate extension of the definition of the congruency using the definition of the
divides.

Also note that the intuitive idea we mentioned at the outset can be easily derived from the
formal definition above. Some texts may give this too as a theorem or lemma.

The conclusion in the next paragraph however, has far reaching implications, and for this
reason we list it as our first Theorem. Though this theorem seems obvious, it needs an
important theorem from Divisibility for its proof.

Theorem 1: Every integer is congruent ( mod m) to exactly one of the numbers in


the list :-

0, 1, 2, . (m - 2), (m -1).

Proof: From a theorem in Divisibility, sometimes called Division Algorithm, for every
integer a, there exist unique integers q and r such that a = qm + r, with 0 r < m. This
shows a - r = qm

or m| (a - r). Hence a r ( mod m ).

Since r is a unique integer, and 0 r < m, it follows that r is only one of the integers on
the list.

In the above proof, we could have jumped from a = qm + r to a r ( mod m ) using the
intuitive idea. You can always do this in your proofs with a sentence like "since a = qm +
r we have a r ( mod m )". This is perfectly fine, because as I mentioned earlier many
texts give the intuitive idea as a lemma.

The number r in the proof is called the least residue of the number a modulo m.

Exercise 1: Find the least residue of 100 (a) mod 3 , (b) mod 30, (c) mod 98, and (d) mod
103.

Congruences act like equalities in many ways. The following theorem is a collection of
the properties that are similar to equalities. All of these easily follow directly from the
definition of congruence.

Pay particular attention to the last two, as we will be using them quite often.

Theorem 2: For any integers a, b, c, and d

(a) a a ( mod m )

(b) If a b ( mod m ), then b a ( mod m ).

(c) If a b ( mod m ) and b c ( mod m ) , then a c ( mod m ).

(d) If a b ( mod m ) and c d ( mod m ) , then a c b d ( mod m ).

(e) If a b ( mod m ) and c d ( mod m ) , then ac bd ( mod m ).

Exercise 2: Verify parts (d) and (e) of the theorem in the following way. Write down two
separate congruences with the same modulus that we know are true, such as 9 2 ( mod
7 ) and 17 3 ( mod 7 ). Now add and multiply these congruences to get two new
congruences. Check if the new congruences are true.

Exercise 3: Prove the following statement. "If a b ( mod m ), then a2 b2 ( mod m )".

Hint: Do not fall back on the definition. Use the theorem above instead!

You have probably guessed that the statement in Exercise 3 can be generalized to say,

If a b ( mod m ), then ak bk ( mod m ), where k is any integer.


This statement is indeed true and very useful. We will be raising a congruence to the
power of an integer of our choice quite often. Note this statement can be proven easily by
the repeated application of the method you used in Exercise 3, or more precisely, by
using Induction.

Have you ever wondered what is the use of "lame" properties like (a) in the last theorem?
Well, read on. The last two properties ( (d) and (e) ) in the theorem basically say that we
can add or multiply congruences. But how about adding an equation to a congruency or
multiplying a congruency by an equation? Note that "adding an equation to a
congruency" is a fancy way of saying adding the same integer to both sides of a
congruency. Similarly the other fancy phrase means multiplying both sides of a
congruency by the same number. Intuition tells us that these two operations must be
permissible. In fact, not only they are allowed, but also we will be using them quite often.
Let's state them as a theorem and prove it.

Theorem 3: For any integers a, b, and c

(a) If a b ( mod m ), then a + c b + c ( mod m ).

(b) If a b ( mod m ), then ca cb ( mod m ).

Proof: Let's prove (b). Proof for (a) is very similar.

From Theorem 2 part (a), c c ( mod m ).

It is given that a b ( mod m ). Then by Theorem 2 part (e), we have

ca cb ( mod m ).

Even before you had a look at the proof above, you probably guessed that the "lame"
properties are there for a very good reason. The proof above gives us a glimpse of this
"reason".

Exercise 4: Start with a congruency that we know is true, like 9 2 ( mod 7 ). Now think
of an integer and multiply both sides of the congruency by that integer. Check if the
congruency still holds.

Repeat with another integer. Now repeat the whole process, starting with a fresh
congruency, this time with a non-prime modulus.
Conspicuously missing from all the properties sated so far is the division of a
congruence. Can we divide one congruency by another or by an integer? Unfortunately,
the answer in general, is no. However, not all is lost. We are allowed to divide a
congruency by some special numbers. But we will postpone this until the end of this
chapter, as this operation is more useful when dealing with the area of the next chapter,
which are linear congruences.

Now we will look at some examples to appreciate the usefulness of the congruences.

Example 1: Find the remainder when 25 100 + 115 00 is divided by 3.

We observe that 25 1 ( mod 3 ) and 11 -1 ( mod 3 ). Raising these to the approopriate


powers, 25 100 1 100 ( mod 3 ) and 11 500 (-1) 500 ( mod 3 ). That is,

25 100 1 ( mod 3 ) and 11 500 1 ( mod 3 ). Adding these congruecies, we get 25 100 + 11
500
2 ( mod 3 ).

Thus the remainder is 2.

Example 2: What is the remainder when 3 5555 is divided by 80?

We notice that 3 4 = 81 1 ( mod 80 ). That is, we have 3 4 1 ( mod 80 ) ------------ (1)

We also know that 5555 when divided by 4, gives a quotient of 1388 and the remainder
3.

Hence, 3 5555 = (3 4) 1388. 3 3. Now raising congruence (1) to the power of 1388, we have

(34)13881(mod80).

Multiplying this by 3 3 we get (3 4) 1388 . 3 3 3 3 ( mod 80 ).

Which means, 3 5555 27 ( mod 80 ).

Thus the required remainder is 27. Unfortunately you cannot verify this by using your
pocket calculator!

Exercise 5: Find the remainder when 5 1000 is divided by 126.


Example 3: Show that 3 1000 + 3 is divisible by 28.

We know that 3 3 = 27 -1 ( mod 28 ). Further, 1000 = 3 . 333 + 1.

Now, (33)333 (-1)333 -1 ( mod 28 ).

3 1000 = (33)333 . 31 -1 . 3 -3 (( mod 28 ).

We also know that 3 3 ( mod 28 ). Adding the last two congruences,

3 1000 + 25 -3 + 3 0 ( mod 28 ).

Thus 28 divides 3 1000 + 3 .

The problem in the following example needs a little more ingenuity to solve. It is a
marvelous example of the power of congruences!

Example 4: Prove that 2 5n + 1 + 5 n + 2 is divisible by 27 for any positive integer n.

Note that 2 5n + 1 = 2 . 2 5n , and 5 n + 2 = 25. 5 n.

Now 25 = 32 5 ( mod 27 ) and hence (25)n 5n ( mod 27 ), and 2 . (25)n 2 . 5n ( mod


27 ).

Therefore 2 5n + 1 + 5 n + 2 2 . 5 n + 25. 5 n ( mod 27 ).

27 . 5 n ( mod 27 )

0 ( mod 27 ).

Which shows 27 divides the given expression.

Now try the next exercise without looking back at Example 4.

Exercise 6: Prove that 2 n + 4 + 3 3 n + 2 is divisible by 25 for any positive integer n.

Example 5: Prove that in the base 8 system, a number is congruent to the sum of its
"digits" modulo 7.
Suppose that N is written as ak ak-1.. a1a0 in the base 8 system.

Then N = ak.8k + ak-1.8k-1 + ...+ a1.81 + a0.1

Now 8 1 ( mod 7 ) and raising the power, we have 8n 1 ( mod 7 ) for all integer n.

Thus we have

ak.8k ak ( mod 7 ), ak-1.8k-1 ak-1 ( mod 7 ), ... a1.81 a1 ( mod 7 ), a0.1 a0 ( mod 7 ).

Adding, we get N = ak.8k + ak-1.8k-1 + ...+ a1.81 + a0.1 ak + ak-1 + ...+ a1 + a0 ( mod 7
)

Dividing a Congruence

Finally we are going to see if we can divide a congruence. Consider a simple congruency,
that we know is true, for example, 14 4 ( mod 10 ). If we divide both sides by 2, we get
7 2 ( mod 10 ), which clearly is not true. On the other hand, the true congruence 33 3
( mod 10 ), upon division by 3 gives 11 1 ( mod 10 ) which is also true. The following
theorem tells us when and with what can we divide a congruence. Essentially, it says that
we can divide by a number that is relatively prime to the modulus.

Theorem 3: ca cb ( mod m ) implies a b ( mod m ) if and only if (c, m) = 1.

Proof: Note that we already know that a b ( mod m ) implies ca cb ( mod m ), from
Theorem 2. We will prove the other direction, which is what is new, and that allows us to
divide. That is,

if (c, m) = 1, then ca cb ( mod m ) implies a b ( mod m ).

ca cb ( mod m ) implies m | ( ca - cb ). That is, m | c(a - b).

Since (c, m) =1, a theorem from divisibility tells us that m | ( a- b).

Hence a b ( mod m ).
Exercise 7: Consider the following congruences, where x is an integer. State which of
these can be simplified by division, and if so, state the biggest number by which you are
allowed to divide.

4x 2 ( mod 2 ) 4x 2 ( mod 3 ) 42x 21 ( mod 12 ) 400x 200 ( mod 201 )

400x 200 ( mod 205 ) 64x 48 ( mod 101 ) 48x 42 ( mod 10 )

Congruences

1. Say "n is odd" in three other ways.

2. Write down a complete residue system modulo 6 consisting only of negative numbers.

3. List all integers x in the range 1 x 100 that satisfy x 7 ( mod 17 ).

4. Find the least residue of 1492 ( mod 4), ( mod 10 ), and ( mod 101). No tricks here !
Just divide !!

5. What is the greatest negative number that is congruent to m - 2 ( mod m ).

6. Does 33x 12 ( mod 6 ) imply 11x 4 ( mod 6 ) ? Why ?

7. Does 28x 14 ( mod 12 ) imply 4x 2 ( mod 12) ? Why ? Does the later congruence
imply 2x 1 ( mod 12 ) ? Why ?

8. If p is a prime, does p! 2p ( mod p) imply (p - 1)! 2 ( mod p ) ?

9. If p is a prime, does (p - 1)! 2p - 2 ( mod p) imply (p - 2)! 2 ( mod p ) ?

10. Write a single congruence that is equivalent to the pair of congruencies x 1 ( mod 4
) , x 2 ( mod 3 ).

12. Prove that 10 k 1 ( mod 9 ) for every positive integer k.

13. If k 1 ( mod 4 ), then what is 6k +5 congruent to ( mod 4)?

14. Find the missing digit in the multiplication 31415 . 92653 = 2910?93995

15. Show that every prime greater than 3 is congruent to 1 or 5 ( mod 6).

16. If p is an odd prime and p 1 (mod 3), prove p 1 (mod 6).


17. Prove that every integer is congruent ( mod 9) to the sum of its digits.

18. Prove or disprove that if a b ( mod m ), then a2 b2 ( mod m).

19. Prove an integer is congruent ( mod 10 ) to its units digit ( last digit ). Use this to
prove that the fourth power of an integer must have 0,1, 5, or 6 for its units digit.

20. Show that if n 4 ( mod 9 ), then n cannot be written as the sum of three cubes.

21. Show that no square number has as its last digit, 2, 3, 7, or 8.

22. Find the least positive integer x such that 13 | ( x2 + 1).

23. Prove that 2 5n + 1 + 5 n + 2 is divisible by 27.

Fermat's and Wilson's Theorems

1. What is the remainder when 314 162 is divided by 163?

2. What is the remainder when 2 1005 is divided by 101 ?

3 . What is the least residue of 5 10 ( mod 11), 5 12( mod 11 ) , 1945 12 ( mod 11) ?

3. What is the remainder when 314 162 is divided by 7?

4. Prove that n6 - 1 is divisible by 7 if (n, 7) = 1.

5. Prove that n12 - 1 is divisible by 7 if (n, 7) = 1.

6. Prove that n7 - n is divisible by 42 for any integer n.

7. What is the remainder when 10! is divided by 11?

8. Show that 28! + 5 4 ( mod 29 ).

9. Find the least positive residue of 8.9.10.11.12.13 modulo 7.

10. Show that if p is an odd prime, then 2(p - 3)! -1 (mod p).

Divisibility, GCD and Primes


1. Show that if a | 4n +3 and a | 2n +1, then a = 1.

2. If a | m and b | n, prove that ab | mn.

3. Does 6 | 11n imply that 6 | n ? Justify. Does 6 | 34n imply 6 | n? Justify.

4. If p is a prime, prove that (p, a) = 1 or (p, a) = p.

5. If a is a positive integer, what is (a, 2a)? What is (a, a2)?, (a, a + 1)?, and (a, a + 2)?

6. Show that the difference of two consecutive cubes is never divisible by 3.

7. Show that if (a, b) = 1, then (a + b, a - b) = 1 or 2.

8. Prove that square of an integer is either a multiple of 4 or one more than a multiple of
4.

9. Show that if a and b are positive integers and a3 | b2, then a | b.

10. Prove that 3, 7, 11 is the only set of three consecutive primes of the form p, p + 4, p +
8.

11. Prove that there are infinitely many primes of the form 4n + 3.

Well - Ordering Principle

1. Prove 2 is irrational using the well-ordering principle.

2. Prove 1+2+3+n = n(n+1)/2, using the well -ordering principle.

3 Prove directly from the well-ordering principle, that every integer greater than 1 has a
prime divisor.

4. Prove that the well-ordering principle implies the Archimedean Axiom: " if a and b are
positive integers, there exists an integer N such that aN b".

Extra

1. Show that no integer of the form 8n + 7 is the sum of three squares.


2. What is the last digit of 7 355.

3. What is the remainder when 314 164 is divided by 165? ( Watch out - 165 is not a
prime!).

4 What is the remainder when 2000 2001 is divided by 26?

5. If a | c and b | c and (a, b) = 1, prove that ab | c. Give an example to show that the
assumption (a, b) = 1 is needed.

6. Show that 1110 1 ( mod 100 ).


n
7. Prove that 1 + 1/2 + 1/4 +.+ 1/2 < 2.

25 years
1. Prove if ( a, b) = 1 and c | b, then (a, c) =1.

2. Prove if (a, c) = 1, then ( a, b) = (a, bc).

3. Prove if (a, b) = 1 and (a, c) = 1, then (a, bc) = 1.

4. Prove if a | c, b | c, and (a, b) = 1, then ab | c.

5. Prove or disprove:- If (a, b) = 1 and (b, c) = 1, then (a, c) =1.

6. Prove if a and b are relatively prime, then so are ak and bn, where k and n are positive

integers.

7. We know that if p is a prime and a is a positive number then a | p only if a = 1 or a = p.

What can you conclude about a, if a | pn.

8. Prove or disprove:- If (a, m) = 1 and a b ( mod m ), then (b, m) = 1.

9. In the following, p, p1, p2 are primes and a , b are positive integers.

We know that p | ab only if p | a or p | b.

Suppose a | p1.p2. What can you say about a ?

10. Prove if C is a complete residue system modulo m and (a, m) = 1, then the set

C1 = { ax + b | x C } is a complete residue system modulo m.


11. Prove if R is a reduced residue system modulo m and (a, m) = 1, then the set

R1 = { ax | x C } is a reduced residue system modulo m.

12. Write down a reduced residue system for mod 6, mod 7, mod 8, mod 10, mod 11,
mod 12,

mod 15 and mod 24.

13. How many positive integers are there that are less than or equal to, and

relatively prime to the following numbers:- 7, 8, 10, 29, 101.

14. How many positive integers are there that are less than or equal to, and

relatively prime to the following numbers:- 3.5, 5.11, 29.101.

15. How many positive integers are there that are less than or equal to, and

relatively prime to the following numbers:- 34, 53, 134, 101100.

16. How many positive integers are there that are less than or equal to, and

relatively prime to the following numbers:- 55, 45, 24, 100, 10000.

17. Write down a reduced recidue system modulo 2m, where m is a positive integer.

18. Find the remainder when 3100000 is divided by 35; when 131954 is divided by 60.