138 HIGHER ALGEBRA
Congruence.
Karl Friedrich Gauss (1777-1855), å celebrated German mathematji.
cian, introduced the concept of congruence which laid the foundation of
modern theory of numbers.
Definition. Let m be a fixed positive integer. Two integers a and b
are said to be congruent modulo m if a-bis divisible by m. symbolically
this is expressed as a = b(mod n).
To illustrate, let m =J. It is easy to verify that
l=4(mod 3),-2 = 1(mod 3),6 = 0(mod 3),35 = 2 (mod 3).
When a - b is not divisible by m, a is said to be incongruent to b
modulo m. It is expressed as a # b(mod m).
For example, 1 5(mod 3),-2 2(mod 3).
Note. When m=1, every two integers are congruent modulo m and
this case is not so useful and interesting. Therefore m is usually taken
to be a positive integer greater than 1.
Theorem 3.4.1. For any two integers a and b,a = bmod m) if and
only if a and b leave the same remainder when divided by m.
Proof. Let r be the remainder when a is divided by m. Then there
exists some integer q such that a = qm +r,0 <r<m.
Since a = b(mod m),a - b= km where k is an integer.
Therefore b =a- km (gm + r) - kn
(g - k)mn +r
and this shows that b leaves the same remainder r.
Conversely, let r be the same remainder when a and b are divided by m.
Then a = 1m+r, b= g2m+r, where q1, 42 are integers and 0 <T< m.
Therefore (a- b) = (g1 - ge)m, i.e., m | -b and this proves that
a= b(mod m). O
To illustrate, let m = 5. Since 21 = 4.5 +1 and -14 = -3.5 +1,
21 and -14 leave the same remainder upon division by 5. Therefore
21 =-14(mod 5).
Properties.
1. a= a(mod m).
2.If a= b(mod m) then b a(mod m).
3. If a b(mod m),b = c(mod m) then a = c (mod m).
INTEGERS 139
A If a= b (mod m) then for any integer c
a+c
=b+c (mod m)
= bc (mod m).
5. If a=b (mod m) and c =d(mod m) then
a +c = b+ d (mod m)
(LC = bd (mod m).
6. If a=b(1nod m) and dlm, d> 0, then a = b(mod d).
Proofs of properties 1 - 4 and 6 are immediate.
Proof. 5. a =b (mod m)’a-b= km and
c=d(mod m)+c-d= lm, where k, l are integers.
(a +c) - (b+ d) = (k+ l)m.
Therefore a +c=b+ d (mod m) since k + lis an integer.
By property 4,
a=b(mod m)’ ac = be (mod m) and
c=d(mod m)’ bc =bd (mod m).
Thereforea =b(mod m) and c=d (mod m)> ac= bd (mod m).
Definition. If a = b(mod m) then bis said to be a residue of a
modulo m.
By division algorithm there exist integers g and r satisfying a =
qm +r with 0<r< nm - 1.
Since a-r= qm, a=r (mod m) and this shows that r is a residue of
a modulo m. r is said to be the least non-negative residue of a modulo
Tm.
Let a be an arbitrary integer. Upon division by m, a leaves one and
only once of the integers 0, 1,2,... , m- 1as the remainder.
Therefore whatever the integer a may be, the least non-negative
residue of a is one and only one of 0, 1,2,... ,m -1.
The whole set of integers is divided into m distinct and disjoint sub
sets, called the residue classes modulo m, denoted by 0, 1,2,.,m - 1
and defined by
0= {0, m, 12m, . .}
l= {1,1t m, 1 ± 2rn, . . .}
2 = {2,2tm, 2± 2rn,..}
m-I=(n - 1, (n - 1)# m, (m - 1) ± 2rn,...}.
140 HIGHER ALGEBRA
Any two integers in a residue class are congruent modulo m and any
two integers belonging to two different residue classes are incongruent
modulo m.
Theorem 3.4.2. If a = b(mod m) then a" = b (mod m) for all
positive integers n.
Proof. We use the principle of induction toprove the theorem.
The theorem is true for n=1.
Let us assume that the theorem is true for some positive integer k.
Then a =b (mod m).
Now a = B(mod m) and a =b(mod m) together imply that
a.a= b.b(mod m), i.e., a+l = b+1(mod m).
This shows that the thoerem is true for the positive integer k+1if
we assume it to be true for k.
By the principle of induction, the theorem is true for all positive
integers n. O
Note. The converse of the theorem fails to hold.
a= b(mod m) does not necessarily imply a = b(mod m).
For example, 9² = 7( mod 8) but 9 7( mod 8)
4 = 78( mod 9) but 4 7( mod 9).
Fheoremn 3.4.3. If az = ay( mod m) and a is prime to m then
T= y(mod m).
Proof. at ay = krn, where k is an integer
Since z -y is an integer, a | km. Since a is prime to m and a | km,
it follows that a | k. Therefore k = aq where q is an integer.
Hence z-y= mand this proves the theorem.
Note. ar = ay(mod m) does not necessarily imply z=y(mod m).
For example, 3.2 = 3.4(mod 6) does not imply 2 = 4(mod 6).
We can cancel the common factor a freely from both sides of the
congruence (mod m) provided a is prime to m.
3. - 2=2(mod 8), 3.14 = 2(mod 8).
Cancelling the factor 3 which is prime to 8 we get the correct con
gruence -2= 14(mod 8).
Cancellation is allowed however, in some restricted sense which is
provided in the following theorem.
INTEGERS 141
heorenm 3.4.4. If d= gcd(a, m) then ar = ay(mod m) z=y
(mod ).
Pof. We have at ay = qm where q is an integer.
Since gcd(a, m) = d, a= dr and m= ds where r and sare integers
prime to each other.
Therefore drr - dry = qds or, T -y = 2,
Since z - y is an integer, r | qs. r is prime to s and r | gs implies
rq, i.e., is an integer k.
Therefore z - y = ks and this says z =y(mod ).
Conversely, a =y (mod )’|(-y) ’m\ d(z-y) ’
ma(- y)’ ar E ay (mod m).
Corollary. If az = ay(mod m) and a m then z =y (mod n).
For example, 4.7 =4.10 (mod 6). Cancellation of 4 from both sides
does not give a correct congruence because 4 is not prime to 6. Since
gcd(4, 6)=2, we get the correct congruence 7=10 (mod ).
Again, 4.7 =4.10(mod 12). Since 4|12, we get the correct congru
ence 7 = 10 (mod 3) from the corollary.
Theorem 3.4.5. T =y(mod m;), for i = 1,2,...,r =y (mod
m), where m = nm1, m2,... ,m), the l.c.m. of mË,m2,.., mp:
Proof. z =y (mod m;) ’ mi | (-y), for i=1,2,... ,T
’ - y is a common multiple of m1, m2,... ,mr
’ [m1, mg,...,m,|(-y)
’I=y (mod m).
Conversely, z =y (mod m) ’ m|(-y)
’ mjm2... m ( -y)
’ mi ( -y), for i =1,2,...,r
’T=y (mod m;), for i =1,2....,r.
Corollary. If z = y(mod m1), =y (mod m2) and mË, mg are
relatively prime then z =y(mod mjma).
Theorem 3.4.6. Let f(c) = anc" + an-1r"+.+ aj + ao be a
polynomial with integral coefficients aj.
Ifa=b (mod m) then f(a) = f(6) (mod m).
Proof. Since a = b (mod m), a = b* (mod m) where k is a positive
Iteger. Therefore a,ak = a,b (mod m), where aj is an integer.
Adding these congruences fori=0,1,2,... ,n, we have
aot aju+ aga² + +ana" = a0 + ajbt uzb'+ +a,b"(mod m)
Or, f(a)=f(b) (mod m). O
142 HIGHER ALGEBRA
3.4.7. Divisibility tests.
1. Let n= am 10m+ am-i 10m=l4+ag 10 +a110+ aowhere a are
integers and 0 < a <9,k = 0, 1,...,mbe the decimal representation
of a positive integer n.
Let S = d0 + a1t t am,T = do - a1++ (-1"am. Then
(i) n is divisible by 2 if and only if ao is divisible by 2;
(ii) n is divisible by 9 if and only if S is divisible by 9;
(iiüi) n is divisible by 11 if and only if T is divisible by 11.
Proof. Let us consider the polynomial
j(æ) = amT" + am-12"-+ t ajz + do.
() We have 10 =0(mod 2).
Therefore f(10) = f(0)(mod 2).
But f(10) = n and f(0) = 00
Therefore n - do is divisible by 2.
Hence n is divisible by 2 if and only if ao is divisible by 2.
(ii) We have 10 = 1(mod 9).
Therefore f(10) = f(1)(mod 9).
But f(10) = n and f(1) =S.
Therefore n = S(mnod 9).
This proves that N-Sis divisible by 9.
Hence nis divisible by 9 if and only if S is divisible by 9.
(ii) We have 10 =-1(mod 11).
Therefore f(10) = f(-1)(mod 11).
But f(10) =n and f(-1) =T.
Therefore n= T(mod 11).
This proves that n-T is divisible by 11. divisible by 11.
Hence n is divisible by 11 if and only if T is
the sum of the digits
For example, 35078571 is divisible by 9 since
3+5+0+7+8+5+7+1(=36) is divisible by 9.
It is also divisible by 11 because the sum
1-7+5-8+7-0+5-3(=0) is divisible by 11.
integer ao in the units
The number 23572 is divisible by 2, since the
by 9, since the sum
place is 2which is divisible by 2. It is not divisible
divisible by 11,
2+3+5+7+ 2(= 19) is not divisible by 9. It is not
by 11.
since the sum 2-7+5-3+ 2(=-1) is not divisible
2. Let n= am(1000)" +an-i(1000)m- +.+ a1(1000) + ao where
representation
ak are integers and 0 < ak < 999, k=0,1,... , mbe the
INTEGERS 143
of a positive integer n.
Let T = l0 - a1 +a2-+(-1)" a,n. Then
i) 2 is divisible by 7 if and only if T is
divisible by 7,
(i) n is divisible by 13 if and only if T is
divisible by 13,
(iii) n is divisible by 11 if and only ifT is divisible by 11.
Proof. Let us consider the polynomial
f(¢) = amI" + am-1"4 + ajT + do.
(i) We have 1000 =-1(mod 7) since 1001
=7.11.13.
Therefore f(1000) = f(-1)(mod 7).
But f(1000) =n and f(-1) =T.
Therefore n = T(mod 7).
This implies n -T is divisible by 7.
Hence n is divisible by 7 if and only if T is divisible by 7.
(ii) and (ii) Similar proofs.
To illustrate, let us consider the number n = 23146123. n can-be
expressed as 23(1000)² + 146(1000) + 123.
n is divisible by 7 because the sum 123 146 + 23 0 is divisible
by 7.
The same argument proves that n is also divisible by 13 and 11.
Worked Examples.
Find the least positive residues in 33 (mod 77).
34 =4( mod 77)
Therefore 312 = 4(mnod 77) = -13( mod 77).
This gives 324 169( mod 77) = 15( mod 77)
Therefore 336 15. - 13( mod 77)=36( mod 77).
Hence the least positive residue is 36.
Z. Use the theory of congruences to prove that 7| 20+3 + 5n+3 for
all n > 1.
23n+3 +52n+3 8.32T + 125.25".
32" - 25 = 0(mod 7) for all n > 1.
Therefore 8.32 - 8.25 = 0 (mÍd 7) for all n > 1.
Also we have 133(25)" =0(mod 7) for all n >1.
Therefore 8.32r + 125.25=0 (mod 7) for all n > 1.
This implies 7| 25n+3 +52n+3 for all n >1.
144 HIGHER ALGEBRA
3. Prove that 1920 = 1(mod 181).
We have 19? =-1( mod 181), whence
1920
(-1)1°( mod 181), by theorem 3.4.2
or, 1920 1( mod 181).
4. Prove that 3.4n+l = 3(mod 9) for all positive integers n.
3.4n+1 12.4" = 9.4 +3.4
3.4n 12.4"-1 =9.4n-1 +3.4"-1
3.42 12.4 = 9.4 + 3.4
3.4 =
12 = 9 +3.
Therefore 3.4n+1 = 9(1 +4+4 ++4") +3.
Hence 3.4n+ = 3(mod 9).
5. Find the remainder when 1! +2!+3! +.+ 50! is divided by 15.
5! = 0(mod 15) and for any positive integer n, (5 +n)! = 0(mod 15).
Therefore 1!+ 2! +3! + +50! = (1! + 2! + 3! + 4!) (mod 15).
Now 1! +2! +3! +4! =33 = 15.2 +3.
This shows that 33 = 3(mod 15) and therefore
1!+ 2!+ 3!+ + 50! = 3(mod 15).
34.8. Linear congruence.
Let f(z) = doz + a j z - t +an (n > 1) be a polynomial with
integer coeficients ao, a1,...an with ao 0( mod m). Then f(z) =0(
mod m) is said tobe a polynomial congruence (mod m) of degree n.
If there exists an integer To such that f(o) = 0( mod m), then to
is said to be a solution of the congruence.
By earlier theorems, if zË be any integer satisfying z1 = To (mod
m), then we also have f(1) =0( mod m), showing that zË is another
solution of the congruence.
Thus if one solution be found then infinitely many solutions can be
obtained, but all these solutions belong to the same To-residue class
modulo m and they are not counted as different solutions.
Two solutions z1, T2 of f(z) = 0( mod m) are said to be distinct
solutions if z1 # 2( mod m).
Therefore, by the nun:ber of solutions of a congruence ( mod m) we
mean the number of solutions incongruent in pairs.
For example, let us consider the congruence r= 1( nod 8). z=1
is a solution of the congruence and all solutions congruent to 1(mod
INTEGERS 145
S). ie.. r=1+8k, k being an integer are solutions of the
congruence.
3is a solution of the
congruence and all solutions congruent
to 3( mod 8), i.e., T = 3+ 8k, k being an integer are solutions of the
congruence.
Similarly, z = 5, =7 are solutions of the congruence.
These four solutions of the congruence are distinct, because no
two
of the solutions are congruent modulo 8.
There cannot be more than m distinct solutions of the
congruence,
since there are only m different residue classes. If m is small it is an
easy iob to find all the distinct solutions by direct
T=2, ... , T = m- 1.
substitution z = 1,
There are many points of diference between a polynomial congru
ence modulo a positive integer m >land the polynomial equation over
the field of complex numbers.
A congruence may have no solution. For example, the congruence
z'= 3( mod 5) has no solution which can be established by directly
verifying that none of z= 0, = 1, z = 2, = 3, z =4 satisfies the
congruence. In contrast, a polynomial equation has always a solution.
A congruence may have more distinct solutions than its degree. For
example, the congruence c' = 1( mod 8) has four distinct solutions
I=1,t = 3, z =5, =7. In contrast, a polynomial equation of degree
m over the complex field has exactly m solutions.
There is an explicit method of solving a congruence of any degree
modulo a positive integer m > 1. [just by substitution of each of the
integers 1,2,... ,m - 1, in turn.] But there is no such explicit method
for solving a polynomial equation of degree greater than 4.
Definition.
A polynomial congruence of degree 1 is said to be a linear congru
ence. The general form of a linear congruence modulo a positive integer
m> lis az = b( mod m), where a 0( mod m ).
An integer c is said to be a solution of the linear congruence ar = b(
mod m) if ac= b( mod m).
Theorem 3.4.9. If z1 be a solution of the linear congruence ar = b
(mod m) and if o = o1( mod m), then T is also a solution of the
Congruence.
Proof. a1 is a solution ’ az1 = b( mod m).
146 HIGHER ALGEBRA
a2 = I1 (inod m) ’ atg = ad; (mod m)
’ a.r2 =b(mod m)
’ 2 is a solution of the congruence ax =b(inod m).
Note. If a; be a solution of the congruence at = b( od m) tlhen
I t Am is also a solution for A = 0, ±1, +2,. ... All these solutions
Ieong to oue residue class nodulo n and these are not counted as
different solutions.
Aheorem 3.4.10. If gcd(a, m) =1, the1 the limear congruence a:T =
b{inod m) has a unique solution.
Proof. Since gcd(a, m) = 1,there exist integers u, vsuch that eu +n
1. Therefore a(bu) + m(bu) = b. This gives a(bn:) = b(mod m).
This slows that x = bu is a solution of the congruence (1T = b(mod
m).
Let a1,,be solutions of the.congruence uu = b (nod m).
Then ax =b(mod m) and aaz =b (mod n).
This implies axj = ax; (mod m) ’ j = a2 (mod m), since
gedla, m) = 1.
This proves that the congruence has a unique solution.
Note. The solutions are = bu + Am, where A = 0, ±1, +2,... aud
they all belong to one and only one residue class nodulo m.
Theorem 3.4.11. Ifged(a, m) = d, then the linear congrnence ar =
b(mod n) has no solution if d is not a divisor of b.
If d be divisor of b, then the linear congrnence ux =b(nod m) has
d incongruent solutions (mod m).
Proof. Let ax = b(mod n) has a solution t = u. Then uu =b (mod
m) and this implies m | ( - au).
d|n ’ d| (b- au). d | a and d| (b- u) >dis a divisor of b.
ContrapOsitively, d is not a divisor of bimplies ax = bnod m) has no
solution.
Second part. d|b. For an integer u, au = b (mod m) lholds if and
only if 4u= ( mod "), by Theorem 3.4.4.
yed(4, 4) = land therefore the cougruence u = (nod ) has
just one solution u = I1( mod ) .
Iuother words, the solution of the congruence u= (mod ) are
the integers u = r; (mod ), i.e., u =#| +4t, t=0, tl, £2,...
If t assnes the values 0, 1,2,... ,d- J, then u aSsumes d values
INTEGERS 147
... ()
We now show that the integers in the list (i) are incongruent modulo
e) while each of all other solutions (corresponding to the values of t
other than 00.1,...,d- 1) is congruent to some one of the integers inm
().
21 + t1 1 + t> (mod m), where 0 < ty <t < d- l gives
; t (mod m)
gcd(, m) = | ’ tË =t (mod d) ’ d| t - t,
This is an impossibility, because 0< t - ti < d.
Thus all solutions in the list (i) are incongruent modulo n.
Let any other solution be zj t
+ ,where t, is an integer other than
0,1,...,d- 1.
By Divison algorithm we can write t; = qd tr, where q and r are
integers and 0 < r<d- 1.
Then Ti +t; T1 + (qd +r) =I1 +r mod m).
Since 0<r<d- 1, t1 + t; is one of the solutions listed in (i).
Thus the congruence as = b (mod m) has d incongruent solutions
listed in ()
This completes the proof.
Note. The solutions belong to a single residue class modulo n
and this is the union of d distinct residue classes modulo m. The
residue class i modulo is the union of d distinct residue classes
i,i+,i+ , (d-1)m nodulo m.
For exanmple, the residue class 1 modulo 5 is the union of the three
distinct residue classes 1,6, I1 modulo 15.
Worked Examples.
VSolve the linear congruence 5x =3(mod 11).
ged(5, 11) = 1. Hence the congruence has a unique solution.
Since ged(5,11) = 1, there exist integers u, vsuch that 5u + 11v = 1.
Here u= -2,v = 1. Therefore 5.(-2) + 11.l = 1 and this implies
5.(-2) = 1 (nod 11), Therefore 5.(-6) =3 (mod 11).
Hence z= -6 is a solution.
Allsolutions are z =-6 (mod 11),i.e., =5 (mod 11).
All the solutions are congruent to 5 (mod 1l) and therefore the given
Cogruence has a unique solution.
148 HIGHER ALGEBRA
Solve the linear cougruence 15æ = 9 (mod 18).
gcd(15, l8) = 3and 3 | 9. Therefore the given congruence has a
solution. The given congruence is equivalent to 5: =3 (mod 6).
gcd(5, 6) =1. Hence the congruenue 5z = 3(mod 6) has a unique
solution.
Since gcd(5,6) = 1, there exist integers u, vsuch that 5u + 6v=1.
Here u = -1.v =1. Therefore 5.(-1) + 6.1 = 1 and this implies
5.(-1) = l(mod 6). Therefore 5.(-3) =3 (nod 6). Hence = -3 is a
solution of the congruence 5r =3 (mod 6).
There are three incongruent solutions of the given congruence. They
are z = -3, -3 +6, -3 + 12 modulo 18, i.e., = -3,3, 9(mod 18).
System of linear congruences.
Let us consider the linear congruences
ajI =bË (mod mi), ag0= b2 (mod m2), .*, a,T =b, (nod m,)
and let us enquire if it be possible to have a simultaneous solution of
the congruences. In that case each individual congruence must have a
solution.
Let gcd(a;, mi) = d, for i = 1,2,....r. Then d, must be a divisor of
b, for each i.
Cancelling d, fromn the ith equation, the system reduces to
af z =b, (nod n ), aga = b, (nod m,), , a,z =b, (mod m).
where d,a, =a;, d,b, = bi, .., d;m, = n, and ged(a, m) = 1for
i= 1,2,...,1.
Each individual congruence has a unique solution of the form z; =C;
(mod m; ).
Thus the problem is reduced toone of finding a common solution of
the system
= C1 (nod m1), z= C2 (mod m2), , = C, (mod n, ).
The kind of problems that can be reduced to a systenn of lincar
COngruences was found in Chinese literature as early as first century
A.D.In later periods such problems were also found in other countries.
Because of their antiquity, this type of problem goes by the nanne of
"Chinese remainder theorem".
The method of congruence that is used to state the problemad to
make the proof in a concise form was unk1nown to the ancients.
INTEGERS 149
Theorem 3.4.12. (Chinese remainder theorem)
Let my,mn2,
. m , be positive integers such that gcd(m,, m;) = 1
for i and ci, C2,,Cr be any integers. Then the system of linear
(ongTuences
r a(mod m1), a=C2 (mod ma), ·*, T = C, (mod m,),
has a simultaneous solution which is unique modulo 1m2...mp. i.e., if
be a solution then t= 0 + k(mjm2...m,) is also a solution, where
k is an integer.
Proof. Let m= mm2...m,. Let M7 = ,k=1,2, ..,r
Then gcd Mk, mk) =1fork=1,2,...,.
This implies that the linear congruence M7a = 1 (mod ma) has a
unique solution modulo mk. Let tk be the solution.
Then Ma = 1 (mod ma) and clearly, M7zk = 0 (mod m;) for j k.
Therefore c; MkJk = Ck (mod ma) and ckM7a; =0(mod mj) for j k.
Let us consider the integer zo = C1 MËz1 + czMzTy+ t CrM,2,.
Z =C (mod m1), since c Mi = i (mod mi) and M;s; = 0
(mod n;)for i 1. Similarly, zo= (mod m¡) for k =2,.., T.
This shows that Co is a solution of the given system of congruences.
Let a' be any solution of the system of congruences.
Then a' =Ck (mod ma) for k=1,2,.., r.
d=c* (mod m) and zo = C& (mod ma) ’t= o (mod ma) for
k=1,2,. , r.
Consequently, ' = TO (mod mËmg.m,r) Theorem 3.4.5 |
This shows that the solution of the system is unique modulo
mËm2...Mo.
Note. In the Chinese remainder theorem, the hypothesis that
m1, m2, ., m,, should be pairwise relatively prime is essential. If this
condition be not satisfied there may not exist a solution of the system
of congruences.
For example,the simultaneous congruences a = 1(mod 4) and a =3
(nod 8) has no solution, while the systemn =3 (mod 10) and a = 8
(mod 15) has the unique solution z = 23 (mod 30).
Worked Examples (continued).
8 Solve the systen of linear congruences
I=1(mod 3), z = 2 (1nod 5), z =3 (mod 7).
3, 5 and 7 are pairwise prime to each other. Let m = 3.5.7 = 105.
150 RIGHER ALGEBRA
Let MË = 35, M¡ = =21, M3 = =15.
Then god(M;.3) = 1,gcd( Mz, 5) = l,ged(M3, 7) = 1.
godË35, 3) = 1. Therefore the linear congruence 35x = 1(mod 3)
has a unique solution and the solution is =2 (mod 3).
god(21,5) = 1. Therefore the linear congruence 21t = 1(mod 5)
has aunique solution and the solution is z =l (mod 5).
god( 15. 7) =1. Therefore the linear congruence l5 = 1 (mod 7)
has a unique solution and the solution is z l (mod 7).
To = 1.(35.2) + 2.(21.1) + 3.(15.1) = 157 is a solution.
The solution of the given system is & 157 (mod 105), which is
equivalent to r = 52 (mcd 105).
A. Find four consecutive integers divisible by 3,4.5,7 respectively.
Let n, n+ 1,n + 2,n +3 be four consecutive integers divisible by
3,4,5,7 respectively. Then n=0 (mod 3),n +1=0 (mod 4), n +2=0
(mod 5), n+3=0(mod 7).
We are to solve simultaneous linear congruences n = 0(mod 3),
n =3 (mod 4), n=3 (mod 5), n =4 (mod 7).
3, 4, 5 and 7 are pairwise prime to each other. Let m =3.4.5.7.
Let M1 =" =140, M, = = 105, M3 = = 84, M4 = =60.
Since gcd(3, M1) = gcd(3, 140) = 1, the linear congruence 140z =1
(mod 3) has a unique solution (mod 3) and the solution is z = 2.
Since gcd(4, M2) = gcd(4, 105) = 1, the linear congruence 105z = 1
(mod 4) has a unique solution (mod 4) and the solution is z =1.
Since gcd(5, M3) = gcd(5, 84) = 1, the linear congruence 84x =1
(nod 5) has a unique solution (mod 5) and the solution is z = 4.
Since gcd(7, M4) = gcd(7, 60) = 1, the linear congruence 60t =1
(mod 7) has a unique soiution (mod 7) and the solution is r = 2.
Therefore zo = 0.140.2+3.105.1+3.84.4+4.60.2 = 315+1008+480 =
1803 is a solution and the solution is unique modulo 420.
To = 123 (mod 420). Therefore the consecutive integers are n, n +
l,n + 2, n+3, where n = 123 +420t, t = 0,t1, 2,...
Chi
8. Solve the linear conguence 32x = 79 (mod 1225) by applying
nese renmainder theoren.
1225 = 5'.7 and gcd(5, 7)= 1. The given problen1 is=equivalent
79 (mod
to finding a simultaneous solution of the congruences 32x
25) and 32z = 79 (mod 49), since a =b(nod m) and a = b(mod
mg)e a =b (nod (my, m2l).
INTEGERS 151
32r =79 (mod 25) is equivalent to 7r =4(mod 25).
gcd(7. 25)=1. We have 7.(-7) +25.2 = 1. Therefore 7.(-7) = 1
(mod 25) and therefore 7.(-28) =4 (mod 25). This shows that 7z = 4
(nod 25) is equivalent to z = -28 (mod 25), i.e., a = 22 (mod 25).
32r = 79 (mod 49) is equivalent to 32z = 30 (mod 49) which is
again equivalent to 16 = l5 (mod 49).
ged(16, 49) = 1. We have 16.(-3) +49.1 = 1. Therefore 16.(-3) =1
(mod 49) and therefore 16.(-45) = 15 (mod 49). This shows that
16:z = 15 (nod 49) is equivalent to z = -45 ( mod 49), i.e., r = 4 (mod
49).
We now solve the system of congruences
r= 22 (mod 25), =4mod 49).
Let m = 25.49. Let M1 = =49, M2 = = 25.
Since gcd( MË. 25) = 1. the congruence 49z = 1(nod 25) has a
unique soution.
We have 49.(-1) + 25.2 = 1. Therefore 49.(-1) = 1(mod 25) and
therefore the unique solution is zj = 24 (mod 25).
Since gcd( M2,49) = 1, the congruence 25* = 1(mod 49) has a
unique solution. Proceeding similarly, the unique solution is &2 = 2
(mod 49).
A solution of the system is k = 22.(49.24) +4.(25.2) = 26072.
The solution of the given congruence is = 26072 (mod 1225), which
is equivalent to z = 347 (mod 1225).
Theorem 3.4.13. Let m, m, be positive integers aud a1, ag be any
integers. Then the systen of linea congruences
I= aj (mod m1), T= 02 (mod m2)
will have a simultaneous solution if and only if a1 - a2 is divisible by
ged(m1, m2) and if this condition be satisfied the solution is unique
modulo lem(m1,nz). (i.e., the solutions fornn a single congrucnce class
modulo (m1, 1m2)
P'roof. Let m12 = ged(m1, mn2) and mj = M121, m2 = m12d2, where
ged(d,,d2) = 1.
Let rybe a simultaneous solution. The Ty = aj (mod m1), to = Wy
(mod n2). Therefore mil(Eo - a1) andmal(20 - a2) and this implies
Mi2l(y - u) and my2(zo - ag).
Theretore my2l(z0 - ag) - (Iy - a), i.e, gcd(m1,mg)l(a - z).
152 HIGHER ALGEBRA
Converscly, let m2l(a, -a2). Then a, = a2 + cm12 for some integer c.
The general solution of the first congruence has the form
I 4| + ms, where s is an integer
= (a2 + cm12) + dË m12s,
= a2 + m12(c+ dËs), wher s is an integer.. (i)
The general solution of the second congruence has the form
t= @2 + m2t, where t is an integer
= a2 + m)2dgt, where t is an integer... (ii)
Since gcd(d,,d2) = 1, pd1 + gdz = 1 for some integers p and q.
Therefore pcd1 + gcd, = c and c+ dËs = 1(pc+ s) + qcdz.
If we choose s such that pc + s = dgu, where u is an integer then
c+ dys = da(udi + ge) = dzv, where v is an integer and in that case
the solutions (i) and (ü) become identical which implies that the given
congruences have a simultaneous solution.
The solution takes the form
I= a1 + m1s = 01 + m1(-pc + dyu), where u is an integer
pcm1 + mjdu
= aj-pcm1 +lcm(m1, m2)u, since mËd =
m1 m2
gcd(m1,m2) = (m1, m2).
Since uis an integer, the solution is unique modulo lcm(m1, m2).
6. Show that the congruencesz=11 (mod 15), =6(mod 35) have
a simultaneous solution. Solve the system.
Here the moduli of the congruences 15 and 35 are not prime to each
other. gcd(15, 35) = 5 and 11 6 is divisible by gcd(15,35). Therefore
the congruences have a simultaneous solution.
The general solution of the first congruence has the form
T = 11 + 15s, where s is an integer
=6+5(1+ 3s)... (i)
The general solution of the second congruence has the form
T=6+ 35t = 6 + 5.7t, where t is an integer... (ii)
If s = 2+7u, where u is an integer, then 1 +3s is a multiple of 7
is
and in that case (i) and ii) become identical. The common solution
I =6+ 5|1+ 3(2 + 7u)) = 41+ 105u, where u is an integer.
Therefore the solution is given by t = 41( mod 105).
Another method
simultaneous
The congruence z = 11(mod 15) is equivalent to two
Congruences z = 11 (mod 3), z = 11 (mod 5).
simultaneous
"The congruence z = 6(mod 35) is equivalent to two
Congruences z =6 (mod 7), z =6 (mod 5).
INTEGERS 153
Thus the given system is equivalent to four sinultaneous
congruences
. u(od 3), = 1l (mod 5), z =6 (mod 7), =6(mod 5).
lt s observed that the congruences r = 11(mod 5) and z = 6 (mod
s) are onsistent, because each is equivalent to =1 (mod 5).
The congruence r =11 (mod 3) is equivalent to r = 2 (mod 3).
Thus the given systen1 is equivalent to three simultaneous congru
ences r= 2 (mod 3), T =l(mod 5), a =6(mod 7) of which the moduli
are pairwise prime to each other.
Using the method discussed in the theorem,
Zo = 2.(35.2) + 1.(21.1) + 6.(15.1) = 251 is a solution.
The solution of the given system is z = 251 (mod 105), which is
equivalent to z =41 (mod 105).
There is an extension of the above theorem to a finite set of linear
congruences. The theorem is stated below without proof.
Theorem 3.4.14. Let m1, m2, . , m, be positive integers and
aj.02,.a, be any integers. Then the system of linear congruences
r~a (mod m1), * =ag (mod mg),., a= a, (mod m,)
will have a simultaneous solution if and only if a, - a; is divisible by
gcd(m,. nj) whenever i # j; and if this condition be satisied the su
lution is unique modulo lem(mË, nmg, ., m,). [i.e., the solutions form a
single congruence class modulo lem(m1,mz,.., m,).]
Exercises 3B
1. List allintegers z in 1<r< 100that satisfy
(i)z = 3(mod 17). (ii) z = 10(mod 17).
2. Prove that
() an integer n is divisible by 3 if and only if the sum of its digits is
divisible by 3.
(i)an integer n is divisible by 5* if and only if the number formed by the
last k digits is divisible by 5*.
(üi) an integer n is divisible by 2* if and only if the number formed by
lhe last k digits is divisible by 2*.
|Hint. (i) If the last k digits form the number a, then n = b.10* + a.
n a(mod 5*).]
O Find the missing digit in the number 23104 +791 if
CL-11
154 HIGHER ALGEBRA
(i) it is ivisible by 7;
(ii) it is divisible by 9;
(iii) it is divisible by 11;
(iv) it is divisible by 13.
4. A pOsitive integer n is expressed in the form 10a + b.
(i) Prove that n is divisible by 7 if a - 26 is divisible by 7.
(ii) Prove that n is divisible by 17 if a - 5b is divisible by 17.
(iii) Prove that n is divisible by 19 if a+26 is divisible by 19.
Hint. (i) (10a + b) + 9(a + 26) = 0(mod 19).J
5. Use the theory of congruences to prove that
(i) 7| 25n+ + 52n +3 for all integers n>1,
(ii) 17 | 28r+1 +3.52n+1 for all integers n >1,
(iii) 23 | 25n+1 + 7.32n+1 for all integers n > 1,
(iv) 43 | 6+2 +7n+ for all integers n >1.
6. Use the theory of congruences to find the remainder when the sum
(i) 1 + 2* +33 t+99 is divided by 3;
(ii) 1 + 2° +3 + + 100 is divided by 5.
7. (i) If ac = bc(mod m) and gcd(c, m) = 1, prove that a = b(mod m).
(ii) If a =b (mod m) anda=b (mod n) where gcd(m, n) = 1, prove that
a=b (mod mn).
(iii) If a =b (mod n) and a =c (mod n), prove that b = c (mod d),
where d= gcd(m, n).
8. Solve the linear congruences.
(i) 4z =3 (mod 5), (ii) 7z =3 (mod 15),
(iüi) 20x=10 (mod 35), (iv) 28T = 63 (mod 105).
9. Solve the system of linear congruences.
(i) z =3 (mod 5), T = 4 (mod 7).
(ii) z = 2 (mod 3), z =3 (mod 5), z=4 (mod 7).
(iii) 2 2(mod 5), z =3 (mod 7), &= 5 (mod 8).
wO. (i) Find the least positive integer which leaves remainders 2,3 and 2 when
divided by 3,4 and 5 respectively.
(i) Find the least positive integer which leaves remainders 2,3 and 4 wlhen
divided by 3,5 and 11 respectively.
INTEGERS 155
11. () Find three consecutive positive integers in ascending order, divisible
by 5,7 and 9 respectively.
(iü) Find four consecutive positive integers in ascending order, divisible by
4,5.7 and 9 respectively.
12. Solve the linear congruences by Chinese remainder theorem.
(i) 25r == 4 (mod 63), (ii) 89z = 25 (mod 108).
13. Show that the system of linear congruences has a simultaneous
solution
Solve the system.
(i) r=2 (mod 9), z =5 (mod 6);
(iü) z = 2 (mod 1l5), z =7 (mod 10).
14. Show that the system of linear congruences has no
simultaneous solution.
(1) z =5 (mod 9), z =1 (mod 6);
(ii) z = 4 (mod 10), z =8 (mod 15), T = 16 (mod 25).