Use Modular Exponentiation To Find: I) - Ii) Iii)
Use Modular Exponentiation To Find: I) - Ii) Iii)
644
i)7 𝑚𝑜𝑑 645.
2003
ii)3 𝑚𝑜𝑑 99.
329
iii)242 𝑚𝑜𝑑 243.
Solution:
i) Algorithm 5 initially sets x = 1 and power = 7 mod 645 = 7.
In the computation of 7^644 mod 645, this algorithm determines 7^(2^j) mod 645 for j =
1, 2, . . . , 9 by successively squaring and reducing modulo 645. If a j = 1 (where a j is the
bit in the j th position in the binary expansion of 644, which is (1010000100)2 ), it
multiplies the current value of x by 7^(2^j) mod 645 and reduces the result modulo 645.
Here are the steps used:
i =0 Because a0 = 0, we have x = 1 and power = 7^2 mod 645 =49 mod 645=49;
i =1 Because a1 = 0, we have x = 1 and power = 49^2 mod 645 = 2401 mod 645 =466;
i =2 Because a2 = 1, we have x = 1·466 mod 645 =466 and power = 466^2 mod 645
=217156 mod 645 = 436;
i =3 Because a3 = 0, we have x = 466 and power = 436^2 mod 645 = 190096 mod 645 =
466;
i =4 Because a4 = 0, we have x = 466 and power = 466^2 mod 645 = 217156 mod 645 =
436;
i =5 Because a5 = 0, we have x = 466 and power = 436^2 mod 645 = 190096 mod 645 =
466;
i =6 Because a6 = 0, we have x = 466 and power = 466^2 mod 645 = 217156 mod 645 =
436;
i =7 Because a7 = 1, we have x = 466·436 mod 645 = 1 and power = 436^2 mod 645
=190096 mod 645 = 466;
i =8 Because a8 = 0, we have x = 1 and power = 466^2 mod 645 = 217156 mod 645 =
436;
i =9 Because a9 = 1, we have x = 1·436 mod 645 = 436.
power=3 mod 99 =3
When a_i=1 then x is first multiplied by the power and reduced modulo 99.
Then on each iteration the power is multiplied by itself and reduced modulo 99.
3. Let a, b,c, and d be integers, where a ≠ 0 such that a | c and b | d, then prove that
ab | cd.
Solution:
DEFINITIONS
2
4. Prove that if n is an odd positive integer, then 𝑛 ≡ 1 (mod 8).
Solution:
If n is odd, we can write n =2k +1 for some integer k.
2 2 2
Then 𝑛 = (2𝑘 + 1) = 4𝑘 + 4𝑘 + 1
2 2
To show that 𝑛 ≡ 1 (mod 8), it is sufficient to show that 8|𝑛 − 1. We have that
2 2
𝑛 − 1 = 4𝑘 + 4𝑘 =4k(k +1). Now, we have two cases to consider: if k is even, there
2
is some integer d such that k =2d. Then 𝑛 −1=4(2d)(2d+1)=8d(d+1), and clearly this is
divisible by 8 since it is a multiple of 8. If k is odd, then there is some integer d such that
2
k =2d+1. Then 𝑛 =4(2d+1)(2d+2)=8(2d+1)(d+1), and again, this is divisible by 8. Thus,
2 2
in both cases, 𝑛 −1is divisible by 8, so 𝑛 ≡ 1 (mod 8).
PROOF
Let p_1,p_2,...,p_k be the primes in the prime factorization in either aa or bb. Then the
prime factorization of aa and bb is of the form:
The prime factorizations of the numbers have been given. The prime factorization of the
greatest common divisor then contains all common primes in the prime factorizations of a
and b, where its power is the minimum of the powers of the prime in the prime
factorization of a and b.
gcd(a,b)=p_1^min(a_1,b_1).p_2^min(a_2,b_2). p_k^min(a_k,b_k)
The prime factorizations of the numbers have been given. The prime factorization of the
least common multiple then contains all primes in the prime factorizations of a and b,
where its power is the maximum of the powers of the prime in the prime factorization of
a and b.
9. Determine whether the integers in each of these sets are pairwise relatively prime:
i)14,17,85.
ii)21,34,55.
iii) 25, 41, 49, 64.
iv) 17, 18, 19, 23.
Solution:
i)Let us determine the prime factorization of each integer:
14=2⋅7
17=17
85=5⋅17
Let us use the prime factorizations to determine the greatest common divisor of each pair
of the given integers.
gcd(14,17)=1
gcd(14,85)=1
gcd(17,85)=17
The integers are then not pairwise relatively prime, because there exists a pair of integers
that has a greatest common divisor different from 1.
ii)Let us determine the prime factorization of each integer:
21=3⋅7
34=2⋅17
55=5⋅11
Let us use the prime factorizations to determine the greatest common divisor of each pair
of the given integers.
gcd(21,34)=1
gcd(21,55)=1
gcd(34,55)=1
The integers are then pairwise relatively prime, because all greatest common divisors are
equal to 1.
iii)Let us determine the prime factorization of each integer:
25=5^2
41=41
49=7^2
64=2^6
et us use the prime factorizations to determine the greatest common divisor of each pair
L
of the given integers.
gcd(25,41)=1
gcd(25,49)=1
gcd(25,64)=1
gcd(41,49)=1
gcd(41,64)=1
gcd(49,64)=1
The integers are then pairwise relatively prime, because all greatest common divisors are
equal to 1.
iv)Let us determine the prime factorization of each integer:
17=17
18=2⋅3^2
19=19
23=23
Let us use the prime factorizations to determine the greatest common divisor of each pair
of the given integers.
gcd(17,18)=1
gcd(17,19)=1
gcd(17,23)=1
gcd(18,19)=1
gcd(18,23)=1
gcd(19,23)=1
The integers are then pairwise relatively prime because all greatest common divisors are
equal to 1
10. Express the greatest common divisor of each of these pairs of integers as a linear
combination of these integers.
i) 252,198.
ii) 35,78.
iii) 33,44.
Solution:
i) The Euclidean algorithm uses these divisions:
252 = 1 · 198 + 54
198 = 3 · 54 + 36
54 = 1 · 36 + 18
36 = 2 · 18.
Using the next-to-last division (the third division), we can express gcd(252, 198) = 18 as
a linear combination of 54 and 36. We find that
18 = 54 − 1 · 36.
The second division tells us that
36 = 198 − 3 · 54.
Substituting this expression for 36 into the previous equation, we can express 18 as a
linear combination of 54 and 198.We have
18 = 54 − 1 · 36 = 54 − 1 · (198 − 3 · 54) = 4 · 54 − 1 · 198.
The first division tells us that
54 = 252 − 1 · 198.
Substituting this expression for 54 into the previous equation, we can express 18 as a
linear combination of 252 and 198. We conclude that
18 = 4 · (252 − 1 · 198) − 1 · 198 = 4 · 252 − 5 · 198
ii)The Euclidean algorithm starts by dividing the largest integer by the smallest. The
divisor is then divided by the remainder in the following steps until we obtain a
remainder of 0.
78=2⋅35+8
35=4⋅8+3
8=2⋅3+2
3=1⋅2+1
2=2⋅1
The greatest common divisor is then the last nonzero remainder: gcd(35, 78)=1.
By solving the 4th equation of the Euclidean algorithm to the greatest common divisor,
we then obtain:
gcd(35,78)=1
=3−1⋅2
=1⋅3+(−1)⋅2
=1⋅3+(−1)⋅(8−2⋅3)
=3⋅3+(−1)⋅8
=3⋅(35−4⋅8)+(−1)⋅8
=3⋅35+(−13)⋅8
=3⋅35+(−13)⋅(78−2⋅35)
=29⋅35+(−13)⋅78
iii)The Euclidean algorithm starts by dividing the largest integer by the smallest. The
divisor is then divided by the remainder in the following steps until we obtain a
remainder of 0.
44=1.33+11
33=3⋅11
The greatest common divisor is then the last nonzero remainder: gcd(33, 44)=11
By solving the first equation of the Euclidean algorithm to the greatest common divisor,
we then obtain:
gcd(33, 44)=1=44-1.33=1.44+(-1).33
11. Find the greatest common divisors and the least common multiples of the following
Pairs:
13 17 12 21
i)3 . 5 , 2 . 7
11 9 14
ii)2 · 3 · 5 · 7 · 11 · 13,2 . 3 . 11. 17
iii)41 · 43 · 53 , 41 · 43 · 53
Solution:
i)We note that the two prime factorizations have no factors in common, then the greatest
common divisor is 1.
gcd(a,b)=1.
12 13 17 21
lcm(a,b)=2 . 3 . 5 . 7
ii) gcd(a,b)
𝑚𝑖𝑛(1,11) 𝑚𝑖𝑛(1,9)
2 .3 . 11
=66.
lcm(a,b)=2.3.11
12. Show that if a, b, and m are integers such that m ≥ 2 and a ≡ b (mod m), then
gcd(a,m) = gcd(b,m).
Solution:
DEFINITIONS
a divides b if there exists an integer c such that b=ac
Notation: a|b
a is congruent to b modulo m if m divides a-b
Notation: a≡b(mod m)
Given: a, b and m are integers with m≥2
a≡b(mod m)
To proof: gcd(a,m)=gcd(b,m)
PROOF
Since a≡b(mod m), m divides a-b and thus there exists an integer c such that: a-b=mc or
equivalently a=mc+b.
Let us define the constants A and B as:
A=gcd(a,m)
B=gcd(b,m)
The greatest common divisor of two integers divides both integers:
A|a A|m B|b B|m
Since a=mc+b, A|a and A∣m implies A|b
A|b
Since a=mc+b, B|b and B∣m implies B|a
B|a
If an integer divides two integers, then the integer also divides their greatest common
divisor:
A|gcd(b,m)
B|gcd(a,m)
Since A=gcd(a,m) and B=gcd(b,m)
A|B
B|A
A∣B and B|A then imply A=B
gcd(a,m)=gcd(b,m).
7 8 2 11
13. If the product of two integers is 2 3 5 7 and their greatest common divisor is
3 4
2 3 5, what is their least common multiple?
Solution:-
we know that the product of the greatest common divisor and the least common multiple of two
7 8 2 11 3 4 4 4 11
2 3 5 7 /2 3 5=2 . 3 . 5. 7
14. Find the greatest common divisor of the following pair of numbers using the
Euclidean
Algorithm:
i) 11111, 111111.
ii) 1529, 14038.
iii) 750,900.
iv) 414,662.
Solution:-
To apply the Euclidean algorithm, we divide the larger number by the smaller, replace
the larger by the smaller and the smaller by the remainder of this division, and repeat this
process until the remainder is 0. At that point, the smaller number is the greatest common
divisor.
Solution:-
Therefore, 7 divisions are required to find gcd(21, 34) using the Euclidean algorithm.