Sunteți pe pagina 1din 49

1

INTRODUCTION

Background of the Study

Number theory is one of the subfields of pure mathematics that talks about the

theory of the positive integers. It is based on ideas such as divisibility and congruence. In

some ways it is the most accessible discipline in pure mathematics for the general public:

for instance, the Goldbach conjecture is easily stated (but is yet to be proved or disproved).

In other ways it is the least accessible discipline; for example, Wiles’ proof Fermat’s

equation has no nontrivial solutions requires understanding automorphic forms, which

through intrinsic to nature have not found a place in physics or the general public discourse.

Prime numbers are interesting part of number theory. Composite numbers can be

written as product of primes through factorization. The Fundamental Theorem of

Arithmetic states that every positive integer except 1 can be written uniquely as the product

of one or more prime numbers. While the theorem itself is simple, the process of finding

the prime factors of a number is decidedly more difficult than it seems at first glance. In

fact, that process is so infeasible for large enough numbers so that Fermat devised a

factorization that can only be broken into two factors (Krakanis 1986, p. 142-143).

Factorization consists of writing a number as a product of several factors, usually smaller

or simpler objects of the same kind. And factorization can be done in many ways.
2

First is the brute force (trial division). This is done by testing each of the primes up

to square root of n (the number to be factored) for divisibility. This method will certainly

produce a factor if n is not prime. Trial division factorization involves dividing the target

number (call it 𝑛) by all primes less than or equal to √𝑛 until an integral quotient (and

hence a prime factor) is found. Clearly this factorization can become very time consuming

for large integers (Cafiero,p. 1). Trial division is the simplest way of factorization, which

is nothing more than testing the number for divisibility by every integer less than or equal

to its square root. Until Pierre de Fermat improved on this with his own factorization, which

works by converting the number into a difference of squares (Bressoud and Wagon 2000,

p. 169).

The second is the prime factorization method. It is a way of expressing a number

as a product of prime numbers. This method for finding the prime factors involves

divisibility tests and trial divisions. The quotient obtained in each level of division is again

divided by a prime factor. The division process continues till a prime quotient is got. The

product of all the prime divisors and the final prime quotient gives the prime factorization

for the number. This method of factoring is also slow for large numbers.

Third is the “Sieve of Eratosthenes”. It is a very simple and popular technique for

finding all the primes numbers in the range from 2 to a given number n. Eratosthenes’s

sieve drains out composite numbers and leaves prime numbers behind. Yielding all primes

up to a given limit, such as required in the trial division method. The sieve of Eratosthenes

is useful for relatively small primes. The modern sieve of Atkin is more complicated, but

faster when properly optimized (Lehmar 1909).


3

Fourth is the Fermat’s factorization method. Developed by the French

mathematician Pierre de Fermat who knew that every odd number could be written as the

difference of two squares. With this in mind, Fermat devised a technique for finding factors

of large numbers significantly faster than some factorization methods previously identified.

Fermat’s factorization method is based on the representation of an odd n integer as the

difference of two squares that is, 𝑛 = 𝑎2 – 𝑏 2 𝑎, 𝑏 ∈ ℤ. That difference is algebraically

factorable as ( 𝑎 + 𝑏 ) ( 𝑎 − 𝑏 ) and if neither factor equals one, it is a proper factorization

of 𝑛.

History of Some Factorization Methods

Trial division is considered as classical method of factorization and is perhaps the

simplest and most obvious method for factoring a composite number into its prime

constituents. This method actually works quite well, and is quite fast for most numbers.

In fact it has been shown that about 88% of all integers have a factor less than 100, and

92% have a factor less than 1000. For this reason, most modern factorization starts by

using trial division. Unfortunately, if the number to be factored does not have a small

prime factor, this factorization can be extremely slow (F. J. Smith 2006).

Proposition 14 of Book IX of Euclid's Elements embodies the result that later

became known as the Fundamental Theorem of Arithmetic, stating that every integer

greater than 1 can, except for the order of the factors, be represented as a product of primes

in one and only one way. To quote the proposition itself: "If a number be the least that is
4

measured by prime numbers, it will not be measured by any other prime except those

originally measuring it." Because every number 𝑛 > 1 is either a prime or, by the

Fundamental Theorem, can be broken down into unique prime factors and no further, the

primes serve as the building blocks from which all other integers can be made (D. M.

Burton 2007, p. 39-40).

Another Greek mathematician whose work in number theory remains significant is

Eratosthenes of Cyrene (276-194 B.C.). Although posterity remembers him mainly as the

director of the world-famous library at Alexandria, Eratosthenes was gifted in all branches

of learning, if not of first rank in any; in his own day, he was nicknamed "Beta" because,

it was said, he stood at least second in every field. Perhaps the most impressive feat of

Eratosthenes was the accurate measurement of the earth's circumference by a simple

application of Euclidean geometry (D. M. Burton 2007, p. 45). In the third century B.C. he

discovered a relatively painless way for producing a list of prime numbers up to a certain

value (F. J. Smith 2006). Eratosthenes worked on prime numbers and he is remembered

for his prime number sieve. The 'Sieve of Eratosthenes' in a modified form, is still an

important tool in number theory research. The sieve appears in the Introduction to

Arithmetic by Nicomedes.

In 1643, Pierre de Fermat described a technique for factoring large numbers. This

represented the first real improvement over the classical method of attempting to find the

prime factor of 𝑛 by dividing by all primes not exceeding 𝑛. Fermat’s factorization scheme

has at its heart the observation that the search for factors of an odd integer 𝑛 is equivalent
5

to obtaining integral solutions of 𝑎 and 𝑏 of the equation 𝑛 = 𝑎2 − 𝑏 2 . If 𝑛 is the difference

of two squares, then 𝑛 can be factored as 𝑛 = 𝑎2 − 𝑏 2 = (𝑎 + 𝑏) (𝑎 − 𝑏). Conversely,

𝑥+𝑦 2
when 𝑛 has the factorization 𝑛 = 𝑥𝑦, with 𝑥 ≥ 𝑦 ≥ 1, then we may write 𝑛 = ( ) −
2

𝑥−𝑦 2
( ) . Moreover, because 𝑛 is taken to be an odd integer, 𝑥 and 𝑦 are themselves odd,
2

𝑥+𝑦 𝑥−𝑦
hence and will be non-negative integer
2 2

In Fermat’s factorization method, one begins the search for possible 𝑎 and 𝑏

satisfying the equation 𝑛 = 𝑎2 − 𝑏 2 , or what is the same thing, the equation 𝑏 2 = 𝑎2 – 𝑛,

by first determining the smallest integer 𝑘 for which 𝑘 2 ≥ 𝑛. Now look successively at the

numbers 𝑘 2 – 𝑛, ( 𝑘 + 1 )2 – 𝑛, (𝑘 + 2)2 – 𝑛, (𝑘 + 3)2 – 𝑛, … until a value of 𝑚 ≥ √𝑛 is

found making 𝑚2 – 𝑛 a square. The process cannot go on indefinitely, since we eventually


𝑛+1 2 𝑛−1 2
arrive at ( ) −𝑛 =( ) the representation of 𝑛 corresponding to the trivial
2 2

factorization 𝑛 = 𝑛 · 1. If this point is reached without a square difference having been

discovered earlier, then 𝑛 has no other factor than 𝑛 and 1, in this case 𝑛 is a prime number

(D. M. Burton 2007, p. 97-98 )


6

Objective of the Study

General Objective

This study aims to look into the different factorization methods.

Specific Objectives

1. To provide a detailed analysis on the different factorization method namely:

a.) “Sieve of Eratosthenes”,

b). Brute force method (trial division),

c.) Prime factorization method and

d.) Fermat’s factorization method.

2. To determine when the Fermat’s pair of factors is a combination of primes and not a

combination of two primes.

3. To look into the algorithm of Prime Number Checker.

Significance of the Study

This study is significant to all students and future researchers. It can serve as a basis

on how to apply different methods of factorization. With regards to the proofs of this paper,

it will help students to understand some theoretic statements. Through analysis and

elaboration of some factorization, were going to present ways to help them easily determine

the factors of non-negative integer particularly when the given integers are big. In

connection to this study, it is beneficial to the following:


7

Students. This study will help the students to easily factor a number specifically

when the number is large. For those students struggling in factoring, students who doesn’t

want to spend their time in finding the factors because it’s time consuming and for those

students who doesn’t have the patience to use classical method of factorization, modern

factorization method is highly recommended to them.

The Future Researchers. This proposed study will be a tool and guide for the future

researcher. It can be use as their source of information pertaining to their study that is

related to our topic which is exposition on some method of factorization.

.
8

REVIEW OF RELATED LITERATURE

This chapter provides a background review of related literature pertaining to the

study which includes a search of Exposition on some method of factorization. In addition,

information related to this study was gathered from internet services, articles and books.

According to Arjen K. Lenstra, factoring a composite integer is believed to be a

hard problem. This is, of course, not the case for all composites with small factors are easy

to factor but, in general, the problem seems to be difficult. As yet there is no firm

mathematical ground on which this assumption can be based. The only evidence that

factoring is hard consists of our failure so far to find a fast and practical factoring algorithm.

Khoo Phon Sai said that all the methods require either by trial and error or through

determination to find all prime factors of a large number; thus, only for fairly simple

numbers will the methods be practicable. A common classroom practice is to complement

the method of “listing of elements” with either the long division or prime factorization

method. The methods using Tree or Venn Diagrams have the advantage of providing

pictorial representations and lend themselves to simple interpretations of the other

methods. A further advantage of these methods is that they provide students with necessary

experiences for the appreciation in later years of the fundamental theorem of arithmetic.

I. Kleiner considered only some of Fermat’s contributions to number theory. These

comprise results, methods, and concepts considered only casually, if at all, before Fermat.

Moreover, they turned out to have applications in various number-theoretic contexts and
9

became harbingers of significant departures in number theory in succeeding centuries.

Without doubt, these accomplishments entitle Fermat to be known as the founder of

modern number theory.

According to J. R. Prince who look at some methods for factoring numbers into

their prime factorizations, these topics are going to help show the fact that in general

finding the prime factorization of a number is not necessary an easy task. We can use

Fermat’s method if the number can be written as the difference of two perfect squares. We

can also use a trial and error to find the prime factorization of a number if the factors are

relatively small, but if the prime factors are large numbers then trial and error can be very

tedious and inefficient.

The most common strategy for factoring involves checking all prime numbers

starting with the smallest, and working to the larger ones. The only reprieve is that we do

not have to check every single prime number less than the number we are trying to factor.

We only need to check up to the largest prime number less than or equal to the square root

of our number. This is because if a number is composite, it will have a factor less than or

equal to its square root.

According to J.C. Woodson, the process of finding the prime factorization of large

integers has many important applications in the field of computer science, most notably in

cryptography. Currently the best known process for factoring very large numbers are sub-

exponential. However, the sub exponential process invoked the factorization of smaller

numbers, and the best procedure for factoring smaller numbers are still the exponential
10

process such as trial division and Fermat’s factorization method. A highly optimized

combination of trial division with Fermat’s factorization method was implemented to attain

much faster performance than trial division alone.

F. J. Smith said that the basis of most modern factoring procedures is an

enhancement of Fermat’s difference of squares technique, introduced by Maurice Kraitchik

in the 1920s. He suggested that instead of trying to find 𝑥 and 𝑦 such that x2 – y2 = n it

might suffice to find 𝑥 and 𝑦 where x2 ≡ y2 mod n.

J.P. Sorenson said that a prime sieve is a procedure that finds the prime up to a

bound 𝑛. He said that a prime sieve is incremental, if it can quickly determine if 𝑛 + 1 is a

prime after having found all primes up to 𝑛 .We say a sieve is compact if it uses roughly

√𝑛 space or less.

D. Abdulla et. al. said that Sieve of Eratosthenes is a process that can be used to

generate prime numbers of randomly generated or sequential numbered, random numbers,

testing in this study to find out a system that is better used for large primes in terms of time

complexity. It also used to eliminate numbers that is not prime from a collection of numbers

that exist, this process is quite good as an algorithm that could be applied to various

processes cryptographic procedure.


11

PRELIMINARIES

In this chapter, we introduce notations and discuss fundamental concepts necessary

for understanding the results that will be presented in this paper. For the basic concepts in

number theory, the main references considered are the books written by David M. Burton,

and an article of Jesse Krauel.

Definition 3.1. Let 𝑚, 𝑛 be integers with 𝑚 ≠ 0. If 𝑛 = 𝑘𝑚 for some integer 𝑘, we say

that 𝑚 is a divisor of 𝑛 or 𝑚 divides 𝑛 and write 𝑚 | 𝑛. Similarly, we say that 𝑚 does not

divide 𝑛 and write 𝑚 − 𝑛 if n ≠ 𝑘𝑚 for any integer 𝑘.

Notice that we can always write 𝑛 = (±1)(±𝑛), regardless of the choice of 𝑛. So the

integers ±1, ±𝑛 are always divisors of 𝑛 and we refer to them as the trivial divisors of 𝑛.

Some integers have only trivial divisors, while others have more.

Definition 3.2. An integer 𝑛 > 1 is prime if it has 1 and itself as its only positive divisors.

Example 3.1. By our definition, the integers 0 and 1 cannot be prime, but the integer 2 is

prime as it only has trivial divisors.

A consequence of Example 3.1. is that any integer multiple 2𝑛 of 2 which is greater than

2 cannot be prime since 2𝑛 will possess ±2, ±1 𝑎𝑛𝑑 ± 2𝑛 as divisors. This result holds

for any integer multiple 𝑛𝑝 of a prime 𝑝, with 𝑛 > 1.


12

Definition 3.3. An integer 𝑛 > 1 is composite if it is not prime. This means that 𝑛 = 𝑎𝑏

for two integers 𝑎, 𝑏 with 1 < 𝑎 < 𝑛 and 1 < 𝑏 < 𝑛, and we call any 𝑎, 𝑏 with this

property nontrivial divisors of 𝑛.

Definition 3.4. If 𝑐|𝑎 and 𝑐|𝑏, then we say that 𝑐 is a common divisor of 𝑎 and 𝑏.

Definition 3.5. Let 𝑎 and 𝑏 be given integers, with at least one of them different from

zero. The greatest common divisor of 𝑎 and 𝑏, denoted by 𝑔𝑐𝑑(𝑎, 𝑏), is the positive

integer 𝑑 satisfying the following:

𝑖. 𝑑|𝑎 and 𝑑|𝑏 and

𝑖𝑖. if 𝑐|𝑎 and 𝑐|𝑏, then 𝑐 ≤ 𝑑

Definition 3.6. A complete residue system modulo 𝑛 is a set 𝑆 = {𝑟1, 𝑟2 , 𝑟3 , … , 𝑟𝑛 } that

contains one and only one representative from equivalence class. The complete residue

system {0, 1, 2, … , 𝑛 − 1} is called the primary residue system modulo n.

For a positive integer 𝑛, 𝑍𝑛 denotes the set of integers modulo 𝑛 and consists of

exactly the 𝑛 distinct equivalence classes: [0], [1], [2], … , [𝑛 − 1] represented by the

distinct remainders obtained with division by 𝑛.

Definition 3.7. Let 𝑛 be a fixed positive integer. Two integers 𝑎 and 𝑏 are said to be

congruent modulo n, symbolized by 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛) if 𝑛 divides the difference 𝑎 − 𝑏;

that is, provided that 𝑎 − 𝑏 = 𝑘𝑛 for some integer 𝑘.


13

Definition 3.8. If an integer 𝑛 > 1 is not divisible by any prime 𝑝 ≤ √𝑛

then 𝑛 is of necessity a prime. The Sieve of Eratosthenes, a technique for finding all primes

below a given integer 𝑛.

To illustrate the steps involved in implementing the Sieve of Eratosthenes, consider

the following example. Find all the primes less or equal to 100.

1 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

a. Striking out multiples of 2.

b. Striking out multiples of 3.

c. Striking out multiples of 5.

d. Striking out multiples of 7.

Figure 1. List of primes less than or equal to 100.


14

Definition 3.9. Given an integer 𝑛 > 1, test each of the primes up to square root of 𝑛 for

divisibility, if none of this primes divides 𝑛 then 𝑛 is prime. This technique is called brute

force (trial division).

To illustrate the steps involved in implementing the brute force method, consider

the following example. Test if 𝑛 = 163 is a prime number using brute force method (trial

division).

We divide the prime numbers less than √𝑛 to 𝑛. We note that √163 is 12.76 then

list the prime numbers less than 12 which is 2, 3, 5, 7, 11. Divide the prime numbers

obtained to 163 to see if 163 is prime. Observed that none of the primes listed will divide

163, so 163 is prime.

Definition 3.10. If 𝑛 > 1, we write 𝑛 as a product of primes which is

𝑒 𝑒 𝑒 𝑒
𝑛 = 𝑝11 ∙ 𝑝22 ∙ 𝑝33 ∙∙∙ 𝑝𝑘𝑘

where 𝑝𝑖 ′𝑠 are distinct primes and there exist 𝑝1 ≤ 𝑝2 ≤ … ≤ 𝑝𝑘 and each exponent

𝑒𝑖 > 1. This is called the prime factorization of 𝑛.

To illustrate the steps involved in implementing the prime factorization method,

consider the following example. Find all the prime factors of 𝑛 = 100.
15

100

50 2

25 2

5 5

𝑛 = 2 × 2 × 5 × 5 𝑜𝑟 𝑛 = 22 × 52

Figure 2. Finding the prime factors of 100.

Definition 3.7. Let 𝑛 be any non-prime odd integer 𝑛 > 1 if and only if there are non-

negative integers 𝑎 and 𝑏 → 𝑛 = 𝑎2 − 𝑏 2 with 𝑎 − 𝑏 > 1 (difference of two squares)

observe that (𝑎 − 𝑏) and (𝑎 + 𝑏) are primes this is called the Fermat’s factorization

method.

To illustrate the steps involved in implementing the Fermat’s factorization

method, consider the following example. Find the two factors of 𝑛 = 6077.

1. We note that 77 < √6077 < 78. That is, 𝑘 = 78.

2. We now look for a perfect square number 𝑎𝑖 such that 𝑎𝑖 = (𝑘 + 𝑖)2 − 6077.

At 𝑖 = 0, 𝑎𝑖 = 782 − 6077 = 7 which is not a perfect square.

At 𝑖 = 1, 𝑎𝑖 = (78 + 1)2 − 6077 = 164 which is not a perfect square.

At 𝑖 = 2, 𝑎𝑖 = (78 + 2)2 − 6077 = 323 which is not a perfect square.


16

At 𝑖 = 3, 𝑎𝑖 = (78 + 3)2 − 6077 = 484 which is a perfect square number.

Thus, we have the factorization of 6077 = 812 − 484

= 812 − 222

= (81 + 22)(81 − 22)

= (103)(59).
17

RESULTS AND DISCUSSIONS

This chapter presents the exposition on some methods of factorization. It includes

analysis on factorization identified to observe their differences. It also includes the

properties of Fermat’s factorization method and an algorithm to find the divisors of a given

number.

Detailed analysis on the different factorization methods namely:

a.) Sieve of Eratosthenes.

Given an integer 𝑛 > 1, list the integers from 2 to 𝑛 in increasing order. The first

member for the list is the prime 2. Strike out all multiples of 2 greater than 2. The next

remaining member of the list which is greater than 2 is the prime 3. Strike out all multiples

of 3 greater than 3. Continue in this way until there are no more members of the list to

strike out.

The following theorem allows us to pinpoint the integer at which we may stop striking

out multiples and be guaranteed that the resulting list contains only primes.

Theorem 4.1. Let 𝑛 > 1 be an integer. If 𝑛 has no prime divisor less than or equal to

√𝑛, then 𝑛 is prime.

Proof. Suppose 𝑛 is a composite and each prime divisor 𝑝𝑖 of 𝑛 satisfies 𝑝𝑖 > √𝑛. Since 𝑛

is composite, we know that 𝑛 is a product of at least two primes. But then

𝑛 = 𝑝1 𝑝2 … 𝑝𝑘 > √𝑛√𝑛𝑝3 … 𝑝𝑘 = 𝑛𝑝3 … 𝑝𝑘 ≥ 𝑛; where 𝑛 = 𝑝1 𝑝2 𝑝3 … 𝑝𝑘

which shows that 𝑛 > 𝑛, a contradiction. So 𝑛 must be prime.


18

The contrapositive of this theorem states that if 𝑛 is composite, then 𝑛 has a prime

divisor less than or equal to √𝑛. Consequently, when using the Sieve of Eratosthenes to

find all the primes less than a given integer 𝑛 > 1 we may stop striking out multiples once

we reach a prime greater than √𝑛. To illustrate the steps involved in implementing the

Sieve of Eratosthenes, consider the following example.

Example 4.1. To find all the primes less than or equal to 100, we list the integers from 2

to 100 in increasing order. Since √100 = 10, we may stop striking out multiples once we

reach a prime greater than 10.

1 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

a. Striking out multiples of 2.


b. Striking out multiples of 3.
c. Striking out multiples of 5.
d. Striking out multiples of 7.

Figure 3. Listing the Sieve of Eratosthenes that is equal to 100.


19

Example 4.2. To find all the primes less than or equal to 225, we list the integers from 2

to 225 in increasing order. Since √225 = 15, we may stop striking out multiples once we

reach a prime greater than 15.

1 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 101 102 103 104 105
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225

a. Striking out multiples of 2.


b. Striking out multiples of 3.
c. Striking out multiples of 5.
d. Striking out multiples of 7.
e. Striking out multiples of 11.
f. Striking out multiples of 13.

Figure 4. List of primes less than or equal to 225.


20

Theorem 4.2. There exist infinitely many primes.

Proof. Let 𝑝1 = 2, 𝑝2 = 3, 𝑝3 = 5, 𝑝4 = 7… be the primes in ascending order, and suppose

that there is a last prime, called 𝑃𝑛· Now consider the positive integer 𝑃 =

𝑝1 , 𝑝2 , 𝑝3 , … , 𝑝𝑛 + 1. Since 𝑃 > 1 and every integer say 𝑛 > 1 can be expressed as

product of primes then P is divisible by some prime 𝑝. But 𝑝1 , 𝑝2 , 𝑝3 , … , 𝑝𝑛 are the only

prime numbers, so that 𝑝 must be equal to one of 𝑝1 , 𝑝2 , 𝑝3 , … , 𝑝𝑛 . Combining the

divisibility relation 𝑝|𝑝1 𝑝2 … 𝑝𝑛 with 𝑝|𝑃, we arrive at 𝑝|𝑃 − 𝑝1 , 𝑝2 , 𝑝3 , … , 𝑝𝑛 or,

equivalently, 𝑝|1. The only positive divisor of the integer 1 is 1 itself and, because 𝑝 > 1,

a contradiction arises. Thus, no finite list of primes is complete, hence the number of primes

is infinite.

Example 4.3. Suppose 2, 3, 5,7 are the only primes. Let 𝑃 = 1 + 2 ∙ 3 ⋅ 5 ∙ 7, then 𝑃 =

211.

The significance of this method is to show primes less than a given number. Sieve of

Eratosthenes is not considered a method of factorization, but this method is of great help

in performing other kinds of factorization.

b. Brute force method (trial division).

The definition of a prime already provides a way to determine whether a given

integer 𝑛 > 1 is prime. We could systematically or randomly divide 𝑛 by its potential

positive nontrivial divisors, the integers from 2 to 𝑛 − 1. If for some division the remainder

term is zero, then 𝑛 has a nontrivial divisor and is therefore composite. Otherwise, 𝑛 is

prime.
21

Theorem 4.3. Let 𝑝 > 1 be an integer. Then 𝑝 has no prime divisor less than or equal to

√𝑝 if and only if p is prime.

Proof. The sufficiency part is actually Theorem 4.1. To show the necessary part that 𝑝

has no prime divisor, then the only prime divisor of 𝑝 is itself. Indeed, we have 𝑝 > √𝑝

since 𝑝 > 1. So 𝑝 has no prime divisor less than or equal to √𝑝.

The amount of work required by this method can be costly. First, we require a

complete list of primes less than or equal to √𝑛. Generating such a list can be done using

the Sieve of Eratosthenes. If 𝑛 has many digits, however, then acquiring such a list is a

formidable task. Second, once we have obtained the required list of primes, we need to do

trial divisions by the primes in the list, of which there may be a great many.

Example 4.4.

We can determine whether 𝑛 = 9701 is prime using the primes less than 100

found in Figure 1 of sieve of Eratosthenes since √𝑛 ≤ 100. Performing trial divisions

systematically or randomly, we find that division by 89 yields a zero remainder and

therefore 𝑛 is composite.
22

Table 1. Division of 𝑛 by primes ≤ √9701.

𝒏 Primes ≤ √𝒏 Answer 𝒏 Primes ≤ √𝒏 Answer


9701 2 4850.5 9701 43 225.6

9701 3 3233.67 9701 47 206.4

9701 5 1940.2 9701 53 183.04

9701 7 1385.86 9701 59 164.42

9701 11 881.91 9701 61 159.03

9701 13 746.23 9701 67 144.79

9701 17 570.65 9701 71 136.63

9701 19 510.58 9701 73 132.89

9701 23 421.78 9701 79 122.8

9701 29 334.52 9701 83 116.88

9701 31 312.94 9701 89 109

9701 37 262.19 9701 97 100.01

9701 41 236.61

The significance of brute force method (trial division) is to test if the given number

is prime. But as the given number becomes bigger it is hard to test whether the number is

prime or not. Thus, trial division is a time-consuming kind of factorization when the

number is large.
23

c.) Prime Factorization

Let 𝑝1 , 𝑝2 , … , 𝑝𝑘 be prime numbers satisfying 𝑝1 ≤ 𝑝2 ≤ … ≤ 𝑝𝑘 . Then their

product is called a prime factorization of the number 𝑛 = 𝑝1 𝑝2 … 𝑝𝑘 and the primes

𝑝1 , 𝑝2 , … , 𝑝𝑘 are called the prime factors of 𝑛. Note that it is part of the definition of a prime

factorization that the prime factors are written down in order from smallest to largest when

read from left to right (where the same prime number may appear multiple times in the

product).

Lemma 4.1. Every integer number 𝑛 > 1 is equal to a product of (possibly just one) prime

numbers.

Proof. Suppose that the claim is false. Then there is at least one integer larger than 1 which

is not equal to a product of prime numbers. Let 𝑚 be the smallest such integer. Since 𝑚 is

not a product of prime numbers, 𝑚 cannot be prime and must be composite. So there are

integers 𝑎 and 𝑏 such that 𝑚 = 𝑎𝑏, 1 < 𝑎 < 𝑚 and 1 < 𝑏 < 𝑚. However, 𝑚 was the

smallest integer larger than 1 which was not equal to a product of primes, so both 𝑎 and 𝑏

must be equal to products of primes, implying that 𝑚 = 𝑎𝑏 has to be equal to a product

of primes after all. Contradiction.

Lemma 4.1., says that every integer larger than 1 is equal to a product of primes, and

hence has a prime factorization (just write down the factors in increasing order).

Lemma 4.2. (Bézout’s lemma). The greatest common divisor of two positive integer

numbers 𝑎 and 𝑏 is the smallest positive integer of the form 𝑎𝑥 + 𝑏𝑦, where 𝑥 and 𝑦 are

integer (but not necessarily positive) numbers.


24

Proof. Let 𝐴 be the set of all integer numbers of the form 𝑎𝑥 + 𝑏𝑦, where 𝑥 and 𝑦 are

integer (possibly 0 or negative) numbers, and let 𝑑 be the smallest positive number in the

set 𝐴. By definition of 𝐴, there are integer numbers 𝑢 and 𝑣 such that 𝑑 = 𝑎𝑢 + 𝑏𝑣.

Let 𝑞 and 𝑟 be the quotient and remainder of the division of 𝑎 by 𝑑, so that 𝑎 = 𝑞𝑑 + 𝑟

with 0 ≤ 𝑟 < 𝑑. Then,

𝑟 = 𝑎 − 𝑞𝑑 = 𝑎 − 𝑞(𝑎𝑢 + 𝑏𝑣) = 𝑎(1 − 𝑞𝑢) + 𝑏(−𝑞𝑣),

which shows that 𝑟 is an element of 𝐴. However, 𝑑 was the smallest positive element of 𝐴,

so 𝑟 must be 0. Hence, 𝑑 divides 𝑎. A similar argument shows that 𝑑 divides 𝑏, so 𝑑 is a

common divisor of 𝑎 and 𝑏. Now suppose that 𝑒 is also a common divisor of 𝑎 and 𝑏. Then

there is integer quotients 𝑞1 and 𝑞2 such that 𝑎 = 𝑞1 𝑒 and 𝑏 = 𝑞2 𝑒. But then 𝑑 = 𝑎𝑢 +

𝑏𝑣 = 𝑞1 𝑒𝑢 + 𝑞2 𝑒𝑣 = (𝑞1 𝑢 + 𝑞2 𝑣)𝑒, and since 𝑑 and 𝑒 are positive, it must be the case

that (𝑞1 𝑢 + 𝑞2 𝑣) ≥ 1, and hence 𝑑 ≥ 𝑒. It follows that 𝑑 is the greatest common divisor

of 𝑎 and 𝑏.

As an aside, we remark that the above proof shows that every common divisor of two

positive integer numbers 𝑎 and 𝑏 is in fact also a divisor of the greatest common divisor of

𝑎 and 𝑏.

Lemma 4.3. (Euclid’s lemma). Let 𝑝 be a prime number, and let 𝑎1 , 𝑎2 , … , 𝑎𝑘 , be positive

integer numbers (𝑘 ≥ 2). If 𝑝 does not divide any of the numbers 𝑎1 , 𝑎2 , … , 𝑎𝑘 , then

𝑝 does not divide the product 𝑎1 , 𝑎2 , … , 𝑎𝑘 .


25

Proof. Let 𝑝 be a prime which does not divide any of the positive integer numbers

𝑎1 , 𝑎2 , … , 𝑎𝑘 . Assume that 𝑝 does divide the product𝑎1 𝑎2 … 𝑎𝑘 . Then, since 𝑝 does not

divide 𝑎1 , there must be an integer 𝑖 satisfying 2 ≤ 𝑖 ≤ 𝑘, such that 𝑝 divides

𝑎1 𝑎2 … 𝑎𝑖 , but does not divide 𝑎1 𝑎2 … 𝑎𝑖−1 . Since 𝑝 divides 𝑎1 𝑎2 … 𝑎𝑖 , we have

𝑎1 𝑎2 … 𝑎𝑖 = 𝑞𝑝 for some quotient 𝑞. Moreover, because 𝑝 is prime and does not divide 𝑎𝑖 ,

the greatest common divisor of 𝑝 and 𝑎𝑖 must be 1, so that by Bézout’s lemma, there are

integer numbers 𝑥 and 𝑦 such that 𝑎𝑖 𝑥 + 𝑝𝑦 = 1. Therefore,

𝑎1 𝑎2 … 𝑎𝑖−1 = 𝑎1 𝑎2 … 𝑎𝑖−1 (𝑎𝑖 𝑥 + 𝑝𝑦) = (𝑞𝑥 + 𝑎1 … 𝑎𝑖−1 𝑦)𝑝,

which shows that 𝑎1 𝑎2 … 𝑎𝑖−1 is divisible by 𝑝. But this contradicts our definition of 𝑖, so

we conclude that 𝑝 cannot divide 𝑎1 𝑎2 … 𝑎𝑘 .

Theorem 4.4.

(Prime factorization theorem or the fundamental theorem of arithmetic). Every integer

𝑛 > 1 has a unique prime factorization.

Proof. Lemma 4.1., establishes that every integer larger than 1 has at least one prime

factorization, but we still have to prove that this prime factorization is unique. To prove

this, suppose that there are integer numbers larger than 1 that have more than 1 prime

factorization. Then there is a smallest such integer. Call it 𝑛, and let 𝑝1 𝑝2 … 𝑝𝑘 and

𝑞1 𝑞2 … 𝑞𝑙 be two different prime factorizations of 𝑛. Clearly, if 𝑘 = 1 or 𝑙 = 1, then the

number 𝑛 would itself be prime and the two prime factorizations would have to be equal,

so it must be the case that 𝑘 ≥ 2 𝑎𝑛𝑑 𝑙 ≥ 2. Now let 𝑟 be the largest of the two primes
26

𝑝𝑘 and 𝑞𝑙 . Regardless which of the two is larger, from the the two prime factorizations of

𝑛 it follows that the number 𝑛 is divisible by 𝑟. In particular, the product 𝑝1 𝑝2 … 𝑝𝑘 is

divisible by 𝑟, so by Euclid’s lemma, at least one of the factors 𝑝1 𝑝2 … 𝑝𝑘 must be divisible

by 𝑟. Since 𝑝1 ≤ 𝑝2 ≤ … ≤ 𝑝𝑘 ≤ 𝑟, it follows that 𝑟 = 𝑝𝑘 . By a similar argument, 𝑟 =

𝑞𝑙 as well. But this is impossible, because then the number 𝑛/𝑟 would be an integer number

smaller than 𝑛 with two different prime factorizations 𝑝1 𝑝2 … 𝑝𝑘−1 and 𝑞1 𝑞2 … 𝑞𝑙−1

Remark. The unique prime factorization of an integer number 𝑛 > 1 is also commonly

written in the form

𝑒 𝑒 𝑒
𝑛 = 𝑝11 𝑝22 … 𝑝𝑘𝑘 , where 𝑝1 , 𝑝2 , … , 𝑝𝑘

are distinct prime numbers such that 𝑝1 < 𝑝2 < … < 𝑝𝑘 , and 𝑒1 , 𝑒2, … 𝑒𝑘 are the respective

powers to which each of these prime factors is raised, where each of these powers is an

integer larger than 0. If we now choose integer numbers 𝑑1 , 𝑑2 , … , 𝑑𝑘 such that 0 ≤ 𝑑1 ≤

𝑒1 , 0 ≤ 𝑑2 ≤ 𝑒2 , … ,0 ≤ 𝑑𝑘 ≤ 𝑒𝑘 , then the integer number whose prime factorization is

𝑑 𝑑 𝑑
𝑝1 1 𝑝2 2 … 𝑝𝑘 𝑘 is clearly a divisor of 𝑛. In fact, by the prime factorization theorem, every

divisor of 𝑛 must have a prime factorization of this form. It follows that 𝑛 has exactly

(𝑒1 + 1)(𝑒2 + 1) · · · (𝑒𝑘 + 1) divisors.

Example 4.5. Find the prime Factorization of 𝑛 = 228

We can determine the prime factors of 228 by dividing the number 𝑛 by the first prime

number which is 2 and continue dividing by 2 until you get a decimal or remainder. Then
27

divide by prime numbers 3, 5, 7, etc. Until the only numbers left are prime numbers.

228

114 2

57 2

19 3

𝑛 = 22 ⋅ 3 ⋅ 19

Figure 5. Prime factorization of 228.

The significance of prime factorization is to show that any number can be written

as a product of prime numbers. This method is much faster than other factorization

identified even if the number given number is big.

d. Fermat’s Factorization Method

In a fragment of a letter, written in all probability to Father Marin Mersenne in

1643, Fermat described a technique of his for factoring large numbers. This represented

the first real improvement over the classical method of attempting to find a factor of 𝑛 by

dividing by all primes not exceeding√𝑛. Fermat's factorization scheme has at its heart the

observation that the search for factors of an odd integer 𝑛 (because powers of 2 are easily

recognizable and may be removed at the outset, there is no loss in assuming that 𝑛 is odd)

is equivalent to obtaining integral solutions 𝑥 and 𝑦 of the equation 𝑛 = 𝑎2 − 𝑏 2 .


28

Theorem 4.5. If 𝑛 is a non-prime odd positive integer, then there is a one to one

correspondence between the factorizations of 𝑛 into two positive integers and the product

of the sum and difference (𝑎 − 𝑏) and (𝑎 + 𝑏) is equal to 𝑛.

Proof. Let n be an odd positive integer and let 𝑛 = 𝑥𝑦 be a factorization of n into two

positive integers. Then n can be written as the difference of two squares, since

𝑥+𝑦 2 𝑥−𝑦 2
𝑛 = 𝑥𝑦 = [ ] −[ ] ’
2 2

(𝑥+𝑦) (𝑥−𝑦)
where and are both integers since x and y are both odd.
2 2

Conversely, if n is the difference of two squares, say 𝑛 = 𝑎2 − 𝑏 2 , then we can factor n by

noting that 𝑛 = (𝑎 + 𝑏)(𝑎 − 𝑏).

Steps:

1. Given an odd integer 𝑛, identify the smallest integer k for which 𝑘 2 ≥ n .This is done

by getting an interval for which √𝑛 ≤ k.

2. Let 𝑎𝑖 = ( 𝑘 + 𝑖 )2 – 𝑛 for 𝑖 = 0,1,2, … , 𝑛. Once we find an 𝑎𝑖 that is a perfect square,

we write 𝑛 = ( 𝑘 + 𝑖)2 - 𝑎𝑖 = (𝑘 + 𝑖 + √𝑎𝑖 ) (𝑘 + 𝑖 − √𝑎𝑖 ) which is now considered as

the factorization of 𝑛 .

Example 4.6. To illustrate the application of Fermat's method, let us factor the

integer 𝑛 = 119143. From a table of squares, we find that 3452 < √119143 < 3462 ;

thus it suffices to consider values of 𝑘 2 − 119143 for those 𝑘 that satisfy the inequality

346 ≤ 𝑘 < (119143 + 1)/2 = 59572. The calculations begin as follows:


29

3462 − 119143 = 119716 − 119143 = 573

3472 − 119143 = 120409 − 119143 = 1266

3482 − 119143 = 121104 − 119143 = 1961

3492 − 119143 = 121801 − 119143 = 2658

3502 − 119143 = 122500 − 119143 = 3357

3512 − 119143 = 123201 − 119143 = 4058

3522 − 119143 = 123904 − 119143 = 4761 = 692

This last line exhibits the factorization

119143 = 3522 − 692 = (352 + 69)(352 − 69) = (421)(283)

the two factors themselves being prime. In only seven trials, we have obtained the prime

factorization of the number 119143. Of course, one does not always fare so luckily; it may

take many steps before a difference turns out to be a square.

Fermat's method is most effective when the two factors of 𝑛 are of nearly the same

magnitude, for in this case a suitable square will appear quickly. To illustrate, let us suppose

that 𝑛 = 23449 is to be factored. The smallest square exceeding 𝑛 is 1542 , so that the

sequence 𝑘 2 − 𝑛 starts with

1542 − 23449 = 23716 − 23449 = 267

1552 − 23449 = 24025 − 23449 = 576 = 242

Hence, we have the factorization of 23449 = 1552 − 242 = (155 + 24)(155 − 24), so

that 179 and 137.

When examining the differences 𝑘 2 − 𝑛 as possible squares, many values can be

immediately excluded by inspection of the final digits. We know, for instance, that a square

must end in one of the six digits 0, 1, 4, 5, 6, 9. This allows us to exclude all values in
30

Example 4.6., save for 1266, 1961, and 4761. By calculating the squares of the integers

from 0 to 99 modulo 100, we see further that, for a square, the last two digits are limited to

the following 22 possibilities:

00 21 41 64 89

01 24 44 69 96

04 25 49 76

09 29 56 81

16 36 61 84

The integer 1266 can be eliminated from consideration in this way. Because 61 is among

the last two digits allowable in a square, it is only necessary to look at the numbers 1961

and 4761; the former is not a square, but 4761 = 692 .

There is a generalization of Fermat's factorization method that has been used with

some success. Here, we look for distinct integers 𝑎 and 𝑏 such that 𝑎2 − 𝑏 2 is a multiple

of 𝑛 rather than 𝑛 itself; that is

𝑎2 ≡ 𝑏 2 (mod 𝑛)

Having obtained such integers, 𝑑 = 𝑔𝑐𝑑(𝑎 − 𝑏, 𝑛) or 𝑑 = 𝑔𝑐𝑑(𝑎 + 𝑏, 𝑛) can be

calculated by means of the Euclidean Algorithm. Clearly, 𝑑 is a divisor of 𝑛.

The integer 𝑛 is usually the product of two primes 𝑥 and 𝑦, with 𝑥 < 𝑦, so that 𝑑 is

equal to (𝑎 + 𝑏)(𝑎 − 𝑏) 𝑜𝑟 𝑥𝑦. Now the congruence 𝑎2 ≡ 𝑏 2 (𝑚𝑜𝑑 𝑛) converts into

𝑥𝑦|(𝑎 − 𝑏)(𝑎 + 𝑏). Lemma 4.3. tells us that 𝑥 and 𝑦 must divide one of the factors. If it

happened that 𝑥|𝑎 − 𝑏 and 𝑦|𝑎 − 𝑏, then 𝑥𝑦|𝑎 − 𝑏, or expressed as a congruence 𝑎 ≡

𝑏(𝑚𝑜𝑑 𝑛). Also, 𝑥|𝑎 + 𝑏 and 𝑦|𝑎 + 𝑏 will produce 𝑎 ≡ −𝑏 (𝑚𝑜𝑑 𝑛). By obtaining

integers 𝑎 and 𝑏 satisfying 𝑎2 ≡ 𝑏 2 (𝑚𝑜𝑑 𝑛), where 𝑎 ≢ ±𝑏 (𝑚𝑜𝑑 𝑛 ), these two

30
31

situations are ruled out. The result of all this is that 𝑑 is either 𝑥 or 𝑦, giving us a nontrivial

divisor of 𝑛.

Example 4.7. Suppose we wish to factor the positive integer 𝑛 = 2189 and happen to

notice that 5792 ≡ 182 (𝑚𝑜𝑑 2189). Then we compute

𝑔𝑐𝑑(579 − 18 , 2189) = 𝑔𝑐𝑑(561 , 2189) = 11

using the Euclidean Algorithm:

2189 = 3 ∙ 561 + 506

561 = 1 ∙ 506 + 55

506 = 9 ∙ 55 + 11

55 = 5 ∙ 11

This leads to the prime divisor 11 of 2189. The other factor, namely 199, can be

obtained by observing that

𝑔𝑐𝑑(579 + 18, 2189) = 𝑔𝑐𝑑(597, 2189) = 199

We come to a number such as 579, whose square modulo 2189 also turns out to be a perfect

square. In looking for squares close to multiples of 2189, it was observed that

812 − 3 · 2189 = −6 and 1552 − 11 · 2189 = −54

which translates into

812 ≡ −2 · 3 (𝑚𝑜𝑑 2189) and 1552 ≡ −2 · 33 (𝑚𝑜𝑑 2189)

When these congruences are multiplied, they produce

(81 · 155)2 ≡ (2 · 32 )2 (𝑚𝑜𝑑 2189)

Because the product 81 · 155 = 12555 ≡ −579 (𝑚𝑜𝑑 2189), we ended up with the

congruence 5792 ≡ 182 (𝑚𝑜𝑑 2189). The basis of our approach is to find several 𝑎𝑖
32

having the property that each 𝑎𝑖2 is, modulo 𝑛, the product of small prime powers, and such

that their product's square is congruent to a perfect square.

When 𝑛 has more than two prime factors, our factorization algorithm may still be

applied; however, there is no guarantee that a particular solution of the congruence 𝑎2 ≡

𝑏 2 (𝑚𝑜𝑑 𝑛) 𝑎2 ≡ 𝑏 2 (𝑚𝑜𝑑 𝑛) with 𝑎 ≢ ±𝑏 (𝑚𝑜𝑑 𝑛), will result in a nontrivial divisor of

𝑛. Of course the more solutions of this congruence that are available, the better the chance

of finding the desired factors of 𝑛. Our next example provides a considerably more efficient

variant of this last factorization method. It was introduced by Maurice Kraitchik in the

1920’s and became the basis of such modern methods as the quadratic sieve algorithm.

Example 4.8. Let 𝑛 = 12499 be the integer to be factored. The first square just larger

than 𝑛 is 1122 = 12544. So we begin by considering the sequence of numbers 𝑎2 – 𝑛 for

𝑥 = 112, 113, … As before, our interest is in obtaining a set of values 𝑎𝑖 , 𝑎2 , … , 𝑎𝑘 for

which the product (𝑎𝑖 − 𝑛) ⋅⋅⋅ (𝑎𝑘 − 𝑛) is a square, say 𝑦 2 Then (𝑎1 ⋅⋅⋅ 𝑎𝑘 )2 ≡

𝑦 2 (𝑚𝑜𝑑 𝑛), which might lead to a nontrivial factor of 𝑛.

A short search reveals that

1122 − 12499 = 45

1172 − 12499 = 1190

12122 − 12499 = 2142

or, written as congruence,

1122 ≡ 32 ⋅ 5 (𝑚𝑜𝑑 12499)

1172 ≡ 2 ⋅ 5 ⋅ 7 · 17 (𝑚𝑜𝑑 12499)

1212 ≡ 2 ⋅ 32 ⋅ 7 · 17 (𝑚𝑜𝑑 12499)


33

Multiplying these together results in the congruence

(112 · 117 · 121)2 ≡ (2 · 32 · 5 · 7 · 17)2 (𝑚𝑜𝑑 12499)

that is,

15855842 ≡ 107102 (𝑚𝑜𝑑 12499)

But we are unlucky with this square combination. Because

1585584 ≡ 10710 (𝑚𝑜𝑑 12499)

only a trivial divisor of 12499 will be found. To be specific,

𝑔𝑐𝑑(1585584 + 10710, 12499) = 1

𝑔𝑐𝑑(1585584 − 10710, 12499) = 12499

After further calculation, we notice that

1132 ≡ 2 · 5 · 33 (𝑚𝑜𝑑 12499)

1222 ≡ 2 ⋅ 3 · 5 · 112 (𝑚𝑜𝑑 12499)

which gives rise to the congruence

(113 · 127)2 ≡ (2 · 32 · 5 · 11)2 (𝑚𝑜𝑑 12499)

This reduces modulo 12499 to

18522 ≡ 9902 (𝑚𝑜𝑑 12499)

and fortunately 1852 ≢ ± 990 (𝑚𝑜𝑑 12499). Calculating

𝑔𝑐𝑑(1852 − 990, 12499) = 𝑔𝑐𝑑(862, 12499) = 431

produces the factorization 12499 = 29 · 431.


34

The significance of Fermat’s factorization is to illustrate that any odd positive

number (non-prime) can be written as a difference of two squares. As stated above, this

factorization is most effective when the factors of 𝑛 are of nearly to each other. But if the

factors are distant to each other, we will perform bunch of trials to have the factors.
35

Determining when the Fermat’s pair of factors is a combination of primes and not a

combination of two primes.

In Fermat’s factorization, a given positive odd integer say 𝑛 (non-prime) has two

factors. In here we will show that the factors are not always primes, but it can be both

composite and a combination or prime and composite. We will show also when will the

Fermat’s pair of factors can be a combination of primes or not.

a. To show that a given positive odd integer 𝑛 which is non-prime has a pair of factors that

are both primes, we provide randomly selected integer 𝑛 with four divisors including 1 and

itself as an illustration. We just observed that mostly 𝑛 with four numbers of divisors has

both primes as Fermat’s pair of factors.

Table 2. Illustration of 𝑛 with four divisors.

Randomly Selected 𝒏 Fermat’s Pair of Factors Observation on Pair of Factors


1. 59461 (613)(97) Both prime numbers.
2. 6139 (877)(7) Both prime numbers.
3. 89467 (12781)(7) Both prime numbers.
4. 2589 (863)(3) Both prime numbers.
5. 412391 (58913)(7) Both prime numbers.
6. 742831 (32297)(23) Both prime numbers.
7. 198631 (1429)(139) Both prime numbers.
8. 2965 (593)(5) Both prime numbers.
9. 4821 (1607)(3) Both prime numbers.
10. 589367 (20323)(29) Both prime numbers.
36

b. To show that a given positive odd integer 𝑛 which is non-prime has a combination of

Fermat’s factors that are composite and prime, we provide randomly selected integer 𝑛

with number of divisors say 𝑑 are 6 ≤ 𝑑 ≤ 16 as an illustration. We just observed that

mostly 𝑛 with 6 ≤ 𝑑 ≤ 16 numbers of divisors has a combination of prime and composite

as Fermat’s pair of factors.

Table 3. Illustration of 𝑛 with six divisors.

Randomly Selected 𝒏 Fermat’s Pair of Factors Observation on Pair of Factors


1. 21393 (2377)(9) Prime and composite.
2. 117 (13)(9) Prime and composite.
3. 4963 (247)(19) Prime and composite.
4. 425 (25)(17) Prime and composite.
5. 171 (19)(9) Prime and composite.
6. 3211 (169)(19) Prime and composite.
7. 62453 (361)(173) Prime and composite.
8. 74225 (2969)(25) Prime and composite.
9. 8425 (337)(25) Prime and composite.
10. 21537 (2393)(9) Prime and composite.
37

Table 4. Illustration of 𝑛 with eight divisors.

Randomly Selected 𝒏 Fermat’s Pair of Factors Observation on Pair of Factors


1. 42365 (229)(185) Prime and composite.
2. 523689 (769)(681) Prime and composite.
3. 38967 (419)(93) Prime and composite.
4. 41973 (823)(51) Prime and composite.
5. 19581 (183)(107) Prime and composite.
6. 36955 (389)(95) Prime and composite.
7. 74239 (397)(187) Prime and composite.
8. 85263 (293)(291) Prime and composite.
9. 208731 (1697)(123) Prime and composite.
10. 31269 (1489)(21) Prime and composite.

Table 5. Illustration of 𝑛 with 10 ≤ 𝑑 ≤ 16.

Randomly Selected 𝒏 Fermat’s Pair of Factors Observation on Pair of Factors


1. 98125 (625)(157) Prime and composite.
2. 65264 (4079)(16) Prime and composite.
3. 8631 (137)(630 Prime and composite.
4. 75231 (643)(117) Prime and composite.
5. 97641 (571)(1710 Prime and composite.
6. 96471 (397)(243) Prime and composite.
7. 643185 (14293)(45) Prime and composite.
8. 32697 (189)(173) Prime and composite.
9. 13695 (165)(83) Prime and composite.
10. 10536 (439)(24) Prime and composite.
38

c. To show that a given positive odd integer 𝑛 which is non-prime has a combination of
Fermat’s factors that are both composites, we provide randomly selected integer 𝑛 with
number of divisors say 𝑑 are 18 ≤ 𝑑 ≤ 32 as an illustration. We just observed that mostly
𝑛 with 18 ≤ 𝑑 ≤ 32 numbers of divisors has both composites as Fermat’s pair of factors.

Table 6. Illustration of 𝑛 with 18 ≤ 𝑑 ≤ 32.

Randomly Selected 𝒏 Fermat’s Pair of Factors Observation on Pair of Factors


1. 64251 (363)(177) Both composite numbers.
2. 8056191 (2937)(2743) Both composite numbers.
3. 963125 (1541)(625) Both composite numbers.
4. 107811 (363)(297) Both composite numbers.
5. 58653 (343)(171) Both composite numbers.
6. 86275 (425)(203) Both composite numbers.
7. 463197 (959)(483) Both composite numbers.
8. 58695 (273)(215) Both composite numbers.
9. 60543 (279)(217) Both composite numbers.
10. 8094135 (3297)(2455) Both composite numbers.

The above tables are just an illustration, we just conjectured on all of our

observation. This are all claims that needs to be prove or disprove.


39

Algorithm to find the divisors of a given positive odd (non-prime) integer 𝒏.

This algorithm is a way how to find the Fermat’s factors of 𝑛. This algorithm has

a great help for us since we use this in finding the Fermat’s pair of factors. It will take us

bunch of time if we use the usual way in finding the Fermat’s pair of factors in the

previous discussions.

We will show first the flowchart illustration in finding the divisors of a given

positive odd (non-prime) number 𝑛.

#include <stdio.h>
int main()

int x, i;
printf(“∖nInput an integer. ”);
scanf(“%d”, &x);
printf(“All the divisor of %d are: ”, x);
i=1

i <= x ?

No Yes
o
return 0; (x%i) == 0 ?

Yes

End printf(“∖n%d”, i);


No printf(“∖n”);

i++

Figure 6. Algorithm to find all divisors of a number.


40

In finding the factors through the source code, we just count the number of divisors

(𝑑) of 𝑛. Then, arrange the numbers from lowest to highest, select on the number of divisors

𝑑 𝑑
which is 𝑥 = and 𝑦 = ( 2 ) + 1. Refer to table 7 below.
2

We will also show the source code using C in finding the divisors of a given positive

odd (non-prime) number 𝑛.

1 #include <stdio.h>
2 int main() {
3 int x, i;

4 printf(“ \nInput an integer: ”);


5 scanf(“%d”, &x);

6 printf(“All the divisor of %d”);

7 for (i = 1; i <= x; i++) {

8 if ((x%i) == 0){

9 printf(“\n%d”, i);

10 printf(“\n”);

11 }
12 }

13 return 0;
14 }

Figure 7. Source code to find all divisors of a number.


41

Input an integer: 45
All the divisor of 45 are:

15

45

Figure 8. Sample output of source code.

This is the pictorial presentation:

45 = 1x 45

45 = 3 x 15

45 = 5 x 9

Divisors: 1, 3, 5, 9, 15, 45

From the given example, the 𝑥 and 𝑦 will be 9 and 5 which is obtained from the equation

𝑑 𝑑
𝑋= 𝑎𝑛𝑑 𝑌 = ( 2 ) + 1, 𝑑 is the number of divisors. Select the 𝑋 and 𝑌 from the
2

arrangements in ascending order. The Fermat’s factors of 𝑛 are 9 and 5. Observed that it is

a combination of prime and composite since the total number of divisors are six.
42

SUMMARY, CONCLUSION AND RECOMMENDATIONS

This chapter presents the summary of the findings, the conclusion formulated is

based on the results and discussions, and the research direction processed from the

conclusion.

Summary

This study presents exposition on some method of factorization. The methods of

factorization are namely: Sieve of Eratosthenes, trial division (brute force), prime

factorization and Fermat’s factorization. The researchers provided a detailed analysis on

some method of factorization identified. They also included remarks and some significance

to show some characteristics of different method of factorization. They also introduced

another way to find the Fermat’s pair of factors through the cited work of Maurice

Kratchick in 1920’s.

In this study, the researchers were able to determine when the Fermat’s pair of

factors is a combination of two primes, that is, when the total number of divisors of a given

positive odd (non- prime) number are four. Through their observation on some randomly

chosen numbers, they were able to come up with this result. They also discussed when the

Fermat’s pair of factor is a combination of prime and composite wherein they conducted

on observation to some randomly chosen odd positive (non-prime) numbers and found out

that most of the numbers with the total number of all divisors are greater than or equal to

six but less than or equal to sixteen 6 ≤ 𝑑 ≤ 16 has a combination of prime and composite.

For them also to show that a given positive odd (non-prime) number has a combination of
43

Fermat’s pair of factors that are both composites, they again observed the randomly chosen

number and found out that most numbers with the total number of all divisors are greater

than or equal eighteen but less than or equal thirty two 18 ≤ 𝑑 ≤ 32. They provided tables

for the summary of the numbers that they randomly obtained for the readers to easily

understand the characteristics of Fermat’s pair of factors. For all of the result on the second

objective, they just conjectured on all of their observation.

The researcher also included an algorithm to find the divisors of a randomly chosen

number. This algorithm is to check the primality as well as to find all the divisors of a

number. This algorithm is of great help for them. It will be a time consuming if they

perform the usual Fermat’s factorization method to find the pair factors. They provided the

source code of the algorithm in which it displays the divisors only and when selecting the

𝑑 𝑑
pair of factors, consider this equation 𝑥 = 𝑎𝑛𝑑 𝑦 = ( 2 ) + 1, where 𝑥 and 𝑦 are the
2

Fermat’s pair of factors and 𝑑 are the total number of divisors.

The researchers were able to analyze some methods of factorization, they found the

characteristics of every Fermat’s pair of factors and they were also provided an easy way

to find the Fermat’s pair of factors. They observed and analyze some method of

factorization and randomly obtained numbers in support to this study. They invest time and

patience to analyze every books they have and every numbers they obtained to come up

with result and discussion about the exposition on some methods of factorization.
44

Conclusion

The researcher we’re able to discuss the Exposition on Some Methods of

Factorization.

Based on the results and discussions, the exposition on some methods of factorizations

includes analysis on factorization identified to observe their differences. It also includes

the properties of Fermat’s factorization method in which they used tables to show the

characteristics of randomly chosen numbers. They also provide an algorithm to find the

divisors of a given number and a source code using C++ program.

Recommendation

In the findings of our study, we highly recommend to the future researchers to

formulate a theorem to prove or disproved our observation on the characteristics of

Fermat's pair of factors.


45

References

Abdulla, D. et al. (2018). Prime Numbers Comparison Using Sieve of Eratosthenes and
Sieve of Sundaram Algorithm. Indonesia.

Bressound D., Wagon S. (2000). A Course in Computational Number Theory. New York
(NY): Key College Publishing. 367 p.

Burton, D. M. (2007). Elementary Number Theory (6th Edition). Published by Mc Graw -


Hill Companies, Inc. 1221 Avenue of the Americas, New York, USA. 10020
ISBN – 13 978 – 0 – 07- 305188-8. ISBN – 10 0- 07- 305188-8.

Cafiero, F. Improving Trial Division: First – Digit Analysis.

Kager, W. (2013). Prime Factorization. VU University, Department of Mathematics, De


Boelelaan 1081A. Amsterdam, The Netherlands.

Khoo Phon Sai. Reflection on HCF and LCM: A Variety of Mathematical Connections.

Kleiner, I. (2012) Excursions in the History of Mathematics, Chapter 2. Fermat: The


Founder of Modern Number Theory. Springer Science+Business Media, LLC
2012.

Krakanis, E. (1986). Primality and Cryptography. Chichester (United Kingdom) : John


Wiley and Sons. 235 p.

Krauel, J. (2013). Some Methods of Primality Testing. Lakehead University, Thunder Bay,
Ontario, Canada.

Lenstra, A. K. (2000). Designs, Codes and Cryptography. Kluwer Academic Publishers,


Boston, USA, 19.101 – 128.

Prince, J.R. (2011). Prime Factorization: A History and Discussion. Texas A & M
University.
46

Smith, F. J. (2006). A Brief History of Factorization Techniques. CSE590-Practical


Aspects of Modern Cryptography University of Washington.

Sorenson, J. (1990). An Introduction to Prime Number Sieves. Department of Computer


Sciences University of Wisconsin – Madison Madison, WI 53706.

Woodson, J. C. Determining the Optimal Combination of Trial Division and Fermat’s


Factorization Method. Oklahoma State University - Tulsa, the University of
Tulsa and Oral Roberts University.

Web Resource: https.//.www.methods-and-history-of-some-factorization.html.


47

CURRICULUM VITAE 1.5" x 1.5"

ID picture

(white
background)
PERSONAL INFORMATION:

NAME: Antonio, Ethel Kris G.


ADDRESS: Brgy. Barbarangay, Banna, Ilocos Norte
CONTACT NUMBER: 09957210979
E-MAIL ADDRESS: ablazeforgod12@gmail.com
DATE OF BIRTH: December 23,1996
PLACE OF BIRTH: Banna
GENDER: Female
PARENTS
Father: Willie A. Austria
Mother: Lorna A. Austria

EDUCATIONAL BACKGROUND:

TERTIARY: Bachelor of Science in Mathematics


College of Arts and Sciences
Mariano Marcos State University
City of Batac, Ilocos Norte
2014-2019

SECONDARY: Banna National High School


Banna, Ilocos Norte
2010-2014

ELEMENTARY: Barbarangay Elementary School


Banna, Ilocos Norte
2004-2010
48

CURRICULUM VITAE 1.5" x 1.5"

ID picture

(white
background)
PERSONAL INFORMATION:

NAME: Garcia, Vea Charlotte B.


ADDRESS: Brgy. Gabut Sur, Badoc, Ilocos Norte
CONTACT NUMBER: 09363505389
E-MAIL ADDRESS: Charlottegarcia@yahoo.com
DATE OF BIRTH: November 16, 1998
PLACE OF BIRTH: Badoc
GENDER: Female
PARENTS
Father: Jose P. Garcia
Mother: Luzviminda B. Garcia

EDUCATIONAL BACKGROUND:

TERTIARY: Bachelor of Science in Mathematics


College of Arts and Sciences
Mariano Marcos State University
City of Batac, Ilocos Norte
2015-2019

SECONDARY: Juan Luna Memorial Academy


Badoc, Ilocos Norte
2011-2015

ELEMENTARY: Gabut Elementary School


Badoc, Ilocos Norte
2005-2011
49

CURRICULUM VITAE 1.5" x 1.5"

ID picture

(white
background)
PERSONAL INFORMATION:

NAME: Villaraza, Cely Marie


ADDRESS: Brgy. Gabut Norte, Badoc, Ilocos Norte
CONTACT NUMBER: 09280842346
E-MAIL ADDRESS: cmvillaraza27@gmail.com
DATE OF BIRTH: February 27, 1999
PLACE OF BIRTH: Badoc
GENDER: Female
PARENTS
Father: Celerino O. Baybado
Mother: Maria V. Baybado

EDUCATIONAL BACKGROUND:

TERTIARY: Bachelor of Science in Mathematics


College of Arts and Sciences
Mariano Marcos State University
City of Batac, Ilocos Norte
2015-2019

SECONDARY: Juan Luna Memorial Academy


Badoc, Ilocos Norte
2011-2015

ELEMENTARY: Gabut Elementary School


Badoc, Ilocos Norte
2005-2011

S-ar putea să vă placă și