CH 3
CH 3
Congruences
3.1 CONGRUENCE
Carl E‘iedrich Gauss (1777—1855), the German mathematician, physicist, and as—
tronomer, was known as the Prince of Mathematicians to his contemporaries and is ‘
one of the greatest mathematicians of all times. His famous work on higher arith-
metic and number theory, called Disquz'sz'tiones Arithmeticae, was completed when
he was twenty—one and published in 1801. In this, among many other things, Gauss
introduced the notion of congruence, thereby offering a convenient way of dealing
with many questions of divisibility.
For example, 7 E 3 (mod 4), —6 E 14 (mod 10), 121 E 273 (mod 2), but
5 E 4 (mod 3) and 21 E 10 (mod 2). In Proposition 3.14, we show that two integers
are congruent modulo m if and only if they have the same remainders after division
by m.
The condition for a to be congruent to b modulo m is equivalent to the con—
dition that
a = b+km forsomekEZ.
Congruences occur in everyday life. The short hand of a clock indicates the
hour modulo 12, while the long hand indicates the minute modulo 60. For example,
20 hours after midnight, the clock indicates 8 o’clock because 20 E 8 (mod 12). In
determining which day of the week a particular date falls, we apply congruence
modulo 7. Two integers are congruent modulo 2 if and only if they have the same
parity; that is, if and only if they are both odd or both even.
The idea of congruence is not radically different from divisibility, but its use-
fulness lies in its notation, and the fact that congruence, with respect to a fixed
modulus, has many of the properties of ordinary equality. '
57
58 Chapter 3 Congruences
Proof. Since a E a’ and b E 19’ (mod m) we can write a = a’+km and b = b’+€m
where 16,8 E Z. It follows that
Ia+b = a’+b’+(k+.€)m
(1—!) = a’—b’+(k‘—€)m
ab = a'b/ + (kb’ + Ka’ + Mm)m.
The results now follow, since k: + E, k — 6, kb’ + Ea’ + Mm E Z. [1
Although we can add, subtract, and multiply congruences with respect to the
same modulus, we cannot with impunity divide out an integer from either side of
a congruence. For example, 6 E 36 (mod 10) but 1 E 6 (mod 10). HoWever, the
following proposition indicates under what conditions cancellation can occur.
Proposition 3.14. a E b (mod m) if and only ifa and b have the same
remainders When divided by m.
Proof. Divide a and b by m according to the Division Algorithm to obtain
We see from the above. proposition that any integer must be congruent to
precisely one of O, l, 2, . . . , m -— 1 modulo m.
2372236.2E(23)12-221.2E2 (mod 7)
and 237 has remainder 2 when divided by 7. D
Theorem 3.21.: A number is divisible by 9 if and only if the sum of its digits
is divisible by 9.
For example, consider the numbers 5895 and (“125942. The sums of their digits
are 5+8+9+5 = 27 and 1+2+5+9+4+2 = 23, respectively; since 27 is
divisible by 9 but 23 is not, it follows that 5895 is divisible by 9 but 125942 is not.
Proof. Let cc be a number with decimal digits CLTCLT._1 . . .a1a0 so that
Hence a: E 0 (mod 9) if and only if the sum of its digits is congruent to zero modulo
9. . El
Note that this not only provides a test for divisibility by 9, it also provides a ‘
method for finding the remainder of any number when divided by 9. For example,
125942El+2+5+9+4+2§2322+3§5 (mod9)
and hence 125942 has remainder 5 when divided by 9.
A similar proof also yields the following result for divisibility by 3.
Theorem 3.22. A number is divisible by 3 if and only if the sum of its digits
is divisible by 3. E] ‘
The result on the divisibility by 9 provides the basis for an ancient method
of checking arithmetical calculations called casting out nines. Suppose we wish to
check the calculation
The check proceeds as follows. For each number involved, add the digits together
and throw away any multiples of nine. Then perform the original calculation on
these remaining numbers. The calculation checks if this new answer agrees with
the original answer, after adding digits and casting out any multiples of nine. If
the answers do not agree after casting out nines, an error has occurred in the
calculation.
In the above example, we add the digits of 43296 to obtain 4 + 3 + 2 + 9 + 6
and, after casting out nines, we obtain the number 6. If we do this procedure to
the other numbers on the left side of the equation, we get the reduced equation
6x5—s
' Perform this simplified calculation to obtain 22 or, after casting out nines again, 4.
The sum of the digits of the original answer, after casting out nines, is also 4; hence
Section 3.3 Equivalence Relations 61
this provides a check on the calculation. It does not guarantee that the calculation
is correct; it only provides a partial check.
Let us take another example.
Proof. Let a: = aTIO’” —+— (1,410“1 + - - - + a110 + a0. Now 10 E —1 (mod 11) so
that
the
Of the above examples of relations, equals, both types of congruences, and
are not.
same surname and same day are equivalence relations, while the others
.
Proposition 3.11 shows that congruence modulo m is an equivalence relation
[a] = {m e s l mRa}.
are
This is called the equivalence class of a and consists of all elements in S that
equivalent to a. The element a is called a representative of the equivalence class
- [al-
In the equals relation, the equivalence class of an element consists of a alone.
Smith
In the relation has the same surname, the equivalence class containing John
consists of all the people with the surname Smith.
In the equivalence relation of congruence modulo m an equivalence class is
called a congruence class, or sometimes a residue class.
In the case of the congruence relation modulo 2
In fact, there are only two distinct congruence classes, namely the even integers
and the odd integers. We have [2r] ,= [0] and [2r + 1] = [1], so any even number is
a representative of [0], and any odd number is a representative of [1]. Furthermore,
notice that every integer lies in precisely one congruence class.
Section 3.3 Equivalence Relations 63
Therefore, in any equivalence relation, two equivalence classes are either iden—
tical or disjoint, and the set of equivalence classes under an equivalence relation R
yields a disjoint decomposition of the set S. A decomposition of a set S into such
a disjoint union of subsets is called a partition of S.
It follows from Proposition 3.14 that the congruence relation modulo m has
precisely m distinct congruence classes, namely [0], [l], [2], . . . , [m — 2], [m —- 1], one
corresponding to each remainder under division by m.
The partition of the integers into the m congruence classes modulo m can be ‘9
visualized as follows. Consider all the integers distance one apart on the number ‘ 1‘:
line, and consider a circle whose circumference has length m. If the number line “
were to be wrapped around this circle, all the integers in one congruence class would
fall on the same part of the circle.
-5 -4 —3 -2 -1 0 1 2 3 4 5
l I l I I
Notice that the modulus m is implicit in the notation [a]. Normally, this
will not cause confusion, since we usually deal with only one modulus at a time.
However, if we wish to cope with congruences of different moduli at the same time,
we could use the notation [a]m
The set Zm is the quotient set of Z defined by the congruence relation modulo
m, and
Zm = {l0l9l1l1H'7lm _ ll}
For example, Z4 = {[0], [1], [2], [3]}, where the four congruence classes are
[al+[bl = [a+bl
[a] - [bl = [05}
For example, in Z7, let A = [4] and B = [5] so that we would have A + B =
[4]+[5] = [4+5] = [9] = [2], since 9 a 2 (mod 7), andA-B = [4] - [5] = [20] = [6],"
since 20 E 6 (mod 7). However, these definitions are not as innocuous as they
might appear. For example, the congruence class A in Z7 could equally well be
written as [11], and B could be written as [19]. Our definitions would then imply
that
A+B = [11] + [19] l 0]
[\300
II
Our definitions would lead to trouble, unless [30]: [ ] and [209]: [20] in Z7. In
this particular example, it is true that 30:
— 9 (mod 7 and 209—= 20 (mod 7), but
v
In the case of Zm, a particular congruence class [a] can always be written
as [a’] if and only if a’ E a (mod m). Similarly, [b] can be written as [b’] if and
only if b’ E b (mod m). Addition and multiplication in Zm Will be well defined
if [at +13] = [a’ + b’] and [ab] = [a’b’]. However, Proposition 3.12 guarantees that
a+b E a’—|—b’ (mod m) and ab E a’b’ (mod m), and so the corresponding congruence
classes are equal. Hence addition and multiplication are well defined in Zm. This
is called modular arithmetic.
Example 3.41. Write the addition and multiplication tables for Z4 and Z5.
Solution.
Addition in Z; Multiplication in Z4
+ [0] ill [2i [3] - [0] [ll [2] i3]
[0] [0] [ll [2] [3] l0] [0] [Ol l0] [0]
[ll [ll [2] [3i [0] [ll [0] [ll [2] [3]
[2] [2] Bl [0] [1] l2] [0] [2] [0] [2]
[3] l3] [0] [ll [2] [3] [0] [3i [2l [ll
Addition in Z5 Multiplication in Z5
+ [0] [ll [2] [3] [4] - [Oi ill Di [3] l4]
[Oi [0] [ll [Zl l3] [4] i0] [0] [0] [0] [0i [0]
[ll [ll [2] l3] [4] i0] [1] [0] [ll [2i [3] [4]
i2] [2] [3] [4l [0] [ll [2l [0l [2] [4] [ll [3]
[3] [3i [4] [W U] M [3] [0] [3] ill [4] [2]
[4] l4] [0] [ll [2] [3] [4l [0] [4] M [2] [1] [I
By looking at the above tables, it is seen that addition of [0] leaves an element
unchanged, While multiplication by [0] always gives [0]. This can be proved true for
any modulus, because for all [a] 6 Zm
[0 + a] [d]
i n
a?
;+
EB
[0 - a] = [0].
Hence [0] in Zm acts just like the zero element of Z. Furthermore, [1] acts like the
unit element because
[2]-[3] = [1] in Z5
so that [2] has an inverse, and [2]‘1 = [3]. Division by [2] in Z5 is equivalent
to multiplication by [3]. In fact, in 25, every nonzero element has an inverse;
[l]‘1 = [1], [2]’1 = [3], [3]“1 = [2], and [4]‘1 = [4]. We would never expect zero
to have an inverse because zero times anything is always zero.
By looking at the multiplication table of Z4, we see that [1]‘1 = [1] and
[3]“1 2: [3], but [2] does not have an inverse. Hence division by [2]-is not always
possible in Z4.
We shall show in Corollary 3.44 that if p is prime, every nonzero element
of 2,, has an inverse. A set in which we can [perform the operations of addition,
subtraction, multiplication, and division by nonzero elements, and in which these
operations satisfy certain standard properties, is called a field. In fact, the set of
integers modulo p, 210, will form a finite field if and only if p is prime.
We shall now use the concept of congruence to prove the following important
]
V v,
w.
M
i theorem that was discovered by Fermat in 1640 and can, incidentally, be used to
‘1 show the existence of inverses in Zp. The French mathematician Pierre de Fermat
(1601—1665) actually made his living as a lawyer and member of the provincial par—
liament of Toulouse. However, he devoted most of his spare time to mathematics.
Fermat could be considered a founder of modern Number Theory. He stated many
results in Number Theory, including the one below. He did not usually provide
proofs of his results, because he communicated them in letters to other mathe-
maticians, rather than publishing them in a book or journal. However, nearly
all of his results have since been proven. Fermat is best known for his so—called
“Last Theorem.” This result was written in the margin of his copy of the work of
Diophantus, next to the solution of the Diophantine equation z2 + y2 = z2. Fermat
claimed that w" + y" = z” has no nonzero integer solutions if n > 2.’ He stated
that he had a truly marvelous proof that was too long to write in the margin. Over
350 years later, Fermat’s Last Theorem was finally proved by Andrew Wiles in
1994, using very advanced mathematics. Most mathematicians are sceptical that
Fermat really did have a valid proof. To avoid confusion with his Last Theorem,
the following result is usually called Fermat’s Little Theorem.
Section 3.4 Modular Arithmetic 67
By the definition of congruence, this implies pl(r — s)a and, by Theorem 2.53,
pl(r — 5). Hence 7‘ = 3.
Therefore, the congruence classes [0a], [1a], [2a], . . . , [(p —— 1)a] are all distinct.
But as Zp only contains p congruence classes, it follows that
Hence the nonzero classes [a], [2a], . . . , [(p — 1)a] must be a rearrangement of the
classes [1], [2], . . . , [p -— 1]. In particular, multiplying them together,
a-2a-3a---(p——1)a 1-2-3---(p—1)‘(m0dp).
(JD—DWI”1 (10-1)I (mod 29)-
However, p f (p — 1)! because the prime p does not divide any of the factors of
(p — 1)! Hence, by Proposition 3.13, we can cancel (p - 1)! and obtain
Proof. If p t a this follows from Fermat’s Little Theorem. If pla, both sides are
congruent to 0 modulo p. E]
Corollary 3.44. If [a] is any nonzero element of Zp, where p is prime, then
there exists an element [19] E Zp such that [a] - [b] = [1]; that is, every nonzero
element of Z, has an inverse.
Proof. If [a] 7A [0] in 2,, then 101L (1 and, by Fermat’s Little Theorem,
W = lap—2i. ' u
68 Chapter 3 Congruences
For example, in Z5, [2]‘1 = [23] = [8] = [3]. If p is large, however, Fermat’s
Theorem gives a rather cumbersome way of finding inverses, and it will be easier
to find the inverses by inspection or to use the methods of the next section. In
Z31, Fermat’s Theorem gives the inverse of [2] as [229]. However, we can see by _
inspection that
[Zl'llb‘l = [32] = [1] in Z31
and so [2]“1 = [16] and, incidentally, 229 E 16 (mod 31).
1.11“ .‘lllll?
1 ,1;
lllmlllll; lll 1‘ lll‘
[arm] = [c] m 2m
twill}: and the problem of finding an integer a: that satisfies the congruence is equivalent
to the problem of finding an equivalence class [:3] E Zm that satisfies the equation.
One crude method of solving any congruence modulo m (whether linear or
not) is to take one element from each congruence class, say 0,1,2, . . . ,m —— 1, and
test whether they satisfy the congruence. This method is very effective if m is
small, but soon becomes tedious for large m.
Modulo 4
x E O 1 2 3
2:0 E O 2 O 2
We see that 29: is never congruent to 1 modulo 4 and hence the equation has
no solution in Z4.
The nonexistence of a solution to [2] [:3] = [1] in Z4 expresses the fact that [2]
has no inverse in Z4. D
Proof. By the definition of congruence, the relation as: E 0 (mod m) holds if and
only if m|(c— ax) or, equivalently, if and only if my = c— act: for some y E Z. Hence
axo E 0 (mod m) if and only if there exists yo 6 Z such that amo + myo = c. . E]
am E c (mod m)
or, equivalently,
If :50 is one particular integer solution, then there exists an integer yo such
that are + myo = c and, by Theorem 2.31, the complete solution to a9: + my = c
is
Solution. Since gcd(63, 7) = 7, which does not divide 20, the congruence has no
solutions. E]
Section 3.5 Linear Congruences 71
Example 3.56. Find the inverse of [18] in Z31, and write it in the form
[r] E 231, where O _<_ 7“ < 31.
Solution. We have to find the equivalence class [3:] for which [18] [x] = [1] in Z31
or, equivalently, solve the congruence
1856 + 31y = 1.
Check. 20-7=140=3-44+8so20~728(mod44). D
‘ 72 Chapter 3 Congruences
Since the modulus is prime, it follows from Corollary 3.43 to Fermat’s The—
orem that 9:7 E :3 (mod 7) for all an E Z. Therefore, the congruence is equivalent
to
m3+2m2+m+420 (mod7).
Modulo7
x5 0 1 2 3 4 5 6
1:22 0 1 4 2 2 4 1
3:35 0 1 1 6 1 6 6
w3+2m2+m+42 4 1 1 3 6 2 4
We see from the above table that the congruence has no solution and therefore
the original integer polynomial is never divisible by 7. [:J
Section 3.6 The Chinese Remainder Theorem 73
a: E 2 (mod 9)
a: E 3 (mod 7).
or, equivalently,
=_ a: E 38 (mod 63).
)re - have a solution. Moreover, if a: = :50 is one integer solution, then the complete
solution is
Ct E 1:0 (mod mlmg).
74 Chapter 3 Congruences
Proof. The proof follows the previous Example 3.61, replacing the numbers by
arbitrary integer constants. It is seen that the only condition on these constants to
guarantee a solution is that the moduli are relatively prime.
The integer :2: satisfies the first congruence if and only if
a: = a1 + mly for some y E Z.
Since gcd(m1,m2) = 1, it follows from the Linear Congruence Theorem 3.54 that
this congruence always has a solution, say y = b, and that the complete solution
for y will then be
y = b+mzz forzEZ.
a: = a1 +m1(b+m22)
= (01 + mib) + mlmgz for z E Z.
"I ‘4' This is exactly one congruence class modulo mlmg. Hence, if a: = 330 is one solution,
l then a: E 12:0 (mod mlmg) is the complete solution. B
:5
Example 3.63.
‘.i
1
C; “
.l l
ml .
‘l
A small gear With 17 teeth is meshed into a large gear With 60 teeth. The
large gear starts rotating at one revolution per minute. How long Will it be before
the small gear is back to its original position and the large gear is one quarter of a
revolution past its initiallposition?
Solution. The gears are moving at the rate of one tooth per second. After :1:
seconds the smaller gear will be back to its initial position if as E 0 (mod 17), and
the larger gear will be one quarter of a revolution past its initial position whenever
m E 15 (mod 60).
Section 3.6 The Chinese Remainder Theorem 75
3; = 4+17z 'forZEZ
and
a: = 15+60(4+17z) = 15+60-4+60-17z.
The first positive solution occurs when z = O and the elapsed time is 4 minutes and
15 seconds. [1
a (mod m1)
III
8
0. (mod mg).
One of the implications in the above result is not true if gcd(m1, m2) 74$ 1; for
example, 12 E 0 (mod 4) and 12 E 0 (mod 6), but 12 E 0 (mod 24).
Example 3.65. Find the two smallest positive integers that have remainders
1, 2, and 6, when divided by 3, 5, and 7 respectively.
1 (mod 3)
“I
2 (mod 5)
III
6 (mod 7)
HI
Let us solve the first two of these congruences. The first implies that :1: =
1 + 3y, where y E Z and, substituting this in the second, we have 1 -I— 3y E 2 (mod
5). Hence 3y E 1 (mod 5), which has solution y E 2 (mod 5), or y = 2 + 52 for
z E Z. Therefore, the solution to the first two congruences is
us
have now reduced the three simultaneo
or, equivalently, :r E 7 (mod 15), and we e these two as
us congruences. We can now solv
congruences to two simultaneo
before. third
and when this is substituted into the
We have at = 7+ 152, where z E Z,
congruence m E 6 (mod 7) we obtain
or, equivalently,
cc E 97 (mod 105).
97 and 202.
two sma lles t pos itive integer s satisfying the congruences are
The
6 (mod 7). i D
Check. 97 E 1 (mod 3), 97 -=- 2 (mod 5) and 97 -=-
neous
previous example to solve n simulta
We can extend the method of the 7m to one
g two congruences modulo m,- and
congruences by repeatedly reducin
ult without further proof.
,‘. modulo mimj. We state the res
er Theorem 3.66.
Generalized Chinese Remaind = 1 if 73 # j. Then
itive integers such that gcd(m,-,mj)
Let m1,m2, . . . ,mn be pos
simultaneous congruences
for any integers a1, a2, . . . ,an the
t
l . m E a1 (mod m1)
at E (12 (mod mg)
a; E an (mod mn)
complete
if x = 9:0 is one solution, then the
always have a solution. Moreover,
.mn).
solution is a: E :00 (mod mlmg . .
x3 E 53 E 2 (mod 3)
0:3 E 53 E 3 (mod 5)
3:3 E 53 E 5 (mod 8).
Modulo 5 Modulo 8
a: E 0 1 2 3 4 cc E 0 l 2 3 4 5 6 7'
x3 E 0 1 3 2 4 9:3 E 0 O 3 O 5 O 7
From the above tables, we see that the only solutions to the second and third
congruences are a: E 2 (mod 5) and :2: E 5 (mod 8).
Use the Chinese Remainder Theorem to solve the simultaneous congruences
2 (mod 3)
2 (mod 5)
5 (mod 8).
By Proposition 3.64 the solution to the first two is a: E 2 (mod 15),. or a: = 2 + 15y,
where y E Z. Substituting this into the third congruence we have
2+15y E 5 (mod 8)
“y 3 (mod 8).
Check. 772 a 5929 a 49 (mod 120) and 773 E 77 - 49 E 3773 E 53 (mod 120). D
78 Chapter 3 Congruences
For example, 45(1) = 1, ¢(2) = 1, (M3) = 2 and gb(4) = 2. The only numbers
between 1 and 12 relatively prime to 12 are 1, 5, 7, and 11, so 45(12) 2 4. p is
prime, then all the numbers from 1 to p- 1 are relatively prime to p, so (15(1)) = p— 1.
Section 3.7 Euler-Fermat Theorem 79
Proof. The proof mimics that of Fermat’s Little Theorem 3.42, except that the
modulus in not prime now.
Let (31,132, . . . , b¢(m) be the positive integers less than or equal to m that are
relatively prime to m. If gcd(a,m) z 1 we shall first show that no two of the
numbers abl, a132, . . . ab¢(m) are congruent modulo m. Suppose that
Since gcd(a, m) = 1, it follows from PropOsition 3.13 that we can cancel a to obtain
b, E b, (mod m). Therefore, the congruence classes [abl], [abg], . . . , [ab¢(m)] are all
distinct modulo m.
By Theorem 2.53, ab,- and m have a common prime factor if and only if a
and m have a common prime factor, or b,- and m have a common prime factor.
Since gcd(a_,m) = 1 and gcd(b,-,m) = 1, all of the numbers abl, ab2,i‘=.,,ab¢(m)
are relatively prime to m. Hence the congruence classes [dbl], [c1132], . . . ,‘[ab¢(m)]
must be just a rearrangement of the classes [b1], [b2], . . . , [b¢(m)]. In particular,
multiplying them together, - ‘
(iii) ¢(m) = m (1— 1-01?) (1 —— 10%) (1 —— 31;), Where p1, p2,...,pk are the
distinct primes that divide m.
Proof (i) The numbers from 1 to pf that are relatively prime to p’" are the
numbers not divisible by p. Every pth number is divisible by p and there are gar—1
of these, so (15(307") = pr “‘ Pral z PPR]? “ 1) 2 PT (1 T in)
80 Chapter 3 Congruences
(iii) Let m = 1931119? - ~ ~19?“ be the factorization of m into powers of distinct primes
191,192, - - - ,Pk. By parts (i) and (ii),
Mm) = ¢(p?1)¢(p32)~-¢(pi’°)
= p1<1-—>ps<><1—.1.>
= mo-ao—a-o—a a
For example,
¢(594) = ¢(2-33-11)
= 2-33-n<1—%><1—a<1—s)
= 32.2-10
= 180.
The following corollary is the reason why the product '(p— 1) (q - 1) will appear
in the RSA cryptographic scheme 7.42.
Corollary 3.73. If p and q are distinct primes, and gcd(a, pg) 2 1, then
Proof. As ¢(pq) = (p — 1)(q —- 1), this follows from the previous two results. D
Section 3.7 Euler—Fermat Theorem 81
Example 3.74. Find the last two digits of (i) 123456 and (ii) 87654321.
Solution. (1') We have to calculate the remainders modulo 100. Now we know
(M100) = 65(2252) = 100 (1 —- %) (1 — %) = 40. Hence, if gcd(a, 100) = 1, the Euler-
Fermat Theorem 3.71 tells us (140 E 1 (mod 100). Therefore, 6140’“ E (mod 100),
for any positive integer 16. Hence we should look at the exponent of 123456, namely
456, modulo 40. Write the exponent as 456 = 11-40+16. Now 123 E 23 (mod 100)
and
since 2340 E 1 (mod 100) using the Euler-Fermat Theorem. By repeated squaring,
’—
‘x.
(11') In the case of 87654321, 8765 has a factor 5, so 8765 is not relatively prime
to 100. However we can use the Chinese Remainder Theorem after splitting the
modulus 100 into the relatively prime moduli 4 and 25. Calculate 87654321 modulo
4 and modulo 25.
Since 8765 E 1 (mod 4), we have 87654321 E 1 (mod 4).
Now 8765 E 15 (mod 25), and 87652 E 152 E 225 E 0 (mod 25). Hence
8765’“ E 0 (mod 25) for any k 2 2. In particular, 87654321 E 0 (mod 25).
By the Chinese Remainder Theorem 3.62 the congruence
Exercise Set 3
lo 4?
1. Which of the following integers are congruent modu
27—30. Construct addition and multiplication tables for each of the following sets
of integers modulo m and find, if possible, multiplicative inuerses of each of the
elements in the set.
27. Z2 28. Z3
29. Z7 30. Zg
31. If at = gcd(a,m) and d]c, then ShOW that the congruence am E c (mod m) is
equivalent to
a c m
45-47. Solve the following equations in the given set of integers modulo m.
[18] in Z19
55. Determine the two smallest positive integer solutions of the two simultaneous
congruences :3 E 5 (mod 7) and m E 24 (mod 25).
'2
84 Chapter 3 Congruences
Problem Set 3
56. If p is a prime, prove that x2 E y2 (mod p) if and only if m E iy (mod p).
57. If p is an odd prime, show that m2 E a (mod p) has a solution for exactly half
the values of a between 1 and p — 1 inclusive. Furthermore, if 1 g a. S p — 1
and x2 E a(mod p) has a solution, show that it has exactly two congruence
classes of solutions modulo p.
58. Does .153 E a (mod p) always have a solution for every value of a, whenever p
is prime?
59. Choose any integer larger than 10, subtract the sum of its digits from it, cross
out one nonzero digit from the result, and let the sum of the remaining digits
be 8. From a knowledge of 5 alone, is it possible to find the digit that was
crossed out?
60. Prove that 21I(3’I’L7 + 777.3 + lln) for all integers n.
61. Prove that n91 E n7 (mod 91) for all integers 77.. Is n91 E P (mod 91) for all
integers n? .
62. For which positive values of k is n" E n(mod 6) for all integers n?
63. For which positive values of k is nk E n(mod 4) for all integers n?
64. For which positive values of k is n)“ E n(mod 7) for all integers n?
65. Prove, without using a calculator or computer, that 641 divides the Fermat
number F(5) = 22 + 1.
66. Show that the product of two numbers of the form 4n + 1 is still of that form.
Hence show that there are infinitely many primes of the form 4n + 3.
67. Define a relation on the set of real numbers by
(c) Two real numbers are equivalent if and only if they represent the same
angle in radians. The equivalence classes therefore consist of the different
angles. Denote the equivalence class containing a by [a].
Show that addition of angles is well defined by
[a] + [b] = [a + b].
68. (a) Find a relation R, on a set S, that is symmetric and transitive, but not
reflexive.
(b) If there is an example to part (a), the following “proof,” that every
symmetric and transitive relation is reflexive, must be fallacious. Find
the error. “Let R be a symmetric and transitive relation on the set S.
For any a,b E S, aRb implies that bRa, because R is symmetric. But
aRb and bRa imply that aRa, because R is transitive. Since aRa, R
must also be reflexive.”
69. If m = pq is a composite number, where 1 < p S q < m, show that Zm is not
a field by showing that division by nonzero elements is not always possible in
Zm.
70. Solve the following system of simultaneous equations in Z12.
E
E
E
E
[2]
l
+
l5]
+
I
E
or, equivalently,
The check digit can be any one of the digits 0, 1, 2,. . . ,9 or X, where X stands for
the number 10.
77. If ¢(m) is the Euler gb—function, show that ¢(m) = ¢(2m) if and only if m is
odd.
78. Prove that 45(m) = m — 1 if and only if m is prime.
79. (Wilson’s Theorem) If p is prime, prove that
80. If p and q are integers, not divisible by 3 or 5, prove that p4 E Q4 (mod 15).
81. Solve the simultaneous congruences
9w 21 (mod 6)
HI
4:0 9 (mod 13).
Ill
82. Solve the simultaneous congruences
III III
8x 3 (mod 9). ”w"..-
83. Two watches, one of which gains 2 minutes per day and the other of which
loses 3 minutes per day, read the correct time. When will both watches next
give the same time? When will they next both give the correct time?
84. Solve m3 E 17 (mod 99).
85. Solve :32 E (mod 99).
86. If gcd(m, n) = d, when do the simultaneous congruences
.‘L' a (mod m)
III I”
ac b (mod n)
have a solution?
87. Let M = mlmg . . .mn, where gcd(m,~, mj) = 1 Whenever 2' 74 j, and let
M,- = M/mi. Let y E b, (mod m,) be a solution to MW E 1 (mod mi). Prove
that the simultaneous congruences
a: E a1 (mod m1)
:3 E (12 (mod m2)
:3 E an (mod mn)
100:0 — 9y 2 4264
H
113: + 1093,] 909
(a) modulo 9
(b) modulo 11
(c) in integers, using (a) and (b), given the fact that a: and y have unique
solutions and both are positive integers less than 100.
89. A basket contains a number of eggs and, When-the eggs are removed 2, 3, 4, 5,
and 6 at a time, there are 1, 2, 3, 4, and 5, respectively, left over. When the
eggs are removed 7 at a time, there are none left over. Assuming none of the
eggs broke during the preceding operations, determine the minimum number
of eggs there were in the basket.
90. Use Problem 87 to solve each of these three simultaneous congruences.
’s.
(a) a: E 2(mod 7), a: E 5(mod 11), a: E 11(mod 17)
(b) :17 E 0(mod 7), at E 8(mod ll), ‘9: E 10(m0d 17)
(c) a: E 5(mod 7), m E 6(mod 11), a: E 14(mod 17)
a E b (mod m1)
at E b (mod mg)
a ,.'—f b (mod m1m2).
94. Find all the integer solutions to the Diophantine equation 51162 + m + 6 2 73g.
95. (a) Prove that if p and q are relatively prime and a: is an integer such that
:9 (mod 9!)
III
q (mod :0).
III
(mod p)
97. If p is prime and k: is the smallest positive integer such that ak E
then prove that k divides p — 1.
98. Find the remainder When 1740 is divided by 27.
99. Find the remainder When 5183 is divided by 99.
100. Find the remainder when 22405 is divided by 23.