Professional Documents
Culture Documents
1 49
1 49
INTRODUCTION
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
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
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).
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).
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
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.
of 𝑛.
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).
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.
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
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
𝑥+𝑦 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 𝑏
by first determining the smallest integer 𝑘 for which 𝑘 2 ≥ 𝑛. Now look successively at the
discovered earlier, then 𝑛 has no other factor than 𝑛 and 1, in this case 𝑛 is a prime number
General Objective
Specific Objectives
2. To determine when the Fermat’s pair of factors is a combination of primes and not a
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
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
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
.
8
information related to this study was gathered from internet services, articles and books.
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
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
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.
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
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
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
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
in the 1920s. He suggested that instead of trying to find 𝑥 and 𝑦 such that x2 – y2 = n it
J.P. Sorenson said that a prime sieve is a procedure that finds the prime up to 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
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
PRELIMINARIES
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,
that 𝑚 is a divisor of 𝑛 or 𝑚 divides 𝑛 and write 𝑚 | 𝑛. Similarly, we say that 𝑚 does not
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
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
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
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
contains one and only one representative from equivalence class. The complete residue
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
Definition 3.7. Let 𝑛 be a fixed positive integer. Two integers 𝑎 and 𝑏 are said to be
then 𝑛 is of necessity a prime. The Sieve of Eratosthenes, a technique for finding all primes
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
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
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
𝑒 𝑒 𝑒 𝑒
𝑛 = 𝑝11 ∙ 𝑝22 ∙ 𝑝33 ∙∙∙ 𝑝𝑘𝑘
where 𝑝𝑖 ′𝑠 are distinct primes and there exist 𝑝1 ≤ 𝑝2 ≤ … ≤ 𝑝𝑘 and each exponent
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
Definition 3.7. Let 𝑛 be any non-prime odd integer 𝑛 > 1 if and only if there are non-
observe that (𝑎 − 𝑏) and (𝑎 + 𝑏) are primes this is called the Fermat’s factorization
method.
method, consider the following example. Find the two factors of 𝑛 = 6077.
2. We now look for a perfect square number 𝑎𝑖 such that 𝑎𝑖 = (𝑘 + 𝑖)2 − 6077.
= 812 − 222
= (103)(59).
17
properties of Fermat’s factorization method and an algorithm to find the divisors of a given
number.
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
Proof. Suppose 𝑛 is a composite and each prime divisor 𝑝𝑖 of 𝑛 satisfies 𝑝𝑖 > √𝑛. Since 𝑛
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
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
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
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
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
that there is a last prime, called 𝑃𝑛· Now consider the positive integer 𝑃 =
product of primes then P is divisible by some prime 𝑝. But 𝑝1 , 𝑝2 , 𝑝3 , … , 𝑝𝑛 are the only
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
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
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 𝑝 > √𝑝
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
therefore 𝑛 is composite.
22
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
𝑝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 𝑏
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
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 𝑑 = 𝑎𝑢 + 𝑏𝑣.
which shows that 𝑟 is an element of 𝐴. However, 𝑑 was the smallest positive element of 𝐴,
common divisor of 𝑎 and 𝑏. Now suppose that 𝑒 is also a common divisor of 𝑎 and 𝑏. 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
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
𝑎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
which shows that 𝑎1 𝑎2 … 𝑎𝑖−1 is divisible by 𝑝. But this contradicts our definition of 𝑖, so
Theorem 4.4.
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
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
𝑞𝑙 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
𝑒 𝑒 𝑒
𝑛 = 𝑝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
𝑑 𝑑 𝑑
𝑝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
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
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
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)
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
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
Steps:
1. Given an odd integer 𝑛, identify the smallest integer k for which 𝑘 2 ≥ n .This is done
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
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
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
Hence, we have the factorization of 23449 = 1552 − 242 = (155 + 24)(155 − 24), so
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
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
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
𝑎2 ≡ 𝑏 2 (mod 𝑛)
The integer 𝑛 is usually the product of two primes 𝑥 and 𝑦, with 𝑥 < 𝑦, so that 𝑑 is
𝑥𝑦|(𝑎 − 𝑏)(𝑎 + 𝑏). Lemma 4.3. tells us that 𝑥 and 𝑦 must divide one of the factors. If it
𝑏(𝑚𝑜𝑑 𝑛). Also, 𝑥|𝑎 + 𝑏 and 𝑦|𝑎 + 𝑏 will produce 𝑎 ≡ −𝑏 (𝑚𝑜𝑑 𝑛). By obtaining
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
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
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
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
When 𝑛 has more than two prime factors, our factorization algorithm may still be
𝑛. 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
which the product (𝑎𝑖 − 𝑛) ⋅⋅⋅ (𝑎𝑘 − 𝑛) is a square, say 𝑦 2 Then (𝑎1 ⋅⋅⋅ 𝑎𝑘 )2 ≡
1122 − 12499 = 45
that is,
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
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
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
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 𝑛
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.
The above tables are just an illustration, we just conjectured on all of our
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
#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
i++
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
1 #include <stdio.h>
2 int main() {
3 int x, i;
8 if ((x%i) == 0){
9 printf(“\n%d”, i);
10 printf(“\n”);
11 }
12 }
13 return 0;
14 }
Input an integer: 45
All the divisor of 45 are:
15
45
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
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
factorization are namely: Sieve of Eratosthenes, trial division (brute force), prime
some method of factorization identified. They also included remarks and some significance
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
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
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
Factorization.
Based on the results and discussions, the exposition on some methods of factorizations
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
Recommendation
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.
Khoo Phon Sai. Reflection on HCF and LCM: A Variety of Mathematical Connections.
Krauel, J. (2013). Some Methods of Primality Testing. Lakehead University, Thunder Bay,
Ontario, Canada.
Prince, J.R. (2011). Prime Factorization: A History and Discussion. Texas A & M
University.
46
ID picture
(white
background)
PERSONAL INFORMATION:
EDUCATIONAL BACKGROUND:
ID picture
(white
background)
PERSONAL INFORMATION:
EDUCATIONAL BACKGROUND:
ID picture
(white
background)
PERSONAL INFORMATION:
EDUCATIONAL BACKGROUND: