Number Theory Prof Asghar Ali
Number Theory Prof Asghar Ali
Available at MathCity.org
Number Theory
Divisibility
Divisibility:
Let „a‟ and „b‟ be any two integers. We say that „a‟ divides „b‟ or „b‟ is divisible by „a‟ denoted
by a|b. when there exist integer „c‟ such that b = ca. If a does not divides b then a∤b.
Perfect Number:
A number is said to be a perfect number if it is equal to the sum of its all +ve integral divisors.
i.e 6|1 , 6|2 , 6|3 without itself 1+2+3=6
Proposition
Let a,b,c be the integers then prove the following axioms.
(1)
a|0
0 = 0.a where 0,a be the integers. So a|0
1|a
Since a = 1.a 1, a be the integer. So 1|a
-1|a
Since a = - (-1)(a) → -1|a -1, a be integers. So -1|a
Division Algorithm
a = qd + r
a = 26, q = 8, d = 3, r = 2
26 = (8)(3) + (2)
26 = 26
Division Algorithm. Given integers a and b, with b>0, there exist unique integers q and r satisfying
𝑎 = 𝑞𝑏 + 𝑟 0≤𝑟<𝑏
The integers q and r are called,respectively,the quotient and remainder in the division of a by b.
Proof. We begin by proving that the set
𝑆 = 𝑎 − 𝑥𝑏 𝑥 𝑎𝑛 𝑖𝑛𝑡𝑒𝑔𝑒𝑟; 𝑎 − 𝑥𝑏 ≥ 0
is non empty. To do this, it suffices to exhibit a value of 𝑥 making 𝑎 − 𝑥𝑏 nonnegative. Because the
integers 𝑏 ≥ 1, we have 𝑎 𝑏 ≥ 𝑎 , and so
𝑎 − (−1 𝑎 )𝑏 = 𝑎 + 𝑎 𝑏 ≥ 𝑎 + 𝑎 ≥ 0
For the choice 𝑥 = − 𝑎 , then, 𝑎 − 𝑥𝑏 lies 𝑆. This paves the way for an application of the well-
ordering principle, from which we infer that the set S contains a smallest integers; call it r. By the
definition of S, there exists an integers q satisfying
𝑟 = 𝑎 − 𝑞𝑏 0≤𝑟
We argue that 𝑟 < 𝑏. If this were not the case then 𝑟 ≥ 𝑏 and
Mathmatical Induction
It is a method which is often used to prove the divisibility based result. It is most powerful tool
to prove the result in exponent form. To prove the result with the help of mathematical induction, we
have to follow the following steps:
Step 1:
Let n = 1 then,a - b | a1 – b1 ……………(1) which is true for n=1.
Step 2:
Now we suppose it is true for n = k → a - b|ak – bk ………(2)
Step 3:
Now we want to prove that for n = k + 1 is also satisfy a - b|ak+1 – bk+1
ak+1-bk+1 = aak – bbk
=aak – akb – bbk + akb +ing and –ing akb
=ak(a – b ) + b( ak – bk )
From eq (1) a – b | a – b and a – b | ak – bk by hypothesis
and we know that, If a|b and a|c then a|bx + cy ∀ x,y Є Z
Hence a – b |ak(a - b) + b(ak – bk) = ak+1 – bk+1
→a - b | ak+1 – bk+1
So a - b | an – bn ∀ a,b Є Z, by mathematical induction.
Question : Prove that the product of any three consecutive integers is divisible by 6.
Proof:
Let n, n+1, n+2 be three consecutive integers. Then product of three consecutive integer is
n (n + 1) (n + 2)
Now we have to prove that 6|n (n + 1) (n + 2) ……………(1).We prove it by induction method.
Step 1:
Put n=1
Then 6|1 (1 + 1) (1 + 2) = 6 → 6|6 so it is true for n=1.
Step 2:
Now we suppose that the result is true for n=k
→ 6|k (k + 1) (k + 2)…………….. (2)
Now we prove it that the result is true for n = k + 1
n (n + 1) (n + 2) = (k + 1) (k + 2) (k + 3) = k (k + 1) (k + 2) + 3 (k + 1) (k + 2)
By hypothesis factor k (k + 1) (k + 2) is divisible by 6 i.e 6| k (k + 1) (k + 2) .
Now we show that 6|3 (k + 1) (k + 2)
Here we have two cases.
1st : If k is even say k = 2m, m is integer then
6|3 (2m + 1) (2m + 2)
6|6 (2m + 1) (m + 1) which is true
2nd: If k is odd say k = 2m + 1, m is integer then
6|3 (2m + 1 + 1) (2m + 1 + 2) = 3 (2m + 2) (2m + 3)
6|6 (m+1) (2m+3) which is true.
We know that if a|b and a|c then a|bx + cy ∀ x , y Є Z
So 6|k (k + 1) (k + 2) + 3 (k + 2) (k + 3) = (k + 1) (k + 2) (k + 3) = n (n + 1) (n + 2)
→ 6|k (k + 1) (k + 2) (k + 3)
Hence It is proved that product of three consecutive integer is divisible by 6.
Step 1:
Put n=2 because n is +ve even .
→ a + b | a2 – b2 ……….. (1)
→ a + b | (a + b) (a - b) which is tue for n=2.
Step 2:
Now we suppose that the result is true for n = 2k because n is even. k is integer
→ a + b | a2k - b2k ……….(2)
Now we have to prove that the result is true for n=2k+2 because n is +ve even.
→ a + b | a2k+2 – b2k+2
an – bn = a2k+2- b2k+2
= a2ka2 - b2kb2 - a2kb2 + a2kb2 +ing and –ing a2k b2
= a2ka2-a2kb2+a2kb2-b2kb2
= a2k(a2-b2) + b2(a2k-b2k)
Fom eq (1) a + b | a2 - b2 and by hypothesis a + b| a2k - b2k
So we know that if a|b and a|c then a| bx+cy for every integers x, y
So a + b | a2k(a2 - b2) + b2(a2k - b2k) = a2k+2 - b2k+2
Hence it is prove that if n is +ve even integer then a + b |an - bn .
Step 1:
Put n = 1
24 | 2.7 + 3.51 – 5 = 2.7 + 3.5 – 5 = 24
1
→24|24 which is true.
Step 2:
Now we suppose that result is true for n = k then,
24 |2.7 + 3.5k - 5 …………..(1)
k
Step 3:
Now we show that result is true for n = k + 1
2.7 k+1
+ 3.5k + 1 – 5= 2.77k + 3.55k - 5
= 14.7k+ 15.5k - 5
= 2.7k + 12.7k + 3.5k + 12.5k - 5
= (2.7k + 3.5k - 5) +12.7k + 12.5k
= (2.7k + 3.5k - 5) + 12(7k + 5k)
By hypothesis 24 | 2.7k + 3.5k – 5. Now we will prove that 24 |12(7k + 5k)
Since 7 and 5 are odd and sum of two odd numbers is even , so the sum of 5k and 7k is even number.
k k
Theorem: If d = gcd(a , b) then „d‟ can be expressed as a linear combination of „a‟ and „b‟
i.e d = ax + by: where x, y are some integers and a, b not both of which are zero.
Proof :
Let „S‟ be set defined as S = {au+bv |au+bv > 0 ,u,v ∈ Z}
1st we will prove that „S‟ is non-empty set.
7 Prof. Asghar Ali
Let b=0 then
|a| = au+b(0) choosing u = 1
|a| = a(1) ∈ S
If u = -1 then „a‟ is (-a)
→ |a| = (-a) (-1) ∈ S So „S‟ is non-empty.
{By using well order principle WELL ORDERING PRINCIPLE that Every non – empty set S of Non –
negative integer contains a least element that is there is some integer a in S s.t a ≤ b, ∀ b ∈ S}
So S has least element say „d‟.
Then for some integer x,y we have
d = ax+by ………..(1)
we have to prove that gcd (a,b) = d.
by using division algorithm . Ǝ unique integers q & r s.t
a = qd+r ………….(2) where 0 ≤ r < d.
a = q (ax+by) + r from (1)
a = aqx + qby +r
a-aqx-qby = r
a(1-qx) + b(-qy) = r ……(3) ∵ 1,q,x,y ∈ Z ,(1-qx) , (-qy) are also integers.
Let 1-qx = t , -qy = m put in (3)
Then at+bm = r
→ at + bm ∈ S → r ∈ S.
If r is the +ve integer r ≠ 0 .Then 0 < r < d. → r ∈ S this shows r is the least element of S. But we
consider „d‟ is also least element so we take r = 0 then eq (2) becomes
a = qd+0, a = qd → d|a
similarly we can show that d|b.
now we will prove „d‟ is gcd of a and b for this let „c‟ be another common divisor of a,b
→ c|a , c|b
we know that if a|b and a|c then a| bx+cy for every integers x, y.
so c|ax+by ; x,y ∈ Z
c|d from eq (1)
→ |c| ≤ |d|
Hence „d‟ is the gcd of a,b So gcd (a,b) = ax+by.
(2) Find gcd and write it as linear combination form (321 , -86)
Take a=321, b=86 we ignore minus sign when find gcd
321= 3×86 + 63 → 321 - 3×86 = 63
86 = 1×63 + 23 → 86 - 1×63 = 23
63 = 2×23 + 17 → 63 - 2×23 = 17
23 = 1×17 + 6 → 23 - 1×17 = 6
17 = 2×6 + 5 → 17 - 2×6 = 5
6 = 1×5 + 1 → 6 - 1×5 = 1
5 = 5×1 + 0 → 5 - 5×1 = 0
8 Prof. Asghar Ali
1 = 6-1×5
1 = 6+(-1) ×5
1 = 6+(-1)(17-2×6)
1 = 1×6+(-1) ×17+2×6
1 = -1×17+3×6
1 = -1×17+3×{23-1×17}
1 = -1×17+3×23-3×17
1 = 3×23-4×17
1 = 3×23-4×{63-2×23}
1 = 3×23-4×63+8×23
1 = -4×63+11×23
1 = -4×63+11×{86-1×63}
1 = -4×63+11×86-11×63
1 = 11×86-15×63
1 = 11×86-15×{321-3×86}
1 = 11×86-15×321+45×86
1 = -15×321+56×86 x = -15 , y = 56
Theorem: Let „a‟ and „b‟ integers , not both zero then „a‟ and „b‟ relatively prime if and
only if there exist integers „x‟ and „y‟ s.t 1 = ax+by.
Proof :
Since„a‟ and „b‟ are relatively prime so gcd (a,b) = 1Then by using the result,
Ǝ for some integer „x‟ and „y‟ s.t 1 = ax+by ∵ gcd(a, b)=d=ax+by for some integers
Conversely ,
Let 1 = ax+by ………(1)
We have to prove that gcd (a,b) = 1.For this we suppose gcd (a,b) = d.We have to prove that d = 1
As gcd (a,b) = d → d|a and d|b
Then d|ax+by ∀ x,y ∈ Z
d|1 from (1) Which is only possible if d = 1 So gcd (a,b) = 1.
Question : Let a,b and c be integers, then ( ca, cb)=c(a, b), for any positive integers c.
Solution:
Let (a,b)=d, then ∃ some integers x,y s.t
ax+by=d....... (1) multiplying it by c
acx+bcy= dc → (ac,bc)=c(a,b)
Let a,b be two integers not both are zero. Then an integer m is called Least Common Multiple of a,b if
a|m, b|m
If there exist an integer c such that a|c, b|c then m ≤ c or m|c . L.C.M of a,b is denoted by
<a, b>=m
Example:Take a= 8, b=12 , m =24, 48,72,96 then <8, 12>=24
Another way to find the greatest common divisor and least common factor of two positive integers is to
use the prime factorizations of these integrs,Suppose that the prime factorizations of the positive integrs
a and b are
𝑎 𝑎 𝑎 𝑏 𝑏 𝑏
𝑎 = 𝑃1 1 . 𝑃2 2 … … . . 𝑃𝑛 𝑛 , 𝑏 = 𝑝1 1 . 𝑝2 2 … … . . 𝑝𝑛 𝑛 Where each exponent is a non negative
integers.Then gcd(a,b) is given by
min (𝑎 𝑏 ) min (𝑎 𝑏 ) min (𝑎 𝑛 , 𝑏𝑛 , )
gcd(a,b)=𝑃1 1 , 1,
. 𝑃2 2 , 2,
… … . . 𝑃𝑛
their Least Common Multiples is
max (𝑎 1 , 𝑏1, ) max (𝑎 2 , 𝑏2, ) max (𝑎 𝑛 , 𝑏𝑛 , )
lcm(a,b)= 𝑃1 . 𝑃2 … … . . 𝑃𝑛
Theorem: Let take positive integers ‘a’ and ‘b’ then gcd (a,b).lcm (a,b)= ab.
Proof:
Let gcd(a,b)=d, lcm(a,b)=m. Now we have to prove d.m=a.b
Since gcd(a,b)=d then Ǝ x,y ϵ Z such that (linear combination) ax+by=d …… (1)
Also d|a & d|b then Ǝ r, s Such that
a= rd , b= sd
𝑎𝑏
If m= 𝑑
using Then m=as, m=br where r, s ϵ Z
a|m and b|m now we have to prove that m is the least common multiple.
For this supose „c‟ is the multiple of a and b. Then a|c, b|c there exist integers k1, k2 we have
c= ak1 , c= bk2 ……….(2)
𝑐 𝑐 𝑎𝑏
Also = ∴𝑚=
𝑚 𝑎𝑏 /𝑑 𝑑
𝑐 𝑑𝑐 𝑐(𝑎𝑥 +𝑏𝑦 ) 𝑐𝑎𝑥 +𝑐𝑏𝑦
𝑚
= 𝑎𝑏
= 𝑎𝑏
= 𝑎𝑏 ∴ 𝑑 = 𝑎𝑥 + 𝑏𝑦 from (1)
𝑐 𝑎𝑐 𝑐𝑏 𝑐 𝑐 c c
= 𝑥+ 𝑦= 𝑥 + ( )𝑦 where k1 = and k 2 = from (2)
𝑚 𝑎𝑏 𝑎𝑏 𝑏 𝑎 a b
𝑐
= 𝑘2 𝑥 + 𝑘1 𝑦 ∴ x, y, k1 , k 2 ∈ Z xk 2 + k 2 y = t
𝑚
c
=t c = mt → m|c →m≤c
m
ab
m= → 𝑚𝑑 = 𝑎𝑏
d
Composite numbers:
The number which are not prime and greater than „1‟.
OR The number which can be divide by other number .
Example : 4,6,8,9,10,12,15, ……………..
Remarks :
2 is only even prime .
1 is neither even nor odd prime.
Theorem: if „p‟ is prime and p|ab where a,b Є Z then either p|a or p|b.
Proof:
Since „p‟ is prime and p|ab. We have to prove that p|a or p|b.
If p|a then we have done, and nothing to prove
If „p‟ is not divides „a‟ and also „p‟ is prime so gcd (a,p) = 1
By Euclid‟s lemma If gcd (a,b) = 1 and a|bc then a|c.
Where gcd (a,p) = 1 and p|ab then p|b → p|b.
Similarly we can show p|a.
Corollary : If „p‟ is prime and p|a1.a2……an , then p|ak for some ak, Where 1 ≤ k ≤ n.
Proof :
we prove it by M.I ,
Step 1:
If n = 1 then p|a1. So the result is true for n = 1
If n = 2 then p|a1a2 → p|a1 or p|a2 by above result
Step 2:
Now we suppose that the result is true for n = k
→ p|a1.a2……ak then p|ai for some i (1 ≤ i ≤ k)
Now we will prove for n = k+1
Take p|a1.a2………ak.ak+1 → p| (a1.a2…..ak)(ak+1)
By using the statement, “ if „p‟ is prime and p|ab then p|a or p|b “
So p|a1.a2……ak or p|ak+1
If p|a1.a2…….ak then by hypothesis p|ai for some i .
and If p|ak+1 then obviously result is true for n=k+1.
Hence the result is true for all n by mathematical induction .
Corollary : If p ,q1,q2,q3,…….,qn are all primes and p|q1.q2.q3……qn. Then p = qk for some k,
where 1 ≤ k ≤ n.
Proof:
Let p,q1,q2,q3 ……. qn are prime numbers and
If p|q1.q2.q3 ……. qn we have to show that p = qk for some k (1 ≤ k ≤ n)
we know a result,
Uniqueness :
Let us suppose that the integer „n‟ can be represented as a product of primes in two ways say,
n = p1.p2.p3…….pr ………… (1)
n = q1.q2.q3……..qs …………..(2) with r ≤ s compairing (1) and (2)
p1.p2.p3…….pr = q1.q2.q3……..qs where pi‟s and qj‟s are all primes ,
14 Prof. Asghar Ali
written in increasing magnitude so that p1 ≤ p2 ≤ p3 …………… ≤ pr , q1 ≤ q2 ≤ q3 ………… qs
because p1|q1.q2.q3……..qs then p1 = qk for some k as qk ≥ q1.But then p1 ≥ q1 …………(3)
similarly if q1| p1.p2.p3……. pr, then q1 = pm for some m as pm ≥ p1 so q1 ≥ p1 ………… (4)
combine (3) and (4) p1 = q1
p1.p2.p3…….pr = q1.q2.q3……..qs we may cancel this common factor and obtain ,
p2.p3……….pr = q2.q3………..qs now repeat the procedure to get p2 = q2 , then we have
p3…….pr = q3……..qs continuing in this way , we have if r < s , then 1 = qr+1 . qr+2 ………… qs
Which is wrong because each qi > 1 hence r = s and p1 = q1 , p2 = q2 , ………… , qr = pr
Hence our proof is complete.
Corollary : Show that every odd prime number is either of the form 4n+1 or 4n-1 (4n+3)
Proof :
Suppose „m‟ be an integer. By using division algorithm , there exist unique integers
„n‟ and „r‟ s.t m = nd+r …….(1) where 0 ≤ r < d, take d = 4, so r = 0, 1, 2, 3 put in (1),
m= 4n ………..(1) if r = 0
if r = 1,2,3 ,then ,
m = 4n + 1 ………(2)
m = 4n + 2 ………(3)
m = 4n + 3 ………(4)
now 4n can‟t be prime for any integer n.
4n+2 = 2(2n+1) is prime only for n = 0 , which is even prime ,
hence every odd prime is of the form 4n+1 or 4n+3.
Theorem: The linear Diophantine equation ax+by = c admits a solution iff d|c , where
d = gcd (a,b).
Proof :
Since gcd (a,b) = d , i.e d|a , d|b. So there exist integers „r‟ and „s‟ s.t a = dr , b = ds
if a solution of ax+by = c exist. So that axo+byo = c for suitable „xo‟ and „yo‟.Then c = axo+byo
c = drxo+dsyo = d(rxo+syo) , since r, xo, s, yo ∈ Z
then c = d(rxo+syo), rxo+syo = q ∈ Z
c = dq , d|c
Conversely
Suppose that d|c , then Ǝ integer „t‟ s.t c = dt using ( given integers „a‟ and „b‟ no both of which are
zero, then there exist integer „x‟ and „y‟ s.t d = ax+by. So we can find integer xo and yo s.t axo+byo = d
multiply this eq by „t‟ , we get atxo + btyo = t
→ a(txo) + b(tyo) = c,
Hence , the Diophantine eq, ax + by = c has a solution x = txo , y = tyo .
Theorem: The linear Diophantine eq. ax+by = c has a solution iff d|c, Where gcd (a,b) = d if
„xo‟ , „yo‟ is any particular solution of this equation , Then all other solutions are given by
𝒃 𝒂
x = xo+( )t , y = yo-(𝒅 )t .
𝒅
Proof :
Write whole solution of the previous theorem same as it is: [ The linear Diophantine equation
ax+by = c admits a solution iff d|c , where d = gcd (a,b)]
Then next:
Now, It is given that xo , yo is the solution of given equation . suppose x1,y1 is any other solution of this
equation , then since axo + byo = c = axl + byl
byo – byl = axl – axo
b ( yo – yl) = a (xl – xo)
a ( xl – xo) = b (yo- yl) ………….. (1)
there exist relatively prime integers „r‟ and „s‟ s.t
a = dr , b = ds , put in (1) d|a, d|b
we get dr ( xl – xo ) = ds (yo – yl)
where „d‟ is common factor , we get
r(xl – xo) = s(yo – yl)
→ r|s(yo – yl) , with gcd (r,s) = 1 By using Euclid lemma ,
r|yo – yl or in other words yo – yl = rt for some integers „t‟ ,we now get
r(xl – xo) = s(yo – yl)
r(xl – xo) = srt →xl – xo = st
this leads to the formula xl = xo + st , yl = yo - rt
𝑏 𝑎
xl = xo + ( )t , yl = yo-( )t
𝑑 𝑑
I. 6x + 51y = 20
II. 33x+14y = 115
III. 14x+35y = 93
Solution: 6x+51y = 22
51= 8×6+3
6 = 2×3+0
gcd (6,51) = 3
3 can‟t divided by 22 so its solution does not exist.
other questions do yourself with same method.
Question : Do there exist infinitly many positive integer solutions of 10x-7y= -17. Explain.
Solution :
Yes, by inspection 10(-1) -7.1= -17, so x= -1, y =1 is one solution of the equation. Hence all
solutions are given by x= -1-7t , y =1-10t, if t < -1/7 , then, x > 0 if t < 1/10, then y > 0, and therefore
any integer t ≤ -1 yes a positive solutions.
Question : Find the smallest positive integer b, s.t the linear diophantine equation
1111x+704y=15000+b has a solution.
Solution :
Since (1111,704)=11, so the solutions exist iff 11 divides 15000+b, the smallest positive value
of b is thus 4.
Available at MathCity.org
Y-Values
15
14
13
12
11
10
9
8
7
6
5
4
3 Y-Values
2
1
0
-15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1-1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
-2
-3
-4
-5
-6
-7
-8
-9
-10
Y-Values
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13 Y-Values
12
11
10
9
8
7
6
5
4
3
2
1
0
-5 -4 -3 -2 -1 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-2
-3
-4
-5
Polynomial Theorem
This is very powerfull theorem to find the remainder according to polynomial theorem,
(x + a) = xn + c1nxn-1a+ c2nxn-2a2+……..+ cnnx0an …………. (1)
n
Dividing by „x‟
(x+a)n x n +c n 1 x n −1 a+c n 2 x n −2 a 2 +⋯…….+c n n x 0 a n
x
= x
…………….(2)
an
Remainder of expression (2) will be equal to remainder of „ ‟ because rest of the term contains „x‟
x
are completely divides by „x‟.
𝟗𝟗𝟗
Example : Find the remainder 𝟖
.
Solution:
999 (8+1)99
8
= 8 According to polynomial theorem will be equal to
(1) 99 1
8
= 8 → Remainder = 1
𝟖𝟖𝟗
Example : Find the remainder 𝟕
.
Solution:
889 (7+1)89
= According to polynomial theorem will be equal to
7 7
(1) 89 1
7
= 7 → Remainder = 1
𝟗𝟏𝟎𝟎
Example : Find the remainder of 𝟕
Solution:
9100 (7+2)100 2100 299 .2 23×33 .2 833 .2 (7+1)33 .2 (1)33 .2 2
= = = = = = = =
7 7 7 7 7 7 7 7 7
Remainder = 2
Available at MathCity.org
𝟕𝟐𝟑
Example : Find the remainder of 𝟖
Solution:
723 722 .7 (72 )11 .7 4911 .7 (48+1)11 .7 (6×8+1)11 .7 (1)11 .7 7
8
= 8
= 8
= 8
= 8
= 8
= 8
=8
→ Remainder = 7
Congruences
Congruences:
Let n be a positive integer. Two integers a and b are congruent modulo n. If n|a-b. If this is so
then we can write a ≡ b (mod n). Such a statement is called a congruence
For example, 19 and 12 are congruent modulo 7; that is, 19 ≡ 12 (mod 7), because 7|19-12
Also, −8 and 10 are congruent modulo 6; that is, −8 ≡ 10 (mod 6).
The congruence a ≡ b (mod n) is equivalent to the statement that there is an integer k such that
a = b + nk.
Properties of congruences:
a ≡ a (mod n)
if a ≡ b (mod n) then b ≡ a (mod n)
if a ≡ b (mod n) and b ≡ c (mod n), then a ≡ c (mod n)
Solution:
51 ≡ 5 mod(24)
52 ≡ 52 mod(24)
52 ≡ 1 mod(24)
52 ≡ 1 mod(24)
(52)24 ≡ (1)24 mod(24)
548 ≡ (1) mod(24)
“ 1 “ is remainder
Solution:
3 ≡ 3 mod(8)
32 ≡ 9 mod(8)
25 Prof. Asghar Ali
32 ≡ 1 mod(8)
(32)10 ≡ (1)10 mod(8)
320 ≡ (1) mod(8)
3.320 ≡ (3)(1) mod(8)
321 ≡ 3 mod(8)
So „‟3‟‟ is the remainder.
Solution:
11 ≡ 11 mod(13)
11 ≡ -2 mod(13)
112 ≡ (-2)2 mod(13)
112 ≡ 4 mod(13)
114 ≡ 16 mod(13)
114 ≡ 3 mod(13)
118 ≡ 9 mod(13)
1116 ≡ (-4)2 mod(13)
1116 ≡ 16 mod(13)
1116 ≡ 3 mod(13)
1132 ≡ 9 mod(13)
1132 ≡ -4 mod(13)
1135 = (11)32×(11)2×(11)1
1135 = (-4)×(4) × (-2) mod(13)
1135 = 6 mod(13)
So “ 6 “ is remainder .
Solution:
31 ≡ 3 mod(23)
32 ≡ 9 mod(23)
34 ≡ 81 mod(23) 34 ≡ 12 mod(23)
38 ≡ 144 mod(23)
38 ≡ 6 mod(23)
316 ≡ 36 mod(23)
316 ≡ 13 mod(23)
316 ≡ 169 mod(23)
332 ≡ 8 mod(23)
364 ≡ 64 mod(23)
364 ≡ 18 mod(23)
364 ≡ -5 mod(23)
3128 ≡ 25 mod(23)
3128 ≡ 2 mod(23)
3256 ≡ 4 mod(23)
3287 = 3256× 316× 38× 34× 32× 31
≡ 4×13×6×12×9×3 mod(23)
≡ 6×6×12×9×3 mod(23)
≡ 13×12×9×3 mod(23)
26 Prof. Asghar Ali
≡ 18×9×3 mod(23)
≡ 1×3 mod(23)
≡ 3 mod(23)
Hence “3” is the remainder.
Solution:
341 = 11×31
340 = 68×5
25 ≡ 32 mod(11)
25 ≡ 10 mod(11)
25 ≡ -1 mod(11)
(25 )68 ≡ (-1)68 mod(11)
2340 ≡ 1 mod(11) ………. (1)
25 ≡ 32 mod(31)
25 ≡ 1 mod(31)
(25)68 ≡ (1)68 mod(31)
2340 ≡ 1 mod(31) ……….(2)
2340 ≡ (1)(1) mod(11×31)
2340 ≡ 1 mod(341)
Hence “1” is remainder.
516≡ 1 (mod17)
5496= (516)31 ≡ (1)31 (mod17)
Hence 5500= 5496.54 ≡ 1.54 ≡ 13 (mod17)
For each of the following values of a and n, determine whether a multiplicative inverse of a
modulo n exists and, if it does, find one.
Solution:
(a) To determine whether there is a multiplicative inverse, check whether 5 and 13 are coprime.
They must be coprime, as they are both prime numbers.The integers 5 and 13 are coprime, so there is a
multiplicative inverse of 5 modulo 13. Since n ≤ 13, try the values 1, 2, 3, . . . one by one until you find
the multiplicative inverse modulo 13. You needn‟t necessarily check the integer 1,
as clearly 5 × 1≢ 1 (mod 13).
5 × 1 ≡ 5 (mod 13) 5 × 2 ≡ 10 (mod 13)
5 × 3 ≡ 15 ≡ 2 (mod 13) 5 × 4 ≡ 20 ≡ 7 (mod 13)
5 × 5 ≡ 25 ≡ 12 (mod 13) 5 × 6 ≡ 30 ≡ 4 (mod 13)
5 × 7 ≡ 35 ≡ 9 (mod 13) 5 × 8 ≡ 40 ≡ 1 (mod 13)
Stop, as you have found an integer v such that 5v ≡ 1 (mod 13). So 8 is a multiplicative inverse of 5
modulo 13. You may have noticed a short cut that saves some calculations. You saw that
5 × 5 ≡ 12 ≡ −1 (mod 13), so
(−5) × 5 ≡ −12 ≡ 1 (mod 13). Since −5 ≡ 8 (mod 13), it follows that a multiplicative inverse of 5
modulo 13 is 8.
(b) To determine whether there is a multiplicative inverse, check whether 30 and 73 are coprime.
The numbers are quite large so use Euclid‟s algorithm to find the highest common factor.
Euclid‟s algorithm gives
73 = 2 × 30 + 13
30 = 2 × 13 + 4
13 = 3 × 4 + 1
4 = 4 × 1 + 0.
As gcd(30, 73)=1, so there is a multiplicative inverse of 30 modulo 73.
Rearrange all but the last equation and then apply backwards substitution to find integers v and w with
30v + 73w = 1. The integer v will be a multiplicative inverse of 30 modulo 73 since 30v = 1 − 73w.
Rearranging the equations gives
13 = 73 − 2 × 30
4 = 30 − 2 × 13
1 = 13 − 3 × 4 .
Backwards substitution gives
1 = 13 − 3 ×{30 − 2 × 13}
= 7 × 13 − 3 × 30
= 7 ×{73 − 2 × 30} − 3 × 30
= 7 × 73 − 17 × 30. (Check: 7 × 73 − 17 × 30 = 511 − 510 = 1.)
Write the equation 7 × 73 − 17 × 30 = 1 as a congruence modulo 73 to give the multiplicative inverse.
Since (−17) × 30 = 1 − 7 × 73, we obtain
(−17) × 30 ≡ 1 (mod 73).
So −17 is a multiplicative inverse of 30 modulo 73.
Linear congruences:
A linear congruence is a congruence of the form ax ≡ b (mod n),
where a and b are known, and x is unknown.
Solution:
Simplify the linear congruence by replacing 11 with the least residue of 11 modulo 8.
Since 11 ≡ 3 (mod 8), an equivalent linear congruence is 3x ≡ 7 (mod 8).
Check that this linear congruence has solutions.
As 3 and 8 are coprime, this linear congruence has solutions.
Try the values 1, 2, 3, . . . one by one until you find a solution.
Trying the values 1, 2, 3, . . . one by one, we find that
3 × 1 ≡ 3 (mod 8) 3 × 2 ≡ 6 (mod 8)
3 × 3 ≡ 9 ≡ 1 (mod 8) 3 × 4 ≡ 12 ≡ 4 (mod 8)
3 × 5 ≡ 15 ≡ 7 (mod 8).
So the solutions are given by
x ≡ 5 (mod 8).
Example: Solving a linear congruence when a and n are coprime and n > 13
Solve the linear congruence 7x ≡ 13 (mod 24).
Solution:
Check that the linear congruence has solutions. As 7 and 24 are coprime, the linear congruence
has solutions. Since 24 is a large integer, use a multiplicative inverse of 7 modulo 24 to
find the solutions. The solutions are given by
x ≡ 13v (mod 24),
where v is a multiplicative inverse of 7 modulo 24.
Use Euclid‟s algorithm and backwards substitution to find v.
Euclid‟s algorithm gives
24 = 3 × 7 + 3
7 = 2 × 3 + 1.
30 Prof. Asghar Ali
Backwards substitution gives
1=7−2×3
= 7 − 2×(24 − 3 × 7)
= 7 × 7 − 2 × 24. So 7 × 7 ≡ 1 (mod 24),
and hence 7 is a multiplicative inverse of 7 modulo 24. So the
solutions are given by
x ≡ 13 × 7 ≡ 91 ≡ 19 (mod 24).
Remember to check your answer. That is, check that if
x ≡ 19 (mod 24) then 7x ≡ 13 (mod 24). To do this, it helps to use
the congruence 19 ≡ −5 (mod 24).
(Check: 7 × 19 ≡ 7 × (−5) ≡ −35 ≡ 13 (mod 24).)
Example: Solving a linear congruence when a and n are not coprime. Solve the linear congruence
12x ≡ 16 (mod 20).
Solution:
Check that the linear congruence has solutions.
The highest common factor of 12 and 20 is 4. Since 16 is divisible
by 4, the linear congruence has solutions.
Divide each of the integers 12, 16 and 20 in the linear congruence
12x ≡ 16 (mod 20) by 4 to obtain an equivalent linear congruence.
and is equivalent to
3x ≡ 4 (mod 5).
Since the numbers involved are small, try the values 1, 2, 3, . . .
one by one until you find a solution.
Trying the values 1, 2, 3, . . . one by one, we find that
3 × 1 ≡ 3 (mod 5) 3 × 2 ≡ 6 ≡ 1 (mod 5)
3 × 3 ≡ 9 ≡ 4 (mod 5).
So the solutions are given by
x ≡ 3 (mod 5).
Theorem: The linear congruence ax ≡ b (mod n) has a solution if and only if d|b, where
d=gcd(a,n). If d|b, then it has d mutually incongruent solutions modulo n.
Proof.
We already have observed that the given congruence is equivalent to the linear Diophantine equation
ax-ny=b. It is known that the latter equation can be solved if and only if d|b; moreover, if it is solvable
and xo, yo is one specific solution, then any other solution has the form
𝑛 𝑎
𝑥 = 𝑥° + 𝑡 𝑦 = 𝑦° + ( )𝑡. for some choice of t.
𝑑 𝑑
Among the various integers satisfying the first of these formulas, consider those that occur when t takes
on the succesive values t= 0,1,2, ......., d-1:
𝑛 2𝑛 (𝑑 − 1)𝑛
𝑥° , 𝑥° + , 𝑥° + … … .. 𝑥° +
𝑑 𝑑 𝑑
We claim that these integers are incongruent modulo n, and all other such intgers x are congruent to
some one of them. If it happend that
Corollary: If gcd(a,n)=1,then the linear congruence ax ≡ b(mod n) has a unique solution modulo n.
Given relatively prime intgers a and n, the congruence ax≡b(mod n) has a unique solution. This
solution is sometimes called the ( multiplicative) inverse of a modulo n.
Example: The problem posed by Sun-Tsu corresponds to the system of three congruences
33 Prof. Asghar Ali
𝑥 ≡ 2 (mod 3)
𝑥 ≡ 3 (mod 5)
𝑥 ≡ 2 (mod 7)
In the notation of above theorem , we have n= 3 . 5 . 7 = 105 and
𝑛 𝑛 𝑛
𝑁1 = = 35 𝑁2 = = 21 𝑁3 = = 15
3 5 7
Now the linear congruences
35𝑥 ≡ 1 mod 3 21 𝑥 ≡ 1 mod 5 15 𝑥 ≡ 1 (mod 7)
are satisfied by 𝑥1 = 2, 𝑥2 = 1, 𝑥3 = 1, respectively. Thus a solution of the system is given by
𝑥 = 2 . 35 . 2 + 3 . 21 .1 + 2 . 15 .1 = 233
Modulo 105, we get the unique solution 𝑥 = 233 ≡ 23 ( mod 105).
References:
i. Burton, D.M. Elementary Number Theory Mcgraw Hill, 2000.
ii. Adler,Andrew, Coury,John E. The Theory of Number, Jones and Barttlet publishers, Boston,
1995.
The End