0% found this document useful (0 votes)
75 views6 pages

Modular Arithmetic: The Beginning: 1 Divisibility

Euler's theorem states that if a and m are co-prime integers, then a^φ(m) is congruent to 1 modulo m, where φ(m) is Euler's totient function. Euler's totient function φ(m) counts the number of positive integers less than m that are relatively prime to m. The document provides examples of calculating φ(m) and its properties, which allow computing φ(m) for large m by breaking it down into prime factors. Proofs of Euler's theorem and properties of φ(m) are also outlined.

Uploaded by

Silver Blaze
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views6 pages

Modular Arithmetic: The Beginning: 1 Divisibility

Euler's theorem states that if a and m are co-prime integers, then a^φ(m) is congruent to 1 modulo m, where φ(m) is Euler's totient function. Euler's totient function φ(m) counts the number of positive integers less than m that are relatively prime to m. The document provides examples of calculating φ(m) and its properties, which allow computing φ(m) for large m by breaking it down into prime factors. Proofs of Euler's theorem and properties of φ(m) are also outlined.

Uploaded by

Silver Blaze
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Modular Arithmetic: The Beginning

Zim Mim Siddiqee Sowdha


15 February 2020

1 Divisibility
We call an integer a a multiple of another integer m, if m completely divides
a - that is, upon dividing a by m we get 0 as our remainder. For brevity, this
statement ”a is a multiple of m” or ”m divides a” is denoted as m|a.
For example, 12 is a multiple of 4 - this is denoted by 4|12. Similarly one can
state that 6|36 or 2|2n for all integral values of n. However, stating 5|12 would
be wrong, as 12 is not a multiple of 5.
The above notation can also be rephrased as below:

a|b ⇒ b = ma for some m ∈ Z

1.1 Basic Properties of Divisibility


Assume a, b, c, d, m are all integers and m|a, m|b. Then the following properties
always hold - no matter which integers you choose:

1. m|ka when k ∈ Z

2. m|a + b, m|a − b
3. m|ka ± lb when k, l ∈ Z
4. If m|a + c for some c ∈ Z, then m|c

5. If m|a − b and m|c − d, then m|ac − bd


The proofs of the first four claims are quite trivial, which we represent below:

1. m|a means a is a multiple of m. So a = a1 m for some a1 ∈ Z. Hence


ka = ka1 m = (ka1 )m - and so it is also a multiple of m.

2. m|a, m|b implies a = a1 m, b = b1 m for some a1 , b1 ∈ Z. So a ± b =


a1 m ± b1 m = m(a1 ± b1 ) implying that m divides a ± b.

1
3. This one just a combined result of (1) and (2).
4. m|a + c and m|a. Now applying the second part of property (2), m|(a +
c) − a ⇒ m|c.

The proof of the fifth property needs a little bit of calculation, which we show
below:

(a − b)(c − d)
= ac − ad − bc + bd
= ac − bd + 2bd − ad − bc
= ac − bd + bd − ad + bd − bc
= ac − bd − d(a − b) − b(c − d)
⇒ ac − bd = (a − b)(c − d) + d(a − b) + b(c − d)

The right hand side is a multiple of m, and so the left hand side must also
be divided by m.

1.2 Exercises
This section will contain some really easy exercises. They can make you feel
to ignore them - however, working them out will be quite helpful for our next
steps.
1. The sum of two prime numbers is 999. What are the numbers?
2. p2 + p has two prime divisors. Find out all the possible values of p.

3. (Division Algorithm) Prove that for any two integers a and b (b 6= 0),
there exist unique integers q and r such that a = bq + r and 0 ≤ r < b.

2 Congruence
Congruence is the backbone of modular arithmetic. Let a, b, and m be integers,
with m 6= 0. We say that a and b are congruent modulo m if a and b have the
same remainders when they are divided by m. For example, let m=13, a=43
and b=17. Here 43 and 17 have the same remainder 4 when they are divided
by 13. There is a good way to represent this.

43 ≡ 17(mod 13)
Again, note that 43 ≡ 4(mod 13) is also true. Because 4 gives remainder 4
when divided by 13. Now we’ll look at some basic properties of congruence:

2
2.1 Basic Properties of Congruence
1. If a ≡ b(mod m) then m divides a − b. In other words, if a ≡ 0(mod m)
then m|a.
2. a ≡ a(mod m) (reflexivity).
3. a ≡ b(mod m) and b ≡ c(mod m), then a ≡ c(mod m) (transitivity).
4. If a ≡ b(mod m), then b ≡ a(mod m).
5. a ≡ b(mod m) and c ≡ d(mod m), then a + c ≡ b + d(mod m) and a − c ≡
b − d(mod m).
6. If a ≡ b(mod m), then for any integer k, ka ≡ kb(mod m).
7. If ka ≡ kb(mod m) for any integer k which is co-prime to m, then a ≡
b(mod m)
8. If a ≡ b(mod m) and c ≡ d(mod m), then ac ≡ bd(mod m). In general, if
ai ≡ bi (mod m), i = 1, ..., k, then a1 ...ak ≡ b1 ...bk (mod m). In particular,
if a ≡ b(mod m), then for any positive integer k, ak ≡ bk (mod m).
9. We have a ≡ b(mod mi ), i = 1, ..., k, if and only if a ≡ b(mod lcm(m1 , ..., mk )).In
particular, if m1 , ..., mk are pairwise relatively prime, then a ≡ b(mod mi ),
i = 1, ..., k, if and only if a ≡ b(mod m1 ...mk ).

3 Reduced Residue System


Let us consider a positive integer, 8, for the sake of discussion. Now, when
considering remainders upon dividing any integers by 8, only these integers will
occur: 0, 1, 2, 3, 4, 5, 6, 7. In the world of modular arithmetic, these numbers are
the elements of a Residue System with respect to 8. We represent this fact as
the following: {0, 1, 2, 3, 4, 5, 6, 7}(mod 8)
In general, Residue System of a positive integer n is S = {0, 1, 2, 3, . . . , (n − 1)}
and we write this as {0, 1, 2, 3, . . . , (n − 1)} (mod n).

Remark. Residue system for a positive integer needs not to be unique. For
example, one can consider {8, 9, 10, 11, 12, 13, 14, 15} to be a residue system with
respect to 8 too - as the elements of this set are actually same as the elements
of the previous set if we consider them modulo 8.
Now, let us look into something more special. we will now consider a
residue system of 12 where the elements are strictly less than 12 - which is
S = {0, 1, 2, . . . , 11}. Now, some elements of this set are co-prime with 12 (Re-
call that if a and b has 1 as their Greatest Common Divisor, we call a and b
co-prime numbers). These numbers are 1, 5, 7, 11. If we consider these numbers
as elements of a specific set, we call that set a Reduced Residue System modulo
12.

3
Generally speaking, a Reduced Residue System of a positive integer n will be
the set of positive integers where (i) each element is strictly less than n and
(ii) each element is co-prime with n.For brevity, we will call this set the RRS
modulo n.

For example, residue set for 8 is {0, 1, 2, 3, 4, 5, 6, 7} and so the RRS modulo
8 will be {1, 3, 5, 7}. Similarly, residue system of 14 is {0, 1, 2, 3, . . . , 13} which
implies that RRS modulo 14 is {1, 3, 5, 9, 11, 13}.

3.1 Exercises
1. Find out the RRS’ for the following cases: (i) modulo 16 (ii) modulo 23
(iii) modulo 24.
2. What will one get when considering the RRS modulo a prime?
3. Suppose {a1 , a2 , a3 , . . . , an } is an RRS modulo m. Show that {ka1 , ka2 , ka3 , . . . , kan }
is also an RRS modulo m for any integer k co-prime with m.

4 Euler’s Totient Function


Euler’s Totient function for an integer m is denoted by φ(m). The function is
described as follows:
φ(m) = The number of elements in the RRS modulo m
For example, φ(6) = 2, as RRS modulo 6 = {1, 5}. Again, RRS modulo
10 = {1, 3, 7, 9} and so φ(10) = 4.
If you have already worked out the last one from Exercise 3.1, the following
property should seem trivial to you:

Property 4.1. φ(p) = p − 1, when p is a prime.


Now you might notice that finding out the value of this function for big
values of m seems quite difficult - as you have to find the RRS first. However,
using our following property and the property mentioned above, one can easily
find totient function values of huge numbers. So here it goes -

Property 4.2. If integers a and b are co-prime, then φ(ab) = φ(a)φ(b)


Proof. Arrange the integers 1, 2, 3, . . . , ab into an a × b array as follows:

1 2 3 ... a
a+1 a+2 a+3 ... 2a
.. .. .. .. ..
. . . . .
a(b − 1) + 1 a(b − 1) + 2 a(b − 1) + 3 ... ab

4
Clearly, there are φ(ab) numbers in the above table that are relatively prime (in
other words, co-prime) to ab.
On the other hand, there are φ(a) columns containing those elements in the table
which are co-prime to a. Each of those columns is a complete residue system
modulo b. Hence there are exactly φ(b) elements in each of those columns that
are co-prime to b. Therefore, there are φ(a)φ(b) numbers in the table that are
relatively prime to ab.
Hence φ(ab) = φ(a)φ(b) for relatively prime integers a, b.
The last property can be extended to produce a stronger and more gener-
alised property, which we show below. Readers are encouraged to ponder over
the procedures to prove it.

Property 4.3. If integers x1 , x2 , x3 , . . . , xn are pairwise co-prime (that is any


two of these integers are co-prime to each other), then φ(x1 x2 x3 . . . xn ) =
φ(x1 )φ(x2 )φ(x3 ) . . . φ(xn )

We will end this section with a final property, which makes finding out the
values of totient functions of integers which contains large powers of primes
WAY easier.

Property 4.4. φ(pk ) = pk − pk−1 , when p is a prime and k ∈ Z

Proof. There are pk positive integers less than or equal to pk . Among these
integers those who are not co-prime with pk are p, 2p, 3p, . . . , pk−1 .p - which
means pk−1 numbers. So, there are (pk − pk−1 ) numbers co-prime with pk ,
which proves the property.

5 Euler’s Theorem
Euler’s theorem shows why totient functions are really useful in the realms of
modular arithmetic. The theorem is as follows:

Theorem 1. (Euler’s Theorem) If a, m are co-prime integers, then aφ(m) ≡ 1


(mod m)
Proof. Consider the RRS modulo m which is {a1 , a2 , a3 , . . . , aφ(m) . As gcd(a, m) =
1, by exercise 3 from Exercise 3.1 we can say that {aa1 , aa2 , aa3 , . . . , aaφ(m) is
another RRS modulo m. So,
(aa1 )(aa2 )(aa3 ) . . . (aaφ(m) ) ≡ (a1 )(a2 )(a3 ) . . . (aφ(m) ) (mod m)
⇒ a.a.a . . . .a.(a1 )(a2 )(a3 ) . . . (aφ(m) ) ≡ (a1 )(a2 )(a3 ) . . . (aφ(m) ) (mod m)
⇒ aφ(m) .(a1 )(a2 )(a3 ) . . . (aφ(m) ) ≡ (a1 )(a2 )(a3 ) . . . (aφ(m) ) (mod m)

5
As gcd(ai , m) for 0 ≤ i ≤ φ(m), using basic property 7 of congruence, we can
cancel out all the ai ’s from both sides, which will finally yield aφ(m) ≡ 1 (mod
m).
Now if we replace m in Euler’s theorem with a prime number p, we get a
much more convenient form (Recall that φ(p) = p − 1). This form is popularly
known as Fermat’s Little Theorem, which we show below:
Theorem 2. (Fermat’s Little Theorem) If p is a prime and a is an integer
co-prime with p, then ap−1 ≡ 1 (mod p). This can also be written as ap ≡ a
(mod p)

6 Walkthroughs
Problem 6.1. Find the remainder when 2910 is divided by 9.
Solution. Okay so, if you were a person who didn’t know modular arithmetic,
you’d probably be intimidated because 2910 is something you cant possibly cal-
culate if you didn’t have a calculator. But, with modular arithmetic, it’s pretty
easy:

2910 ≡ 210 (mod 9)


And 210 is just 1024 which has remainder 7 when divided by 9. See? wasn’t
that easy?
Problem 6.2. Find the rightmost digit of 3202 .
Solution. Well, the rightmost digit is just the remainder when divided by 10,
that is modulo 10. Here,
3202 ≡ 9101 ≡ (−1)101 ≡ (−1) × (−1)100 ≡ (−1) × 150 ≡ −1 ≡ 9 (mod 10)
So, the rightmost digit is 9. To find the rightmost 2 digits or 3 digits, take
modulo 100, 1000 and so on.
Problem 6.3. Let p be a prime. Prove that p divides abp − bap for all integers
a and b.
Solution. Note that abp − bap = ab(bp−1 − ap−1 ). If p|ab, then p|abp − bap ;
if p - ab, then gcd(p, a) = gcd(p, b) = 1, and so bp−1 ≡ ap−1 ≡ 1 (mod p),
by Fermat’s little theorem. Hence p|bp−1 − ap−1 , implying that p|abp − bap .
Therefore, p|abp − bap for all p.
Problem 6.4. Prove that for any even positive integer n, n2 − 1 divides 2n! − 1
.
Solution. Proof: Let m = n + 1. We need to prove that m(m − 2) divides
2(m−1)! − 1. Because φ(m) divides (m − 1)! we have (2φ(m) − 1) | (2(m−1)! − 1)
and from Euler’s theorem, m | (2φ(m) − 1). It follows that m | (2(m−1)! − 1).
Similarly, m − 2 | (2(m−1)! − 1). Because m is odd, gcd(m, m − 2) = 1 and the
conclusion follows.

You might also like