0% found this document useful (0 votes)
12 views37 pages

What Is Modular Arithmetic, and How Can It Be Applied To Solve Problems in The Field of Number Theor

Uploaded by

xing.isaac
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)
12 views37 pages

What Is Modular Arithmetic, and How Can It Be Applied To Solve Problems in The Field of Number Theor

Uploaded by

xing.isaac
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/ 37

Downloaded from www.clastify.

com by Isaac Xing

Extended Essay

Mathematics

om
What is modular arithmetic, and how can l.c
ai
gm

it be applied to solve problems in the field


c@
aa

of number theory?
.is
ng
xi
ify

An essay on linear congruences and their uses


ast
Cl

Word count: [3989]


Downloaded from www.clastify.com by Isaac Xing

Contents

1 Introduction

2 Modular Arithmetic

2.1 Introduction

2.2 Operational Properties

om
l.c
3 Significant Theorems ai
gm
c@

3.1 The Chinese Remainder Theorem


aa
.is

3.2 Fermat’s Little Theorem


ng
xi
ify

4 Divisibility Tests
ast
Cl

5 Number Theory Problems

6 Conclusion

7 Appendices

8 Bibliography

2
Downloaded from www.clastify.com by Isaac Xing

1 Introduction

In this essay, I will answer the research question, ‘What is modular arithmetic,

and how can it be applied to solve problems in the field of number theory?’

Initially, the basic concept of modular arithmetic will be introduced, before

establishing its foundational properties. Subsequently, I will set out two

significant theorems that are central to the topic and to the 5 original solutions

to number theory problems that I will present in the last section of my essay, the

majority of which are posed by the United Kingdom Mathematics Trust (UKMT).

om
l.c
A variety of sources were used in my research, including the online resources
ai
gm

Encyclopaedia Britannica [1] and Brilliant.org [2] and the books Concepts of
c@

Modern Mathematics [3] and Concrete Mathematics [4].


aa
.is
ng
xi

Modular arithmetic is a topic that has tremendous significance and applicability


ify

in pure mathematics, principally in number theory, along with practical uses in


a st
Cl

cryptography and checksum calculations. Having been a keen participant in

UKMT Mathematics Challenges since I was 13, I find modular arithmetic

particularly compelling as it can be utilised in order to produce succinct and

elegant solutions to the types of questions I have enjoyed doing for several years.

The aim of this essay is two-fold: to outline what modular arithmetic is and to

clearly demonstrate its usefulness in solving number theory problems, as

evidenced by my own original solutions.

3
Downloaded from www.clastify.com by Isaac Xing

2 Modular Arithmetic

2.1 Introduction

Established by Carl Friedrich Gauss in his 1801 book ‘Disquisitiones

Arithmeticae’ (Arithmetical Investigations) [3], modular arithmetic is a system of

arithmetic solely concerned with the remainders of integers when they are

divided by a chosen value, called the modulus. Gauss introduced the following

notation:

om
l.c
ai
Let a, b, r ∈ ℤ and n ∈ ℤ+.
gm

The remainder, r, when a is divided by the modulus, n, is denoted by:


c@
aa

𝑎 ≡ 𝑟 (mod 𝑛).
.is
ng
xi

If a and b have the same remainder when divided by n, they are congruent
ify
st

modulo n. This is written as:


a
Cl

𝑎 ≡ 𝑏 (mod 𝑛)

or

𝑎 mod 𝑛 = 𝑏 mod 𝑛 .

For example,

16 ≡ 9 (mod 7)

because 16 and 9 both leave a remainder of 2 when divided by 7.

4
Downloaded from www.clastify.com by Isaac Xing

Modular arithmetic is sometimes referred to as ‘clock arithmetic’, because

working out the time on a 12-hour clock is the same as calculating a certain

value, modulo 12.

Figure 1 – Modular arithmetic in timekeeping [5]

om
l.c
ai
For instance, our typical system of arithmetic would tell us that 4 hours after 9
gm
c@

o’clock would be 13 o’clock. However, since numbers on a clock ‘wrap around’


aa

after 12, the clock would read 1 o’clock. This can be understood with the
.is
ng

congruence:
xi
ify

9 + 4 ≡ 13 ≡ 1 (mod 12).
st

Similarly, if it was 10 o’clock in the morning, the time in 100 hours could be
a
Cl

calculated by doing:

10 + 100 ≡ 110 ≡ 14 (mod 24).

By applying mod 24, the time is in the 24-hour form, as all of the complete days

(24-hour multiples) are eliminated.

So, it would be 14:00 or, because

14 ≡ 2 (mod 12),

2 o’clock in the afternoon. By applying mod 12, the time is in the 12-hour form

and since 14 > 12, it is the afternoon.

5
Downloaded from www.clastify.com by Isaac Xing

The ‘wrap around’ nature of modular arithmetic

can be visualised by taking the conventional

number line and manipulating it into a spiral, with

a periodicity equal to the modulus. By taking any

number and following it downwards to the base

circle, you can see what it is congruent to.

For instance, in Figure 2, by following 15 down

vertically, it can be seen that:

om
15 ≡ 8 (mod 7)

l.c
Figure 2 – a visual representation of
ai the modular arithmetic of modulo 7 [3]
and that
gm
c@

15 ≡ 1 (mod 7).
aa
.is
ng

It is conventional to reduce an integer to the corresponding integer between 0


xi

and 𝑛 − 1, where n is the modulus, as these are all the possible remainders (or
ify
st

‘least residues’) [6]. In modulo 7, the least residues are 0, 1, 2, 3, 4, 5 and 6,


a
Cl

illustrated by the bottom-most ring in Figure 2.

The concept of modular arithmetic also includes negative integers. For instance,

in modulo 7, 0 is congruent to -7 because they both leave a remainder of 0 when

divided by the modulus. Similarly, -8 is congruent to 6 because both leave a

remainder of 6 upon division by the modulus.

6
Downloaded from www.clastify.com by Isaac Xing

2.2 Operational Properties

Congruences, for the most part, can be manipulated in the same way as ordinary

equations; addition, subtraction and multiplication can all be carried out as if the

congruence was an equivalence. The only exception is the division properties of

linear congruences.

Before examining these properties, it is important to note that congruences can

be understood using equations:

om
𝑎 ≡ 𝑏 (mod 𝑛) ⟺ 𝑎 − 𝑏 = 𝑛𝑧

l.c
ai
Theorem 2.1. If a and b are congruent modulo n, there exists some z, z ∈ ℤ,
gm
c@

such.that:
aa

𝑎 − 𝑏 = 𝑛𝑧.
.is
ng

Conversely, if there exists some z, z ∈ ℤ, such that:


xi
ify

𝑎 − 𝑏 = 𝑛𝑧
st

a and b are congruent, modulo n.


a
Cl

Proof:

Let k, l 𝜖 ℤ. a and b can be written as:

𝑎 = 𝑎 mod 𝑛 + 𝑘𝑛

𝑏 = 𝑏 mod 𝑛 + 𝑙𝑛

where mod n is the function that reduces a and b to their least residue.

Therefore

𝑎 − 𝑏 = 𝑎 mod 𝑛 + 𝑘𝑛 − (𝑏 mod 𝑛 + 𝑙𝑛).

Since

7
Downloaded from www.clastify.com by Isaac Xing

𝑎 mod 𝑛 = 𝑏 mod 𝑛,

𝑎 − 𝑏 = 𝑘𝑛 − 𝑙𝑛

and

𝑎 − 𝑏 = 𝑛(𝑘 − 𝑙 ).

Therefore, it has been shown that if a and b are congruent mod n, then the

difference between them will be a multiple of n [4].

Conversely, given that

𝑎 − 𝑏 = 𝑛𝑧

om
it follows that

l.c
ai
𝑎 = 𝑛𝑧 + 𝑏.
gm

Since nz is a multiple of the modulus, nz is congruent to 0, modulo n. Therefore


c@
aa

𝑎 ≡ 𝑛𝑧 + 𝑏 (mod 𝑛)
.is
ng

and
xi

𝑎 ≡ 𝑏 (mod 𝑛).
ify
st

Therefore, it has been shown that, if the difference between a and b is a multiple
a
Cl

of n, then a and b are congruent, modulo n.

Addition of congruences:

Theorem 2.2. 𝑎 ≡ 𝑏 and 𝑐 ≡ 𝑑 ⟹ 𝑎+𝑐 ≡ 𝑏+𝑑 (mod 𝑛)

Proof:

Using Theorem 2.1, if 𝑎 ≡ 𝑏 and 𝑐 ≡ 𝑑 (mod 𝑛)

𝑎 − 𝑏 = 𝑛𝑘 and c − d = nl (𝑘, 𝑙 ∈ ℤ)

Summing both equations gives:

𝑎 − 𝑏 + 𝑐 − 𝑑 = 𝑛𝑘 + 𝑛𝑙

8
Downloaded from www.clastify.com by Isaac Xing

which can be rewritten as:

(𝑎 + 𝑐 ) − (𝑏 + 𝑑 ) = 𝑛(𝑘 + 𝑙 ).

Because the difference between 𝑎 + 𝑐 and 𝑏 + 𝑑 is an integer multiple of the

modulus, Theorem 2.1 implies that

𝑎+𝑐 ≡ 𝑏+𝑑 (mod 𝑛),

proving the theorem.

Subtraction of congruences:

The subtraction of congruences works in much the same way as with addition,

om
simply because subtracting a value b is the same as adding the value −𝑏.

l.c
ai
gm
c@

Theorem 2.3. 𝑎 ≡ 𝑏 and 𝑐 ≡ 𝑑 ⟹ 𝑎−𝑐 ≡ 𝑏−𝑑 (mod 𝑛)


aa

Proof:
.is
ng

Using Theorem 2.1, if 𝑎 ≡ 𝑏 and 𝑐 ≡ 𝑑 (mod 𝑛)


xi
ify

𝑎 − 𝑏 = 𝑛𝑘 and 𝑐 − 𝑑 = 𝑛𝑙 (𝑛, 𝑙 ∈ ℤ)
st

Subtracting the second equation from the first gives:


a
Cl

(𝑎 − 𝑏) − (𝑐 − 𝑑 ) = 𝑛𝑘 − 𝑛𝑙

which can be rewritten as

(𝑎 − 𝑐 ) − (𝑏 − 𝑑 ) = 𝑛(𝑘 − 𝑙)

Therefore, implying that

𝑎−𝑐 ≡ 𝑏−𝑑 (mod 𝑛)

proving the theorem.

9
Downloaded from www.clastify.com by Isaac Xing

Multiplication of congruences:

Theorem 2.4. 𝑎 ≡ 𝑏 and 𝑐 ≡ 𝑑 ⟹ 𝑎𝑐 ≡ 𝑏𝑑 (mod 𝑛)

Proof:

Using Theorem 2.1, if 𝑎 ≡ 𝑏 and 𝑐 ≡ 𝑑 (mod 𝑛)

𝑎 = 𝑛𝑘 + 𝑏 and 𝑐 = 𝑛𝑙 + 𝑑 (𝑛, 𝑙 ∈ ℤ)

Therefore
𝑎𝑐 = (𝑛𝑘 + 𝑏)(𝑛𝑙 + 𝑑 ) = 𝑛2 𝑘𝑙 + 𝑛𝑑𝑘 + 𝑛𝑏𝑙 + 𝑏𝑑

𝑎𝑐 − 𝑏𝑑 = 𝑛(𝑛𝑘𝑙 + 𝑑𝑘 + 𝑏𝑙)

Since n, k, l, b and d are all integers, their products and sums are integers.

om
Therefore, using Theorem 2.1:

l.c
𝑎𝑐 ≡ 𝑏𝑑 (mod 𝑛)
ai
gm

proving the theorem.


c@
aa
.is

Division of congruences:
ng

The division of congruences is more complex than the other operations as


xi
ify

dividing both sides of a congruence by a value is not always valid. For instance:
a st
Cl

20 ≡ 5 (mod 15).

Dividing both sides of the congruence by 5 gives:

4 ≡ 1 (mod 15).

This statement is clearly incorrect as the difference between 4 and 1 is not a

multiple of 15.

For a division of congruences to be valid it is necessary to have both sides be

divisible by the divisor, d, simply because modular arithmetic only deals with

integers.

10
Downloaded from www.clastify.com by Isaac Xing

Beyond this, the rule for division is as follows:

If a and b are congruent, modulo n, then [7]:

𝑎 𝑏 𝑛
≡ (mod ).
𝑑 𝑑 gcd (𝑑, 𝑛)

The rule for division indicates that both sides of a congruence can be divided

without affecting the value of the modulus if, and only if, the divisor and the

modulus are relatively coprime i.e. their greatest common divisor (GCD) is 1.

om
If their GCD is greater than 1, then the division can be carried out, but the

modulus must be divided by their GCD.


l.c
ai
gm
c@

For example, the following congruence can be divided by 2 without altering the
aa
.is

modulus because the divisor, 2, and the modulus, 17, are relatively coprime:
ng
xi

14 ≡ 2𝑥 (mod 17)
ify

7 ≡ 𝑥 (mod 17)
ast
Cl

The earlier example

20 ≡ 5 (mod 15)

couldn’t be divided by 5 without changing the modulus since 5 and 15 aren’t

relatively coprime. To get a valid congruence, the modulus would have to be

divided by 5 (the GCD of the divisor and the modulus).

This gives the valid congruence:

4 ≡ 1 (mod 3)

11
Downloaded from www.clastify.com by Isaac Xing

3 Significant Theorems

3.1 The Chinese Remainder Theorem

In ‘The Mathematical Classic of Sun Zi’ – a Chinese book produced in the third

century AD [1] – the following problem is posed:

‘Now there are an unknown number of things. If we count by threes, there is a

remainder 2; if we count by fives, there is a remainder 3; if we count by sevens,

there is a remainder 2. Find the number of things.” [8]

om
This is thought to be the earliest known example of the Chinese Remainder

l.c
ai
Theorem, presented in the form of a problem.
gm
c@
aa

Theorem 3.1: The Chinese Remainder Theorem


.is
ng

Given the system of linear congruences:


xi

𝑥 ≡ 𝑎1 (mod 𝑛1 )
ify
st

𝑥 ≡ 𝑎2 (mod 𝑛2 )
a
Cl

𝑥 ≡ 𝑎3 (mod 𝑛3 )

𝑥 ≡ 𝑎𝑖 (mod 𝑛𝑖 )

If 𝑛1 , 𝑛2 , 𝑛3 , … , 𝑛𝑖 are pairwise coprime positive integers, there exists a unique

solution modulo N to the system of linear congruences where

N = 𝑛1 × 𝑛2 × 𝑛3 × … × 𝑛𝑖 .

In other words, there is a particular solution, 𝑥0 , where 0 ≤ 𝑥0 < 𝑁 and a general

solution given by 𝑥 = 𝑥0 + 𝑘𝑁, where 𝑘 is any integer [2].

12
Downloaded from www.clastify.com by Isaac Xing

In Sun Zi’s original problem, the Chinese Remainder Theorem proves that the

following system of linear congruences has a unique solution, modulo 105:

𝑥 ≡ 2 (mod 3)

𝑥 ≡ 3 (mod 5)

𝑥 ≡ 2 (mod 7).

Indeed, the system has a particular solution, 𝑥0 = 23, and a general solution,

𝑥 = 23 + 105𝑘 . The general solution exists due to the fact that N (105) is a

multiple of all of the moduli, and so becomes congruent to 0 under each of them.

om
l.c
ai
3.2 Fermat’s Little Theorem
gm
c@

Fermat’s Little Theorem (named to be distinguishable from Fermat’s last


aa
.is

theorem) was first disclosed by Fermat in a letter of October 1640 to fellow


ng

French mathematician Bernard Frénicle de Bessy [9]. It states that if p is prime,


xi
ify

then for any integer a, 𝑎𝑝 − 𝑎 is a multiple of p. This applies to modular


a st

arithmetic as it equates to a useful congruence.


Cl

Theorem 3.2: Fermat’s Little Theorem

Given that 𝑎 ∈ ℤ and 𝑝 is prime,

𝑎𝑝 ≡ 𝑎 (mod 𝑝).

Furthermore, if 𝑎 is not a multiple of 𝑝, then

𝑎𝑝−1 ≡ 1 (mod 𝑝).

This is because if 𝑎 𝑖s a multiple of 𝑝, 𝑎 ≡ 0 and so 𝑎𝑝−1 ≡ 0 (mod 𝑝).

13
Downloaded from www.clastify.com by Isaac Xing

Proof [10]:

Let p be a prime number. Consider the case where 𝑎 = 1:

1𝑝 ≡ 1 (mod 𝑝).

The case holds as 1 raised to any power is 1.

Let us assume that the following statement is true (𝑎 ∈ ℤ):

𝑎𝑝 ≡ 𝑎 (mod 𝑝).

It follows by the binomial theorem that:

𝑝 𝑝 𝑝
(𝑎 + 1)𝑝 = 𝑎𝑝 + ( ) 𝑎𝑝−1 + ( ) 𝑎𝑝−2 + ⋯ + ( )𝑎 + 1
1 2 𝑝−1

om
The definition of the binomial co-efficient is:

l.c
𝑝 𝑝! ai
( )=
𝑘 𝑘! (𝑝 − 𝑘)!
gm
c@

Since 1 ≤ 𝑘 ≤ 𝑝 − 1, p divides the numerator but not the denominator.


aa

Therefore, all terms in the expansion are multiples of p, apart from 𝑎𝑝 and 1, and
.is
ng

are therefore congruent to 0, modulo p, As such:


xi

(𝑎 + 1)𝑝 ≡ 𝑎𝑝 + 1 (mod 𝑝).


ify
st

Since it is assumed that:


a
Cl

𝑎𝑝 ≡ 𝑎 (mod 𝑝),

(𝑎 + 1)𝑝 ≡ 𝑎 + 1

and the case for (𝑎 + 1)𝑝 holds.

Since it has been shown that the case holds for (𝑎 + 1)𝑝 when it is assumed that

the case holds for 𝑎𝑝 , and the case when 𝑎 = 1 has been shown to hold, it follows

by mathematical induction that the theorem is true for all values of 𝑎, 𝑎 ∈ ℤ+ .

14
Downloaded from www.clastify.com by Isaac Xing

Example:

Let 𝑎 = 4 and 𝑝 = 7.

Theorem 3.2 implies that the division of 47 by 7 leaves a remainder of 4.

Indeed, 47 = 16,384 = 7 × 2340 + 4.

Fermat’s Little Theorem is also a primality test. The process involves raising a

random value, a, (where a is between 1 and the possible prime) to the power of n

(the value being tested). If this value is congruent to a, modulo n, it follows

Fermat’s Little Theorem and n is a probable prime. When tested over many

om
values of a, this test strongly indicates n is prime, though there are several so-

l.c
ai
called ‘Fermat Liars’ which pass the test but are not prime [11].
gm
c@
aa
.is
ng
xi
ify
a st
Cl

15
Downloaded from www.clastify.com by Isaac Xing

4 Divisibility Tests

The fact that

10 ≡ 1 (mod 9)

leads to the following theorem:

Theorem 4.1: Any number is congruent to the sum of its digits, modulo 9.

Proof:

10 ≡ 1 (mod 9).

Using theorem 2.4, this means that:

om
100 ≡ 10 × 10 ≡ 1 × 1 ≡ 1 (mod 9).

l.c
Because exponentiation is simply repeated multiplication (when a ∈ ℤ∗ ) and 1
ai
gm

raised to any power is 1:


c@

10𝑎 ≡ 1𝑎 ≡ 1 (mod 9).


aa
.is

In our conventional base-10 system, a number is equal to the sum of its digits,
ng
xi

where each digit is multiplied by a different power of ten. For example, take the
ify

integer abcd:
a st
Cl

𝑎𝑏𝑐𝑑 = 𝑎 × 103 + 𝑏 × 102 + 𝑐 × 101 + 𝑑 × 100

In modulo 9, all non-negative integer powers of 10 are congruent to 1, and so all

of these powers of 10 essentially disappear. Consequently, any number is

congruent to the sum of its digits, modulo 9 (sometimes called its digital root).

Example:

Take the number 7,354:

7,354 = 7 × 103 + 3 × 102 + 5 × 101 + 4 × 100

Because:

10𝑎 ≡ 1𝑎 ≡ 1 (mod 9),

16
Downloaded from www.clastify.com by Isaac Xing

7,354 ≡ 7 × 103 + 3 × 102 + 5 × 101 + 4 × 100

≡ 7×1+3×1+5×1+4×1

≡ 7 + 3 + 5 + 4 ≡ 19 (mod 9).

Taking the example above, you don’t have to stop at 19 after summing the digits

once; Theorem 4.1 shows that any number is congruent to the sum of its digits,

modulo 9, so the digits can be summed continuously until you get a single digit

number.

om
The technique’s utility is that it easily gives the remainder of any number upon

l.c
ai
division by 9. Also, since
gm
c@

9 ≡ 0 (mod 9),
aa

if the digital root of a number is 9, it also means the number is divisible by 9.


.is
ng
xi

The name ‘Casting Out Nines’ comes from the process of summing a number’s
ify
st

digits; when summing digits that amount to 9, they can be discarded, or ‘cast
a
Cl

out’, due to 9 being congruent to 0, modulo 9.

93,218,479 × 1,645,823 = ?

In the days before calculators, the calculation above may have taken hours or

even days to complete, with the likelihood of at least a single error being made

relatively high. Thought to be first utilised by the Indian mathematician

Aryabhata II in the 10th century, the process of casting out nines has a long

17
Downloaded from www.clastify.com by Isaac Xing

history in checking arithmetic calculations [12]. By comparing the digital root of

a calculated answer with the product of the digital roots of the initial numbers, a

calculation can be checked with approximately 89% certainty.

A way to check the answer calculated below by using the ‘Casting Out Nines’

method is as follows:

93,218,479

× 1,645,823

om
153,421,116,763,217

l.c
ai
gm
c@

93,218,479 ≡ [9] + 3 + 2 + [1 + 8] + 4 + 7 + [9]


aa

≡3+2+4+7
.is
ng

≡ 3 + 4 ≡ 7 (mod 9)
xi
ify
st

1,645,823 ≡ 1 + 6 + [4 + 5] + 8 + 2 + 3
a
Cl

≡1+6+8+2+3

≡ 6 + 2 + 3 ≡ 2 (mod 9)

153,421,116,763,217

≡ [ 1 + 5 + 3] + 4 + 2 + [ 1 + 1 + 1 + 6] + 7 + [ 6 + 3] + 2 + 1 + 7

≡ 4 + [ 2 + 7] + 2 + 1 + 7

≡ 4 + 1 ≡ 5 (mod 9)

7 × 2 ≡ 14 ≡ 5 (mod 9)

18
Downloaded from www.clastify.com by Isaac Xing

Since the multiplication of the two initial numbers yields 5, modulo 9, and the

proposed answer is congruent to 5, modulo 9, too, the answer has approximately

89% likelihood of being correct.

Because

10 ≡ 1 (mod 3),

using the same reasoning displayed in Theorem 4.1, any number is also

congruent to its digital root, modulo 3. However, this method of checking

arithmetic is much less useful. This is because, with modulo 9, there are 9 least

om
residues, so the chances of a miscalculated answer matching the least residue of

l.c
ai
the correct answer is 1/9 (approximately 11%), whereas in modulo 3, there are 3
gm
c@

least residues, so the chance is 1/3.


aa
.is
ng

Error detection involving modular arithmetic is used in International Bank


xi
ify

Account Numbers (IBAN) – the system that facilitates international transactions


st

around the world. Along with a country code, bank code and account number,
a
Cl

IBANs have a two-digit ‘validation code’. Calculated from the rest of the number,

the code ensures that the IBAN is congruent to 1, modulo 97. If a bank receives

an IBAN that is not congruent to 1, modulo 97, the transfer is invalidated. This

simple error detection method has eradicated the vast majority of input errors

and decreased international transfer errors to less than 0.1% of all payments

[13].

19
Downloaded from www.clastify.com by Isaac Xing

5 Number Theory Problems

‘How many two-digit numbers have remainder 1 when divided by 3

and remainder 2 when divided by 4?’

– UKMT Senior Mathematical Challenge 2010

The Chinese remainder theorem proves that a system of linear congruences will

have a unique solution modulo N, where N is the product of the moduli, if the

om
moduli of the congruences are pairwise coprime positive integers. Since 3 and 4

l.c
are relatively coprime, the theorem applies, and N is 12.
ai
gm
c@

A value that satisfies the conditions of the question can be represented as:
aa
.is

𝑥 ≡ 1 (mod 3)
ng
xi

𝑥 ≡ 2 (mod 4)
ify

where 10 ≤ 𝑥 ≤ 99.
a st
Cl

The particular and general solutions can be ascertained via substitution as

follows:

Using Theorem 2.1,

𝑥 ≡ 1 (mod 3)

which can be expressed as:

𝑥 = 3𝑘 + 1, where 𝑘 ∈ ℤ.

20
Downloaded from www.clastify.com by Isaac Xing

This equation encapsulates the values of x which satisfy the first congruence.

Substituting this constraint on x into the second congruence gives:

3𝑘 + 1 ≡ 2 (mod 4)

3𝑘 ≡ 1 (mod 4).

To remove the co-efficient of k to find the restraints on x from the second

congruence, the number 3k can be written as congruent to another value that is

congruent to 1, modulo 4, and also a multiple of 3:

3𝑘 ≡ 1 ≡ 5 ≡ 9 (mod 4).

om
l.c
ai
Since the greatest common divisor of 3 and 4 is 1, both sides can be divided by 3
gm
c@

without affecting the modulus, leaving:


aa

𝑘 ≡ 3 (mod 4).
.is
ng
xi

Again, using Theorem 2.1:


ify
st

𝑘 − 3 = 4𝑙
a
Cl

𝑘 = 4𝑙 + 3, 𝑙 ∈ ℤ.

This equation shows the values of k that satisfy the second congruence (given

that x = 3k + 1).

Substituting k back into the equation obtained from the first congruence:

𝑥 = 3(4𝑙 + 3) + 1

𝑥 = 12𝑙 + 10

21
Downloaded from www.clastify.com by Isaac Xing

This equation gives the values of x that satisfy the constraints of both of the

initial congruences:

𝑥 ≡ 1 (mod 3)

𝑥 ≡ 2 (mod 4)

It gives the general solution and indicates that the particular solution (the

unique solution between 0 and N − 1) is 10.

Consequently, the two-digit values that satisfy the congruences are:

10 , 22 , 34 , 46 , 58 , 70 , 82 and 94

om
and thus, the number of two-digit numbers which have a remainder of 1 when

l.c
ai
divided by 3 and a remainder of 2 when divided by 4 is 8.
gm
c@
aa
.is
ng
xi
ify
a st
Cl

22
Downloaded from www.clastify.com by Isaac Xing

‘What is the remainder when the 2008-digit number 222...2 is

divided by 9?’

– UKMT Senior Mathematical Challenge 2008

Using Theorem 4.1, any number is congruent to the sum of its digits, modulo 9:

222 … 2 ≡ 2 + 2 + 2 + ⋯ + 2 ≡ 2008 × 2 ≡ 4016 (mod 9).


2008 times

Applying this concept again:

om
4016 ≡ 4 + 0 + 1 + 6 ≡ 11 ≡ 1 + 1 ≡ 2 (mod 9).

l.c
Therefore: ai
gm

222 … 2 ≡ 4016 ≡ 11 ≡ 2 (mod 9)


c@

and so the remainder when the 2008-digit number 222...2 is divided by 9 is 2.


aa
.is
ng
xi
ify
ast
Cl

23
Downloaded from www.clastify.com by Isaac Xing

‘Find the ‘tens’ and ‘units’ digits of 20112011 ’

– UKMT Senior Mathematical Challenge 2013 (Investigation

Question 3.2.a)

In our base-10 system, the integer abcd represents:

𝑎 × 103 + 𝑏 × 102 + 𝑐 × 101 + 𝑑 × 100

The multiplication of abcd by another integer efgh is:

(𝑎 × 103 + 𝑏 × 102 + 𝑐 × 101 + 𝑑 × 100 )( 𝑒 × 103 + 𝑓 × 102 + 𝑔 × 101 + ℎ × 100 )

Of the terms produced by this, only those with a power of 10 equal to 1 or 0 will

om
impact the tens and units digits, since they represent the multiples of
l.c
ai
101 and 100 . The a, b, e and f digits are already multiples of powers of 10 greater
gm
c@

than 1 and so cannot end up being counted in the tens or units columns. Thus,
aa

only the multiplication of the tens and units digits of the integers impact the
.is
ng

tens and units digits of the product.


xi
ify
st

This means the last two digits of 20112011 are the same as the last two digits of
a
Cl

112011 .

The last two digits of a number are equal to its least residue, modulo 100,

because 100 and all multiples of it, are congruent to 0, modulo 100. Therefore,

the answer is equal to:

112011 ≡ 𝑥 (mod 100)

0 ≤ 𝑥 < 100, 𝑥 ∈ ℤ.

24
Downloaded from www.clastify.com by Isaac Xing

Writing out the different powers of 11, modulo 100, yields:

110 ≡ 1

111 ≡ 11 × 1 ≡ 11

112 ≡ 11 × 11 ≡ 121 ≡ 21

113 ≡ 11 × 21 ≡ 231 ≡ 31

114 ≡ 11 × 31 ≡ 341 ≡ 41

115 ≡ 11 × 41 ≡ 451 ≡ 51

116 ≡ 11 × 51 ≡ 561 ≡ 61

117 ≡ 11 × 61 ≡ 671 ≡ 71

om
118 ≡ 11 × 71 ≡ 781 ≡ 81

l.c
ai
119 ≡ 11 × 81 ≡ 891 ≡ 91
gm

1110 ≡ 11 × 91 ≡ 1001 ≡ 1 (mod 100).


c@
aa
.is
ng

The last two digits of the sequence follow a pattern of starting at 1, and then
xi

increasing by 10 until returning to 1 when 11 is raised to the 10th power.


ify
a st
Cl

Noting that 1110 ≡ 1 (mod 100),

112010 ≡ (1110 )201 ≡ 12010 ≡ 1 (mod 100).

Therefore

112011 ≡ 112010 × 111 ≡ 1 × 11 ≡ 11 (mod 100).

Indeed, Figure 3 shows that the last two digits are 11, as proved.

25
Downloaded from www.clastify.com by Isaac Xing

om
l.c
ai
gm
c@


aa
.is
ng
xi
ify
ast
Cl

Figure 3 – The online calculator Wolfram Alpha’s answer [14]

26
Downloaded from www.clastify.com by Isaac Xing

‘Does the sequence 11, 111, 1111, 11111, ... contain any squares?’

– UKMT Modular Arithmetic Webinar [15]

Any even number can be expressed as 2𝑛 and any odd number as 2𝑛 + 1, n ∈ ℤ.

The square of any even number is even as

(2𝑛)2 = 4𝑛2 = 2(2𝑛2 )

and the square of any odd number is odd as

(2𝑛 + 1)2 = 4𝑛2 + 4𝑛 + 1 = 2(2𝑛2 + 2𝑛) + 1.

om
l.c
Consequently, since every number in the sequence is odd, if any of them are
ai
gm
squares, they must be the square of an odd number.
c@
aa

The square of any odd number must be 1 more than a multiple of 4 as


.is
ng

(2𝑛 + 1)2 = 4𝑛2 + 4𝑛 + 1 = 4(𝑛2 + 𝑛) + 1.


xi
ify
a st

This means that any potential square in the sequence will be congruent to 1,
Cl

modulo 4.

Broken down, the sequence is equivalent to:

11 , 100 + 11 , 1,100 + 11 , 11,100 + 11 , 111,100 + 11 , ...

or

11 , 100 + 11 , 11 × 100 + 11 , 111 × 100 + 11 , 1111 × 100 + 11 , ...

27
Downloaded from www.clastify.com by Isaac Xing

Because

100 ≡ 0 (mod 4),

every term is congruent to 11, modulo 4.

Since

11 ≡ 3 (mod 4),

every number in the sequence is also congruent to 3, modulo 4. However, it has

been shown that an odd integer must be congruent to 1, modulo 4, to be a square,

and so it can be concluded that the sequence 11, 111, 1111, 11111, ... contains no

om
squares.

l.c
ai
gm
c@

Extension
aa

To extend my answer, I have investigated if any monodigits (a term coined by


.is
ng

Albert Beiler for a number containing just 1 different digit) can be square
xi
ify

numbers [16].
a st
Cl

There are 3 single-digit squares - 1, 4 and 9 - which I will not count as

monodigits as they all fall under the category by definition.

Since

100 ≡ 0 (mod 4),

Theorem 2.4 proves that any multiple of 100 is congruent to 0, modulo 4. All

powers of 10 greater than 100 are multiples of 100, so all powers of 10 greater

than 100 are also congruent to 0, modulo 4. This means that 100 and 101 are the

only positive integer powers of 10 that aren’t congruent to 0, modulo 4. Only the

28
Downloaded from www.clastify.com by Isaac Xing

last two digits of a number represent the multiples of 100 and 101 . Therefore, all

numbers are congruent to their last two digits, modulo 4. Thus, only the two-

digit monodigits from 22-99 need their least residues checked.

22 ≡ 2

33 ≡ 1

44 ≡ 0

55 ≡ 3

66 ≡ 2

77 ≡ 1

om
88 ≡ 0

l.c
ai (mod 4).
99 ≡ 3
gm
c@
aa

Since 55 and 99 are odd and not congruent to 1, modulo 4, no monodigits


.is
ng

containing 5’s or 9’s can be perfect squares.


xi
ify
st

The square of an even number is a multiple of 4 as


a
Cl

(2𝑛)2 = 4𝑛2 .

Consequently, it is congruent to 0, modulo 4. Since 22 and 66 are not congruent

to 0, modulo 4, monodigits containing 2’s or 6’s cannot be square numbers either.

However, this doesn’t prove that monodigits containing 3’s, 4’s, 7’s and 8’s cannot

be squares.

29
Downloaded from www.clastify.com by Isaac Xing

The fundamental theorem of arithmetic states that every positive integer greater

than 1 can be represented as a unique product of primes [17]. Essentially, any

integer can be represented as:

2 𝑎 × 3𝑏 × 5𝑐 × 7𝑑 × … × 𝑝 𝑖 (𝑎, 𝑏, 𝑐, 𝑑, … , 𝑖 ∈ ℤ∗ ).

It follows that any square can be represented as:

22𝑎 × 32𝑏 × 52𝑐 × 72𝑑 × … × 𝑝2𝑖 (𝑎, 𝑏, 𝑐, 𝑑, … , 𝑖 ∈ ℤ∗ )

and its prime factors must have even exponents.

Since no monodigit containing 1’s is a square, no monodigit containing 1’s can be

om
broken up into primes with all even exponents. Any monodigit containing 4’s is

l.c
ai
equal to a monodigit containing 1’s multiplied by 4. Since 4 is equal to 22 , when a
gm
c@

monodigit containing 1’s is multiplied by 4, only the exponent of 2 will change


aa

(from 0 to 2, as monodigits containing 1’s are odd and have no factor of 2). This
.is
ng

multiplication keeps the exponent of 2 even and doesn’t change any other
xi
ify

exponent. Thus, there is still at least one odd exponent. Therefore, if no


st

monodigit containing 1’s has all even exponents in its prime factors and
a
Cl

multiplying by 4 won’t change any exponents from odd to even, it has been

proved that no monodigit containing 4’s has all even exponents on its prime

factors either. Therefore, no monodigits containing 4’s are squares.

The remaining monodigits containing 3’s, 7’s and 8’s can be proved not to be

squares too. As mentioned in the previous question the integer abcd represents:

𝑎 × 103 + 𝑏 × 102 + 𝑐 × 10 + 𝑑 × 100

30
Downloaded from www.clastify.com by Isaac Xing

When abcd is squared, only terms with a power of 10 equal to 0 will impact units

digit, since it represents the multiples of 100 . The tens, hundreds, thousands

(and so on) digits are already multiples of powers of 10 greater than 0 and so

cannot end up being counted in the units column. Thus, only the units digits of

an integer will impact the units digits of its square.

For any monodigit containing 3’s, 7’s or 8’s to be a square, there must be a digit

that, when multiplied by itself, yields a 3, 7 or 8 in its units column.

Looking at all last digits of all the single digits squared:

12 = 𝟏

om
22 = 𝟒

l.c
ai
32 = 𝟗
gm
c@

42 = 1𝟔
aa

52 = 2𝟓
.is
ng

62 = 3𝟔
xi

72 = 4𝟗
ify
st

82 = 6𝟒
a
Cl

92 = 8𝟏

No digit when squared gives 3, 7 or 8 in the units column. Therefore, no

monodigits composed of 3’s, 7’s or 8’s can be perfect squares either.

In conclusion, this means that no monodigit (with two or more digits) can be a

perfect square.

31
Downloaded from www.clastify.com by Isaac Xing

‘What is the remainder obtained when 989 + 844 is divided by 11?’

– Adapted from the Brilliant.org question [18]:

‘What is the remainder obtained when 𝟐𝟕𝟎 + 𝟑𝟕𝟎 is divided by 13?’

[see Appendix A]

This question is equivalent to the following congruence:

989 + 844 ≡ 𝑥 (mod 11)

0 ≤ 𝑥 < 11, 𝑥 ∈ ℤ .

om
l.c
Since the modulus is prime, Fermat’s Little Theorem applies:
ai
gm
𝑎𝑝 ≡ 𝑎 (mod 𝑝)
c@

(and because a is not a multiple of p)


aa

𝑎𝑝−1 ≡ 1 (mod 𝑝).


.is
ng
xi
ify

Consequently,
st
a

910 ≡ 1 (mod 11)


Cl

and

810 ≡ 1 (mod 11).

Thus

989 ≡ (910 )8 × 99 ≡ (1)8 × 99 ≡ 99 (mod 11)

and

844 ≡ (810 )4 × 84 ≡ (1)4 × 84 ≡ 84 (mod 11).

32
Downloaded from www.clastify.com by Isaac Xing

Dealing with 99 (mod 11):

92 ≡ 81 ≡ 4 (mod 11)

93 ≡ 92 × 9 ≡ 4 × 9 ≡ 36 ≡ 3 (mod 11)

99 ≡ (93 )3 ≡ 33 ≡ 27 ≡ 5 (mod 11).

Therefore

989 ≡ 99 ≡ 5 (mod 11).

Dealing with 84 (mod 11):

82 ≡ (−3)2 ≡ 9 ≡ −2 (mod 11)

om
84 ≡ (82 )2 ≡ (−2)2 ≡ 4 (mod 11).

l.c
ai
Therefore
gm
c@

844 ≡ 84 ≡ 4 (mod 11).


aa
.is
ng

989 + 844 ≡ 5 + 4 ≡ 9 (mod 11).


xi

Thus, the remainder obtained when 989 + 844 is divided by 11 is 9.


ify
st

Indeed, Figure 4 shows that the remainder is 9, as proved.


a
Cl

Figure 4 – The online calculator Wolfram Alpha’s answer [14]

33
Downloaded from www.clastify.com by Isaac Xing

6 Conclusion

In this essay, the basic concept of modular arithmetic was introduced, followed

by the properties of congruences. Next, two relevant theorems were explained

and supplemented with examples. Selected applications such as primality and

divisibility tests were also explored, and an example of the latter was exhibited.

To demonstrate the topic’s utility in a more concrete way, the aforementioned

ideas were used to produce 5 original solutions to number theory problems. The

om
steps in the solutions were fleshed out at each stage to make ensure the

l.c
reasoning was coherent and accessible for the reader.
ai
gm
c@

Modular arithmetic is a system which can be applied in a myriad of different


aa
.is

situations, and as such, the constraints on the length of this essay make it
ng
xi

difficult to explore every facet of its use. For instance, modular arithmetic can be
ify

used to produce number theory proofs by exhausting all least residues under a
a st
Cl

modulus. I find this aspect compelling and, although it was touched on in one

problem, I would have liked to elaborate on it, if I had more words. Similarly,

writing the essay, I found the problem concerning monodigits intriguing, and

would also like to have expanded on this to investigate perfect cubes and

potentially higher powers contained in monodigits sequences. Having said that, I

feel that modular arithmetic was introduced effectively and its applicability in

number theory was explored to a substantial extent in this essay. Therefore,

both parts of the research question, ‘What is modular arithmetic, and how can it

be applied to solve problems in the field of number theory?’ have been answered.

34
Downloaded from www.clastify.com by Isaac Xing

7 Appendices

Appendix A

All digits in the question were randomly generated from random.org [19] so that

the question, and consequently my solution, would be unique.

om
l.c
ai
gm
c@
aa
.is
ng
xi
ify
ast
Cl

35
Downloaded from www.clastify.com by Isaac Xing

8 Bibliography

[1] The Editors of Encyclopaedia Brittanica, “Chinese Remainder Theorem,”


[Online]. Available: https://www.britannica.com/science/Chinese-remainder-
theorem. [Accessed 20 9 2020].

[2] Brilliant, “Chinese Remainder Theorem,” [Online]. Available:


https://brilliant.org/wiki/chinese-remainder-theorem/. [Accessed 23 7 2020].

[3] I. Stewart, Concepts of Modern Mathematics, New York: Dover Publications,


1995.

[4] R. Graham, D. Knuth and O. Patashnik, Concrete Mathematics: A

om
Foundation for Computer Science, Reading, Massachusetts: Addison-
Wesley, 1994.
l.c
ai
gm

[5] Wikipedia, “Modular arithmetic,” [Online]. Available:


c@

https://en.wikipedia.org/wiki/Modular_arithmetic. [Accessed 5 June 2020].


aa

[6] B. Lynn, “Modular Arithmetic,” [Online]. Available:


.is
ng

https://crypto.stanford.edu/pbc/notes/numbertheory/arith.html. [Accessed 17
xi

7 2020].
ify

[7] Art of Problem Solving, “Modular Arithmetic Introduction,” [Online].


st
a

Available:
Cl

https://artofproblemsolving.com/wiki/index.php/Modular_arithmetic/Introdu
ction. [Accessed 21 7 2020].

[8] J. Harcet, L. Heinrichs, P. M. Seiler and M. Torres-Skoumal, Mathematics


Higher Level: Discrete Mathematics, Oxford: Oxford University Press, 2016.

[9] Wikipedia, “Fermat's little theorem,” [Online]. Available:


https://en.wikipedia.org/wiki/Fermat%27s_little_theorem#Proofs. [Accessed
24 7 2020].

[10] Art of Problem Solving, “Fermat's Little Theorem,” [Online]. Available:


https://artofproblemsolving.com/wiki/index.php?title=Fermat%27s_Little_Th
eorem. [Accessed 20 9 2020].

36
Downloaded from www.clastify.com by Isaac Xing

[11] Wikipedia, “Fermat primality test,” [Online]. Available:


https://en.wikipedia.org/wiki/Fermat_primality_test. [Accessed 24 7 2020].

[12] B. Datta and A. N. Singh, “Checks On Operations,” in History of Hindu


Mathematics: A Source Book, Bombay, Asia Publishing House, 1935, pp.
180-184.

[13] Wikipedia, “International Bank Account Number,” [Online]. Available:


https://en.wikipedia.org/wiki/International_Bank_Account_Number#Validat
ing_the_IBAN. [Accessed 18 8 2020].

[14] “Wolfram Alpha,” [Online]. Available:


https://www.wolframalpha.com/input/?i=2011%5E2011. [Accessed 5 8 2020].

[15] UK Mathematics Trust, “UKMT webinar: Modular Arithmetic,” 24 1 2020.

om
[Online]. Available: https://www.youtube.com/watch?v=ZnAW3IQNhTw.

l.c
[Accessed 5 8 2020]. ai
gm

[16] A. H. Beiler, Recreations in the Theory of Numbers: The Queen of


c@

Mathematics Entertains, New York: Dover Publications, 1996.


aa

[17] Wolfram Mathworld, “Fundamental Theorem of Arithmetic,” [Online].


.is

Available:
ng
xi

https://mathworld.wolfram.com/FundamentalTheoremofArithmetic.html#:~:
ify

text=The%20fundamental%20theorem%20of%20arithmetic,called%20the%2
st

0unique%20factorization%20theorem.. [Accessed 6 10 2020].


a
Cl

[18] Brilliant, “Fermat's Little Theorem,” [Online]. Available:


https://brilliant.org/wiki/fermats-little-theorem/. [Accessed 16 8 2020].

[19] “Random Integer Generator,” [Online]. Available: https://www.random.org.


[Accessed 16 8 2020].

[20] Mathworld, “Fundemental Theorem of Arithmetic,” [Online]. Available:


https://mathworld.wolfram.com/FundamentalTheoremofArithmetic.html#:~:
text=The%20fundamental%20theorem%20of%20arithmetic,called%20the%2
0unique%20factorization%20theorem.. [Accessed 27 9 2020].

37

You might also like