Number Theory by Naresh Vasant Afre 08 April 2022
Number Theory by Naresh Vasant Afre 08 April 2022
D IVISIBILITY
Definition:
If 𝑎 and 𝑏 are integers with 𝑎 ≠ 0, we say that 𝑎 divides 𝑏, denoted as 𝑎|𝑏, if there exists an
integer 𝑘 such that 𝑏 = 𝑘𝑎. (that is 𝑏 is an integral multiple of 𝑎.)
If 𝑎 does not divide 𝑏 then we denote it as 𝑎 ∤ 𝑏.
For example:
1. 4|12, as 12 = 3 × 4
2. 5 ∤ 19, since 19 is not an integral multiple of 5.
Divisibility properties:
1. If 𝑎 is any non-zero integer then
i. 𝑎|0,
ii. 1|𝑎 ,
iii. 𝑎|𝑎.
Proof:
i. We know that 0 = 0 × 𝑎 for any 𝑎, so 0 is an integral multiple of 𝑎 for any 𝑎,
Therefore 𝑎|0 for any non-zero 𝑎.
ii. As 𝑎 = 𝑎 × 1, so 𝑎 is an integral multiple of 1, hence 1|𝑎.
iii. As 𝑎 = 1 × 𝑎, so 𝑎 is an integral multiple of 𝑎, hence 𝑎|𝑎.
Page 1 of 31
This means that 𝑚𝑏 + 𝑛𝑐 is an integral multiple of 𝑎.
Hence 𝑎|𝑚𝑏 + 𝑛𝑐. As 𝑚 and 𝑛 where arbitrarily chosen.
Therefore, 𝑎|𝑚𝑏 + 𝑛𝑐, for any integers 𝑚, 𝑛.
5. If 𝑎|𝑏 and 𝑐|𝑑, then 𝑎𝑐|𝑏𝑑.
Proof:
As it is given that 𝑎|𝑏 and 𝑐|𝑑, so 𝑏 = 𝑘1 𝑎 and 𝑑 = 𝑘2 𝑐 for some integers 𝑘1 , 𝑘2 . So
𝑏𝑑 = 𝑘1 𝑘2 𝑎𝑐. This means that 𝑏𝑑 is an integral multiple of 𝑎𝑐. Hence 𝑎𝑐|𝑏𝑑.
For example:
1. If 𝑎 = 35 and 𝑏 = 8 then 35 = 8 × 4 + 3, so 𝑞 = 4 and 𝑟 = 3.
2. If 𝑎 = 35 and 𝑏 = 7 then 35 = 7 × 5 + 0, so 𝑞 = 5 and 𝑟 = 0.
3. If 𝑎 = −54 and 𝑏 = 5 then −54 = 5 × (−11) + 1, so 𝑞 = −11 and 𝑟 = 1.
Page 2 of 31
Theorem: Given integers 𝑎 and 𝑏, not both of which are zero, there exist integers 𝑥 and
𝑦 such that
𝑎𝑥 + 𝑏𝑦 = gcd(𝑎, 𝑏).
For example:
1. The gcd(−15, 20) = 5. So 𝑥 = 1 and 𝑦 = 1 works, since −15(1) + 20(1) = 5.
2. The gcd(−12, 30) = 6. So 𝑥 = 2 and 𝑦 = 1 works, since −12(2) + 30(1) = 6.
3. The gcd(−11, 0) = 11. So 𝑥 = −1 and any value of 𝑦 works.
4. The gcd(11, 7) = 1. So 𝑥 = 2 and 𝑦 = −3 works, since 11(2) + 7(−3) = 1.
For example:
1. Let 𝑎 = 39 and 𝑏 = 17. Then 39 = 17 × 2 + 5.
So by above theorem gcd(39, 17) = gcd(17, 5).
Further, 17 = 5 × 3 + 2. So gcd(17, 5) = gcd(5, 2).
Similarly, gcd(5, 2) = gcd(2, 1) = gcd(1, 0) = 1.
Hence, we can say that gcd(39, 17) = 1.
2. (171, 111) = (111, 60) = (60, 51) = (51, 9) = (9, 6) = (6, 3) = (3, 0) = 3.
3. (121, 67) = (67, 54) = (54, 13) = (13, 12) = (12, 1) = (1, 0) = 1.
4. (436, 71) = (71, 10) = (10, 1) = (1, 0) = 1.
Page 3 of 31
Remarks:
1. If 𝑎 and 𝑏 ere integers, not both of which are zero, then
gcd(𝑎, 𝑏) = gcd(−𝑎, 𝑏) = gcd(𝑎, −𝑏) = gcd(−𝑎, −𝑏).
2. For any integer 𝑘 ≠ 0, gcd(𝑘𝑎, 𝑘𝑏) = |𝑘| gcd(𝑎, 𝑏).
For example:
a. (12, 30) = 6(2, 5) = 6 × 1 = 6.
b. (96, 141) = 3(32, 47) = 3(32, 17) = 3(17, 15) = 3(15, 2) = 3(2, 1) = 3.
c. (1001, 11011) = 1001(1, 11) = 1001.
Page 4 of 31
4. (1598, 987).
Solution:
a 1598 987 611 376 235 141 94
b 987 611 376 235 141 94 47
q (quotient) 1 1 1 1 1 1 2
r (remainder) 611 376 235 141 94 47 0
Therefore (1598, 987) = 47.
5. (2537, −937).
Solution: We know that gcd(𝑎, 𝑏) = gcd(𝑎, −𝑏). So (2537, −937) = (2537, 937).
a 2537 937 663 274 115 44 27 17 10 7 3
b 937 663 274 115 44 27 17 10 7 3 1
q (quotient) 2 1 2 2 2 1 1 1 1 2 3
r (remainder) 663 274 115 44 27 17 10 7 3 1 0
Therefore (2537, −937) = (2537, 937) = 1.
Theorem: The linear Diophantine equation 𝑎𝑥 + 𝑏𝑦 = 𝑐 has a solution if and only if 𝑑|𝑐,
where 𝑑 = gcd(𝑎, 𝑏). If 𝑥0 , 𝑦0 is any particular solution of this equation, then all other
𝑏 𝑎
solutions are given by 𝑥 = 𝑥0 + (𝑑) 𝑡 and 𝑦 = 𝑦0 − (𝑑) 𝑡.
Page 5 of 31
= 5 × 1785 − 6 × (3255 − 1785) = 11 × 1785 − 6 × 3255.
So, 𝑥0 = −6 and 𝑦0 = 11.
All other solutions are
𝑏 𝑎
𝑥 = 𝑥0 + (𝑑) 𝑡 = −6 + 17𝑡 and 𝑦 = 𝑦0 − (𝑑) 𝑡 = 11 − 31𝑡, where 𝑡 ∈ ℤ.
Page 6 of 31
29 = 551 − 9 × 58
= 551 − 9 × (609 − 551) = 10 × 551 − 9 × 609
= 10 × (1769 − 2 × 609) − 9 × 609 = 10 × 1769 − 29 × 609
= 10 × 1769 − 29 × (2378 − 1769) = 39 × 1769 − 29 × 2378
So we have,
29 = 39 × 1769 − 29 × 2378.
Therefore,
116 = 4 × 29 = (4 × 39)1769 − (4 × 29)2378.
Hence 𝑥0 = 156 and 𝑦0 = −116.
All other solutions are
𝑏 𝑎
𝑥 = 𝑥0 + (𝑑) 𝑡 = 156 + 61𝑡 and 𝑦 = 𝑦0 − (𝑑) 𝑡 = −116 − 82𝑡, where 𝑡 ∈ ℤ.
Solve: A mobile shop owner keeps two types of mobile covers: transparent cover and flip
cover. He sells flip covers for 𝑅𝑠. 31 each and transparent covers for 𝑅𝑠. 28 each. If
his total income in a day on these covers is 𝑅𝑠. 1460, how many of each type is sold
in a day?
Solution: Let 𝑥 and 𝑦 denote the number of flip covers and the number of transparent
covers sold respectively.
We need to solve the linear Diophantine equation 31𝑥 + 28𝑦 = 1460.
For this we first find the gcd(28, 31).
a 31 28 3
b 28 3 1
q (quotient) 1 9 3
r (remainder) 3 𝒅=𝟏 0
Now we trace back and write:
1 = 28 − 9 × 3 = 28 − 9 × (31 − 1 × 28) = 10 × 28 − 9 × 31.
Multiplying above equation by 1460 to get,
1460 = 14600 × 28 − 13140 × 31
So, 𝑥0 = −13140 and 𝑦0 = 14600.
All other solutions are
𝑏 𝑎
𝑥 = 𝑥0 + (𝑑) 𝑡 = −13140 + 28𝑡 and 𝑦 = 𝑦0 − (𝑑) 𝑡 = 14600 − 31𝑡,
Page 7 of 31
where 𝑡 ∈ ℤ.
As we want positive values of 𝑥 and 𝑦. So −13140 + 28𝑡 ≥ 0 i.e., 𝑡 ≥ 469.28.
We choose 𝑡 = 470.
Hence the required solution is
𝑥 = −13140 + 28 × 470 = 20,
𝑦 = 14600 − 31 × 470 = 30.
More challenges:
1. If 𝑎|𝑏, show that (−𝑎)|𝑏, 𝑎|(−𝑏), and (−𝑎)|(−𝑏).
2. Find the quotient and the remainder when 𝑎 is divided by 𝑏, where 𝑎 and 𝑏 are
given below:
i. 𝑎 = −100, 𝑏 = 17;
ii. 𝑎 = 43, 𝑏 = −7;
iii. 𝑎 = 289, 𝑏 = 18;
iv. 𝑎 = 25, 𝑏 = 76;
3. Prove or disprove: if 𝑎|(𝑏 + 𝑐), then either 𝑎|𝑏 or 𝑎|𝑐.
4. Find gcd(143, 227) , gcd(306, 657) and gcd(272, 1479).
5. Find the greatest common divisors of the following pair of integers, using Euclidean
algorithm:
i. (3083, 2893)
ii. (34, 55)
iii. (1598, 987)
iv. (112, 144)
6. Determine all solutions in integers of each of the following Diophantine equations:
a) 56𝑥 + 72𝑦 = 40;
b) 123𝑥 + 360𝑦 = 99;
c) 221𝑥 + 91𝑦 = 117;
d) 158𝑥 − 57𝑦 = 7;
e) 4𝑥 + 𝑦 = 44;
f) 252𝑥 + 198𝑦 = 18;
g) 84𝑥 − 438𝑦 = 156.
7. An ice-cream shop sells ice-cream in two flavors: Chocolate and vanilla. Price of
chocolate ice-cream is 𝑅𝑠. 90 and price of vanilla ice-cream is 𝑅𝑠. 74. How many
chocolate ice-cream and vanilla ice-cream should be sold to earn 𝑅𝑠. 5016 ?
Page 8 of 31
P RIMES
Primes: An integer 𝑝 > 1 is called a 𝑝𝑟𝑖𝑚𝑒 𝑛𝑢𝑚𝑏𝑒𝑟, or simply 𝑝𝑟𝑖𝑚𝑒, if its only
positive divisors are 1 and 𝑝.
An integer greater than 1 which is not prime is termed as 𝑐𝑜𝑚𝑝𝑜𝑠𝑖𝑡𝑒.
For example:
The first four prime integers are 2, 3, 5, 7 and 4, 6, 8, 9 are the first four composite
numbers.
Testing of primes
Theorem:
Solution: As 22 < √509 < 23. We need to check out only those primes which are not
larger than 22; namely 2, 3, 5, 7, 11, 13, 17, 19.
Dividing 509 by each of these in turn, we find that none is dividing 509.
Therefore, 509 is a prime number.
Example: Test whether 2093 is prime.
Solution: As 45 < 2093 < 46. We need to check out only those primes which are not
larger than 45; namely 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43.
Dividing 509 by each of these in turn, we find that 7 divides 2093.
Therefore, 2093 is not a prime number.
Technique to find all primes below a given integer 𝒏
Sieve of Eratosthenes:
Step 1: List all the integers from 2 to 𝑛 in their natural order.
Step 2: Strike out all the multiples of the primes 𝑝 ≤ √𝑛 , except 𝑝 itself.
Step 3: The integers which are remaining in the list are all the primes less than 𝑛.
Page 9 of 31
For example: Find all the primes less than 100.
Solution: As √100 = 10, so we strike out only those numbers which are multiples of
2, 3, 5 and 7.
2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50
51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70
71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90
91 92 93 94 95 96 97 98 99 100
The primes less than 100 are:
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37,41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97.
Page 10 of 31
More challenges:
1. Check whether the following integers are prime. If not, then find their prime
factors:
i. 2093
ii. 509
iii. 349
iv. 209
v. 701
vi. 1009
2. Employing the 𝑆𝑖𝑒𝑣𝑒 𝑜𝑓 𝐸𝑟𝑎𝑡𝑜𝑠𝑡ℎ𝑒𝑛𝑒𝑠, Obtain all the primes between 100 and
200.
Page 11 of 31
C ONGRUENCES
Definition: Let 𝑛 be a fixed positive integer. Two integers 𝑎 and 𝑏 are said to be
congruent modulo 𝑛, symbolized by
𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛)
if 𝑛 divides the difference 𝑎 − 𝑏; i.e., (𝑎 − 𝑏) = 𝑘𝑛 for some 𝑘 ∈ ℤ.
For example:
1. 13 ≡ 3(𝑚𝑜𝑑 5), as 5 divides (13 − 3) = 10.
2. 93 ≡ 0(𝑚𝑜𝑑 3), as 3 divides (93 − 0) = 93.
3. −51 ≡ 5 (𝑚𝑜𝑑 7), as 7 divides (−51 − 5) = −56.
4. 49 ≡ −1 (𝑚𝑜𝑑 10), as 10 divides (49 − (−1)) = 50.
2. Given 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛) this implies that 𝑛 divides (𝑎 − 𝑏), which implies that 𝑛
divides −(𝑎 − 𝑏) = (𝑏 − 𝑎). Hence 𝑏 ≡ 𝑎 (𝑚𝑜𝑑 𝑛).
Page 12 of 31
4. Given 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛) and 𝑐 ≡ 𝑑 (𝑚𝑜𝑑 𝑛).
i.e., 𝑛 divides (𝑎 − 𝑏) and 𝑛 divides (𝑐 − 𝑑).
i.e., (𝑎 − 𝑏) = 𝑘1 𝑛 and (𝑐 − 𝑑) = 𝑘2 𝑛, for some 𝑘1 , 𝑘2 ∈ ℤ.
Now (𝑎 − 𝑏) + (𝑐 − 𝑑) = (𝑘1 + 𝑘2 )𝑛.
So 𝑛 divides (𝑎 − 𝑏) + (𝑐 − 𝑑) = (𝑎 + 𝑐) − (𝑏 + 𝑑)
Thus, 𝑎 + 𝑐 ≡ 𝑏 + 𝑑 (𝑚𝑜𝑑 𝑛).
Now 𝑎𝑐 = (𝑏 + 𝑘1 𝑛)(𝑑 + 𝑘2 𝑛) = 𝑏𝑑 + (𝑏𝑘2 + 𝑑𝑘1 + 𝑘1 𝑘2 𝑛)𝑛.
So 𝑎𝑐 − 𝑏𝑑 = (𝑏𝑘2 + 𝑑𝑘1 + 𝑘1 𝑘2 𝑛)𝑛.
So 𝑛 divides 𝑎𝑐 − 𝑏𝑑.
Thus 𝑎𝑐 ≡ 𝑏𝑑 (𝑚𝑜𝑑 𝑛).
Page 14 of 31
Fermat’s Little Theorem:
If 𝑝 is a prime and 𝑝 ∤ 𝑎, then 𝑎𝑝−1 ≡ 1 (𝑚𝑜𝑑 𝑝).
For example:
1. 246 ≡ 1 (𝑚𝑜𝑑 47).
2. 4547 ≡ 45 (𝑚𝑜𝑑 47).
3. 594 = 546 546 52 ≡ 25(𝑚𝑜𝑑 47).
4. 32022 = (396 )21 36 ≡ 36 (𝑚𝑜𝑑 97) ≡ 35 × 3 ≡ 49 × 3 ≡ 147 ≡ 50(𝑚𝑜𝑑 97).
5. 538 = (510 )3 58 ≡ 58 (𝑚𝑜𝑑 11) ≡ 254 ≡ 34 ≡ 81 ≡ 4 (𝑚𝑜𝑑 11).
Euler phi-function :
Let 𝑛 be a positive integer. The 𝐸𝑢𝑙𝑒𝑟 𝑝ℎ𝑖 − 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 𝜙(𝑛) is defined to be
the number of positive integers less than or equal to 𝑛 and relatively prime
(co-prime) to 𝑛.
For example:
1. 𝜙(10) = 4.
Since 1, 3, 7, 9 are less than or equal to 10 and are co-prime to 10.
2. 𝜙(7) = 6.
Since 1, 2, 3, 4, 5, 6 are less than or equal to 7 and are co-prime to 7.
3. 𝜙(15) = 8.
Since 1, 2, 4, 7, 8, 11, 13, 14 are less than or equal to 15 and are co-prime to 15.
Notes:
1. If 𝑝 is a prime number then 𝜙(𝑝𝑛 ) = 𝑝𝑛 − 𝑝𝑛−1 .
In particular, 𝜙(𝑝) = 𝑝 − 1.
2. If 𝑚, 𝑛 are two co-prime integers, then 𝜙(𝑚𝑛) = 𝜙(𝑚)𝜙(𝑛).
For example:
1. 𝜙(25) = 𝜙(52 ) = 52 − 5 = 20.
2. 𝜙(97) = 96. Since 97 is prime.
3. 𝜙(15) = 𝜙(3)𝜙(5) = 2 × 4 = 8. Since 3 and 5 are co-primes.
4. 𝜙(36) = 𝜙(22 ⋅ 32 ) = 𝜙(22 )𝜙(32 ) = (22 − 2)(32 − 3) = 12.
5. 𝜙(100) = 𝜙(22 ⋅ 52 ) = 𝜙(22 )𝜙(52 ) = (22 − 2)(52 − 5) = 40.
6. 𝜙(2022) = 𝜙(2 ⋅ 3 ⋅ 337) = 𝜙(2)𝜙(3)𝜙(337) = 1 × 2 × 336 = 672.
7. 𝜙(1729) = 𝜙(7 ⋅ 13 ⋅ 19) = 6 × 12 × 18 = 1080.
𝟏𝟕𝟐𝟗 is called 𝑯𝒂𝒓𝒅𝒚 − 𝑹𝒂𝒎𝒂𝒏𝒖𝒋𝒂𝒏 number.
Page 15 of 31
Euler’s Theorem:
If 𝑚 is a positive integer and 𝑎 is an integer with gcd(𝑎, 𝑚) = 1, then
Examples:
1. Find the last digit of 71000 .
Solution: 72 = 49 ≡ −1 (𝑚𝑜𝑑 10).
So, 71000 = (72 )500 ≡ (−1)500 ≡ 1 (𝑚𝑜𝑑 10).
Hence the last digit of 71000 is 1.
2. Find the least positive residue of 3100000 modulo 35.
Solution: Here 𝜙(35) = 𝜙(5 ⋅ 7) = 𝜙(5)𝜙(7) = 4 × 6 = 24 and gcd(3, 35) = 1.
By Euler’s Theorem,
324 ≡ 1(𝑚𝑜𝑑 35).
So,
3100000 = (324 )4166 316 ≡ 316 (𝑚𝑜𝑑 35).
Now,
33 = 81 ≡ 11 (𝑚𝑜𝑑 35)
3 ≡ 112 ≡ 121 ≡ 16 (𝑚𝑜𝑑 35)
6
Page 16 of 31
L INEAR C ONGRUENCE
Page 17 of 31
Example 2. Find all solutions of 7𝑥 ≡ 22 (𝑚𝑜𝑑 31).
Solution: Here 𝑎 = 7, 𝑏 = 22 and 𝑛 = 31.
𝑛 31 7 3
𝑎 7 3 1
q (quotient) 4 2 3
r (remainder) 3 1 0
So
gcd(31, 7) = 1 which divides 22. Therefore the congruence 7𝑥 ≡ 22 (𝑚𝑜𝑑 31)
has unique solution.
We trace back and write:
1 = 7 − 3 × 2 = 7 − (31 − 7 × 4) × 2 = 5 × 7 − 31.
Therefore,
22 = 110 × 7 − 22 × 31.
Going modulo 31 gives,
7 × 110 ≡ 22 (𝑚𝑜𝑑 31)
i.e.,
7 × 17 ≡ 22 (𝑚𝑜𝑑 31).
Hence 𝑥0 = 17 is a solution.
Page 18 of 31
𝑛 1001 128 105 23 13 10 3
𝑎 128 105 23 13 10 3 3
q (quotient) 7 1 4 1 1 3 3
r 105 23 13 10 3 𝟏 0
(remainder)
So, gcd(1001, 128) = 1 which divides 833.
Therefore the congruence 128𝑥 ≡ 833 (𝑚𝑜𝑑 1001) has unique solution.
Now we trace back and write:
1 = 10 − 3 × 3
1 = 10 − 3 × (13 − 10) = 4 × 10 − 3 × 13
1 = 4 × (23 − 13) − 3 × 13 = 4 × 23 − 7 × 13
1 = 4 × 23 − 7 × (105 − 4 × 23) = 32 × 23 − 7 × 105
1 = 32 × (128 − 105) − 7 × 105 = 32 × 128 − 39 × 105
1 = 32 × 128 − 39 × (1001 − 7 × 128) = 305 × 128 − 39 × 1001.
Going modulo 1001, we get
128 × 305 ≡ 1 (𝑚𝑜𝑑 1001).
So,
128 × (833 × 305) ≡ 833 (𝑚𝑜𝑑 1001).
i.e.,
128 × 812 ≡ 833 (𝑚𝑜𝑑 1001).
Hence 𝑥0 = 812 is a solution.
Example 5: Find the inverse of 17 modulo 21. i.e., Solve 17𝑥 ≡ 1 (𝑚𝑜𝑑 21).
Solution: Here 𝑎 = 17, 𝑏 = 1 and 𝑛 = 21.
𝑛 21 17 4
𝑎 17 4 1
q (quotient) 1 4 4
r (remainder) 4 𝟏 0
So, gcd(21, 17) = 1 which divides 1.
Therefore the congruence 17𝑥 ≡ 1 (𝑚𝑜𝑑 21) has unique solution.
Now we trace back and write:
1 = 17 − 4 × 4 = 17 − 4 × (21 − 17) = 5 × 17 − 4 × 21.
Going modulo 21, gives
17 × 5 ≡ 1 (𝑚𝑜𝑑 21).
Therefore 5 is the inverse of 17 modulo 21.
Example 6: Find the inverse of 16 modulo 17. i.e., Solve 16𝑥 ≡ 1 (𝑚𝑜𝑑 17).
Solution: Here 𝑎 = 16, 𝑏 = 1 and 𝑛 = 17.
Page 19 of 31
𝑛 17 16
𝑎 16 1
q (quotient) 1 16
r (remainder) 𝟏 0
More challenges:
1. Find all the solutions of the congruences
a) 20𝑥 ≡ 4 (𝑚𝑜𝑑 30);
b) 64𝑥 ≡ 83 (𝑚𝑜𝑑 105);
c) 20𝑥 ≡ 30 (𝑚𝑜𝑑 4);
d) 589𝑥 ≡ 209 (𝑚𝑜𝑑 817);
e) 49𝑥 ≡ 5000 (𝑚𝑜𝑑 999);
f) 57𝑥 ≡ 87 (𝑚𝑜𝑑 105).
2. How many solutions are there for each of the following congruences:
a) 15𝑥 ≡ 25 (𝑚𝑜𝑑 35);
b) 15𝑥 ≡ 24 (𝑚𝑜𝑑 35);
c) 15𝑥 ≡ 0 (𝑚𝑜𝑑 35).
Page 20 of 31
C HINESE R EMAINDER T HEOREM
Page 21 of 31
has the solution 𝑥1 = 2, 𝑥2 = 1, 𝑥3 = 1 respectively.
Thus the solution of the system is
𝑥 = 𝑎1 𝑁1 𝑥1 + 𝑎2 𝑁2 𝑥2 + ⋯ + 𝑎𝑟 𝑁𝑟 𝑥𝑟
= 2 ⋅ 35 ⋅ 2 + 3 ⋅ 21 ⋅ 1 + 2 ⋅ 15 ⋅ 1 = 233 ≡ 23 (𝑚𝑜𝑑 105)
Page 22 of 31
𝑛 𝑛 𝑛
Let 𝑛 = 𝑛1 𝑛2 𝑛3 = 1287 and let 𝑁1 = = 143, 𝑁2 = = 117, 𝑁3 = = 99.
𝑛1 𝑛2 𝑛3
Page 23 of 31
Q UADRATIC C ONGRUENCES
32 = 9 ≡ 2 (𝑚𝑜𝑑 7),
42 = 16 ≡ 2 (𝑚𝑜𝑑 7),
52 = 25 ≡ 4 (𝑚𝑜𝑑 7),
62 = 36 ≡ 1 (𝑚𝑜𝑑 7).
Page 24 of 31
(If 𝑥0 is one solution of 𝑥 2 ≡ 𝑎 (𝑚𝑜𝑑 𝑝) then 𝑝 − 𝑥0 is the other solution modulo 𝑝. )
For example:
If 𝑝 = 13 then 𝑎 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 satisfies (𝑎, 𝑝) = 1.
12 ≡ 1 (𝑚𝑜𝑑 13), 122 ≡ 1 (𝑚𝑜𝑑 13),
22 ≡ 4 (𝑚𝑜𝑑 13), 112 ≡ 4 (𝑚𝑜𝑑 13),
32 ≡ 9 (𝑚𝑜𝑑 13), 102 ≡ 9 (𝑚𝑜𝑑 13),
42 ≡ 3 (𝑚𝑜𝑑 13), 92 ≡ 3 (𝑚𝑜𝑑 13),
52 ≡ 12(𝑚𝑜𝑑 13), 82 ≡ 12 (𝑚𝑜𝑑 13),
62 ≡ 10 (𝑚𝑜𝑑 13), 72 ≡ 10 (𝑚𝑜𝑑 13).
Therefore we have,
1 3 4 9 10 12
( )=( )=( )=( )=( )=( )=1
13 13 13 13 13 13
And,
2 5 6 7 8 11
( ) = ( ) = ( ) = ( ) = ( ) = ( ) = −1.
13 13 13 13 13 13
Euler’s Criterion:
Let 𝑝 be an odd prime, 𝑎 an integer with 𝑝 ∤ 𝑎. Then
𝑎 𝑝−1
( ) = 𝑎 2 (𝑚𝑜𝑑 𝑝).
𝑝
Thus,
𝑝−1
If 𝑎 2 (𝑚𝑜𝑑 𝑝) ≡ 1 then, 𝑎 is quadratic residue of 𝑝 and
𝑝−1
If 𝑎 2 (𝑚𝑜𝑑 𝑝) ≡ −1 then, 𝑎 is quadratic nonresidue of 𝑝
Example:
Test if 8, 11, 12 are quadratic residues of 13 using Euler’s criterion.
Solution:
Page 25 of 31
𝑝−1
Here 𝑝 = 13, so = 6.
2
𝑝−1
82 = 64 ≡ −1 (𝑚𝑜𝑑 (13), so 8 2 = 86 = (82 )3 ≡ (−1)3 ≡ −1 (𝑚𝑜𝑑 𝑝).
Hence 8 is quadratic nonresidue of 13.
112 = 121 ≡ 4 (𝑚𝑜𝑑 13), so 116 ≡ (112 )3 ≡ 43 ≡ 64 ≡ −1 (𝑚𝑜𝑑 13).
Hence 11 is quadratic nonresidue of 13.
122 = 144 ≡ 1 (𝑚𝑜𝑑 13), so 126 ≡ (122 )3 ≡ 13 ≡ 1 (𝑚𝑜𝑑 13).
Hence 12 is quadratic residue of 13.
Theorem 2:
Let 𝑝 be an odd prime and 𝑎 and 𝑏 be integers which are co-prime to 𝑝. Then the
Legendre symbol has the following properties:’
𝑎 𝑏
1. If 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑝), then (𝑝) = (𝑝).
𝑎2 1
2. ( 𝑝 ) = 1. In particular, (𝑝) = 1.
𝑎𝑏 𝑎 𝑏
3. ( 𝑝 ) = (𝑝) (𝑝).
Corollary:
If 𝑝 is an odd prime, then
−1 1 𝑖𝑓 𝑝 ≡ 1 (𝑚𝑜𝑑 4)
( )={ .
𝑝 −1 𝑖𝑓 𝑝 ≡ 3 (𝑚𝑜𝑑 4)
For example:
−1
1. ( 43 ) = −1. Since 43 ≡ 3 (𝑚𝑜𝑑 4).
−1
2. ( 41 ) = 1. Since 41 ≡ 1 (𝑚𝑜𝑑 4).
−38 −1 38 38
( ) = ( )( ) = ( )
13 13 13 13
Since 13 ≡ 1 (𝑚𝑜𝑑 4). Now 38 ≡ 12 (𝑚𝑜𝑑 13), so
Page 26 of 31
−38 38 12 22 3 3
( ) = ( ) = ( ) = ( ) ( ) = ( ).
13 13 13 13 13 13
13−1
3
But (13) = 3 2 = 36 = (33 )3 = (27)3 ≡ 13 ≡ 1 (𝑚𝑜𝑑 13).
−38
Therefore ( 13 ) = 1.
Prove that
a) 1272 is a quadratic residue of 43.
b) 319 is a quadratic residue of 7.
c) 530 is a quadratic residue of 193.
Solution:
1272 25 52
a) Here 1272 ≡ 25 (𝑚𝑜𝑑 43), so ( ) = (43) = (43) = 1.
43
319 4 22
b) Here 319 ≡ 4 (𝑚𝑜𝑑 7), so ( ) = (7) = ( 7 ) = 1.
7
530 144 122
c) Here 530 ≡ 144 (𝑚𝑜𝑑 193), so (193) = (193) = (193) = 1.
Prove that
a) 27 is a quadratic nonresidue of 31.
b) −882 is a quadratic nonresidue of 37.
Solution:
31−1
27 33 32 3 3
a) Here 27 = 33 , so (31) = (31) = (31) (31) = (31) = 3 2 ≡ 315 (𝑚𝑜𝑑 31).
Now 33 = 27 ≡ −4 (𝑚𝑜𝑑 31),
So 39 = (33 )3 ≡ (−4)3 ≡ −64 (𝑚𝑜𝑑 31) = −2 (𝑚𝑜𝑑 31).
Hence 315 = 39 33 33 ≡ (−2)(−4)(−4) ≡ −32 ≡ −1 (𝑚𝑜𝑑 31).
27
Therefore (31) = −1.
−882 −1 882 882
b) As 37 ≡ 1 (𝑚𝑜𝑑 4), so ( ) = ( 37 ) ( 37 ) = ( 37 ).
37
Now 882 ≡ 31 (𝑚𝑜𝑑 37) ≡ −6 (𝑚𝑜𝑑 37).
37−1
882 −6 −1 6 6
So ( 37 ) = ( 37 ) = ( 37 ) (37) = (37) = 6 2 (𝑚𝑜𝑑 37) = 618 (𝑚𝑜𝑑 37).
But 62 = 36 ≡ −1 (𝑚𝑜𝑑 37), so 618 = (62 )9 ≡ (−1)9 ≡ −1 (𝑚𝑜𝑑 37).
882
Therefore ( 37 ) = −1.
Page 27 of 31
Theorem 3:
If 𝑝 is an odd prime, then
2 𝑝2 −1
( ) = (−1) 8 .
𝑝
Theorem 4 (Gauss’ Quadratic Reciprocity Law):
If 𝑝 and 𝑞 are distinct odd primes, then
𝑝 𝑞 𝑝−1 𝑞−1
( ) ( ) = (−1)( 2 )( 2 ) .
𝑞 𝑝
Corollary 1:
If 𝑝 and 𝑞 are distinct odd primes, then
𝑝 𝑞 1 𝑖𝑓 𝑝 ≡ 1 (𝑚𝑜𝑑 4) 𝑜𝑟 𝑞 ≡ 1(𝑚𝑜𝑑 4)
( )( ) = { .
𝑞 𝑝 −1 𝑖𝑓 𝑝 ≡ 𝑞 ≡ 3 (𝑚𝑜𝑑 4)
Corollary 2:
If 𝑝 and 𝑞 are distinct odd primes, then
𝑞
( ) 𝑖𝑓 𝑝 ≡ 1 (𝑚𝑜𝑑 4) 𝑜𝑟 𝑞 ≡ 1(𝑚𝑜𝑑 4)
𝑝 𝑝
( )={ 𝑞 .
𝑞 − ( ) 𝑖𝑓 𝑝 ≡ 𝑞 ≡ 3 (𝑚𝑜𝑑 4)
𝑝
Evaluate the following:
29
a) (53)
71
b) (73)
3
c) (991)
Solution:
a) As both 29 and 53 are odd primes and 29 ≡ 1 (𝑚𝑜𝑑 4).
So
29 53 14 2 7 2 29
( ) = ( ) = ( ) = ( )( ) = ( )( )
53 29 29 29 29 29 7
2 1 2 292 −1
= ( ) ( ) = ( ) = (−1) 8 = (−1)105 = −1.
29 7 29
Page 28 of 31
71 73 2 712 −1
( ) = ( ) = ( ) = (−1) 8 = (−1)130 = 1.
73 71 71
c) As both 111 and 3 are odd primes and 991 ≡ 3 (𝑚𝑜𝑑 4) and 3 ≡ 3 (𝑚𝑜𝑑 4).
So,
3 991 1
( ) = −( ) = − ( ) = −1.
991 3 3
Example: Determine whether there is an integer 𝑥 such that 37 divides 𝑥 2 − 31𝑥 + 34.
Solution:
This can be answered by solving
𝑥 2 − 31𝑥 + 34 ≡ 0 (𝑚𝑜𝑑 37)
𝑥 2 + 6𝑥 − 3 ≡ 0 (𝑚𝑜𝑑 37)
𝑥 2 + 6𝑥 + 12 − 3 ≡ 12 (𝑚𝑜𝑑 37)
(𝑥 + 3)2 ≡ 12 (𝑚𝑜𝑑 37)
Therefore question comes down to whether 12 is a perfect square modulo 37.
12
Which can be answered by finding the Legendre symbol (37).
12 22 3 3 37−1
( ) = ( ) ( ) = ( ) = 3 2 (𝑚𝑜𝑑 37).
37 37 37 37
Page 29 of 31
Definition (Jacobi Symbol):
𝑡 𝑡 𝑡
Let 𝑛 be an odd positive integer with prime factorization 𝑛 = 𝑝11 𝑝22 … 𝑝𝑚𝑚 and let 𝑎
𝑎
be a positive integer with (𝑎, 𝑛) = 1. Then the Jacobi symbol (𝑛) is defined by
𝑎 𝑎 𝑎 𝑡1 𝑎 𝑡2 𝑎 𝑡𝑚
( ) = ( 𝑡1 𝑡2 𝑡 ) = (𝑝 ) (𝑝 ) … (𝑝 ) .
𝑛 𝑝1 𝑝2 … 𝑝𝑚𝑚 1 2 𝑚
Note:
1. When 𝑛 is prime, the Jacobi symbol is the same as the Legendre Symbol.
𝑎
2. When 𝑛 is composite, the value of (𝑛) does not tell us whether the congruence
𝑥 2 ≡ 𝑎 (𝑚𝑜𝑑 𝑛) has a solution.
For example:
32 −1 52 −1
2 2 2
i. (15) = (3) (5) = (−1) 8 (−1) 8 = (−1)(−1) = 1.
But 𝑥 2 ≡ 2 (𝑚𝑜𝑑 15) has no solution.
4 22 22
ii. (15) = ( 3 ) ( 5 ) = 1 ⋅ 1 = 1.
And the congruence 𝑥 2 ≡ 4 (𝑚𝑜𝑑 15) has a solution, namely 𝑥 = 2.
Theorem 5:
Let 𝑛 be an odd positive integer and let 𝑎 and 𝑏 be integers co-prime to 𝑛. Then
𝑎 𝑏
a) If 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛), then (𝑛) = (𝑛),
𝑛−1
−1
b) ( 𝑛 ) = (−1) 2 ,
𝑛2 −1
2
c) (𝑛) = (−1) 8 .
Theorem 6:
Let 𝑛 and 𝑚 be co-prime odd positive integers. Then
𝑛 𝑚 𝑚−1 𝑛−1
( ) ( ) = (−1)( 2 )( 2 ) .
𝑚 𝑛
Evaluate the following Jacobi symbols
5
a) (21)
1009
b) (2307)
27
c) (101)
2663
d) (3299)
Page 30 of 31
111
e) (1001)
10001
f) (20003)
Solution:
5−1 7−1
5 5 5 3 5
a) (21) = (3) (7) = (5) (7) = 3 2 (𝑚𝑜𝑑 5) 5 2 (𝑚𝑜𝑑 7) = (−1)(−1) = 1.
1009 1009 1009 1 240 240
b) (2307) = ( ) ( 769 ) = (3) (769) = (769)
3
42 5 3 769 769 4 1
= (769) (769) (769) = ( )( ) = (5) (3) = 1.
5 3
3−1
27 32 3 101 2
c) (101) = (101) (101) = ( ) = (3) = 2 2 (𝑚𝑜𝑑 3) = −1.
3
2663
d) ( )=
3299
Page 31 of 31