Determination of a Good Indicator for Estimated Prime Factor and Its Modiﬁcation in Fermat’s Factoring Algorithm

: Fermat’s Factoring Algorithm (FFA) is an integer factorisation methods factoring the modulus N using exhaustive search. The appearance of the Estimated Prime Factor (EPF) method reduces the cost of FFA’s loop count. However, the EPF does not work for balanced primes. This paper proposed the modiﬁed Fermat’s Factoring Algorithm 1-Estimated Prime Factor (mFFA1-EPF) that improves the EPF method. The algorithm works for factoring a modulus with unbalanced and balanced primes, respectively. The main results of mFFA1-EPF focused on three criteria: (i) the approach to select good candidates from a list of convergent continued fraction, (ii) the establishment of new potential initial values based on EPF, and (iii) the application of the above modiﬁcation upon FFA. The resulting study shows the signiﬁcant improvement that reduces the loop count of FFA1 via (improved) EPF compared to existing methods. The proposed algorithm can be executed without failure and caters for both the modulus N with unbalanced and balanced primes factor. The algorithm works for factoring a modulus with unbalanced and balanced primes. shorter than the FFA-Euler loop count. This shows that our method can be compatible with all unbalanced prime.


Introduction
Cryptography has its crucial parts in Industrial Revolution 4 (IR4) where technology is embedded in artificial intelligent to maintain the secureness of the information data. Regarding cryptography, there are two types of cryptography: symmetric and asymmetric cryptography. Symmetric cryptography uses the same key for the encryption and decryption process while asymmetric cryptography uses different keys for each encryption and decryption process. A lot of asymmetric cryptography strength relies on the Integer Factorisation Problem (IFP). IFP is one of the oldest hard mathematical problems in history. IFP is defined as finding the two distinct primes, p and q, for a given integer (a modulus) N = pq, which is the multiplication of those two primes. We et al. [1] mentioned that from the existing classical sense of computation, a modulus with a minimum 1024-bit length is still very hard to be factorised. There are several general purpose algorithms to solve the IFP, such as Pollard's p − 1, General Number Field Sieve, Quadratic Sieve, Elliptic Curve Factoring, and Fermat's Factoring Algorithm [2].
Pierre de Fermat explored Fermat's Factoring Algorithm (FFA) as one of the IFP methods that is used to factor the modulus N with balanced primes (Ambedkar et al. [3]). According to Somsuk and Tientanopajai [4], the modulus N in FFA is written as N = uses multiplication as their main processes that lead to factorization of N. Both methods are having their advantages and disadvantages in terms of the number of loop count (iteration) and computational time to complete the factoring process. Many studies have introduced to improve the FFA, to make the algorithm efficient for factoring the modulus N [5][6][7][8]. The main purpose is to speed up the algorithms: either to reduce the loop count or to improve the algorithm's computational time for exhaustive search or both [9].
The EPF is introduced by Wu et al. [1]. Wu et al's study enhances the efficiency of FFA2 by shortening the search for the target value of p + q and p − q. The EPF method was adopted as a mechanism to reset the initial values of FFA (in this case is FFA2), which results in reducing the loop count for the FFA to complete the search and successfully factor the modulus N. The authors of [1,9] use the continued fraction of 1 √ N to produce a list of convergent and create an additional extension for the initial values. Potentially, EPF is considered as a good "device" to increase the efficiency of FFA.
However, as reported in [1], the absence of a deterministic approach to select the required parameter in EPF is the limitations of such an approach, and most of the cases cannot work on balanced primes. Somsuk [5] agreed that EPF works perfectly only on unbalanced primes. By observation and empirical evidence, the selected values on the list of convergent certainly cannot be used for the initial value because it may cause the FFA2 algorithm to fail. On the other hand, the authors of [1] overlook a convergent-selecting case that affects the effectiveness of EPF. In finding a solution regarding EPF, FFA1 is chosen to be the main integer factorisation method in this study. This is because FFA1 potentially avoids the failure of running algorithm via EPF and reduce the exhaustive search as it uses a single loop run the algorithm. The resulting study shows a significant improvement that reduces the loop count of FFA1 via (improved) EPF compared to previous methods (FFA1, FFA2, FFA2-EPF, and FFA-Euler).
The rest of this paper is sorted as follows. Section 2 introduces the background of the FFA1, FFA2, and EPF. The definition of a modulus N is provided considering unbalanced and balanced primes. Section 3 discusses the methodology that will support the finding of this work. Section 4 presents the mFFA1-EPF, which works on factoring a modulus N for both unbalanced and balanced primes. The results of numerical examples are shown and compared with other existing FFA-based method. The conclusion is drawn in Section 5.

Preliminaries
Some fundamental information for the study, about FFAs and EPF, and some definitions are provided.

Balanced and Unbalanced Primes
This section provided the definitions of balanced and unbalanced primes, which restructure from [10,11], respectively. The definition of balanced prime is as follows. Definition 1. Let N = pq be a number with a multiplication of two primes p and q. The number N is defined to have balanced primes where p and q have the same bit-size and satisfy the relation q < p < 2q.
The term of unbalanced primes is defined, as follows. Definition 2. Let N = pq be a number with a multiplication of two primes p and q. The number N is defined to have unbalanced primes where p and q have the different bit-size and satisfy the relation q < p < αq where α > 2.

Fermat's Factoring Algorithm (FFA)
De Weger [12] studied FFA1 as an approach of IFP to factor the modulus N by searching the value of p + q and p − q. There is modulus N written as the difference of square, N = p+q 2 2 − p−q 2 2 . As the value of p + q and p − q are unknown, we need to find the closest of those values. According to Asbullah and Ariffin [10], the smallest value of p + q, based on balanced prime, is 2 √ N. We start the initial value x = 2 √ N and then, compute y = √ x 2 − N. If y is an integer then we accept the pair (x, y). Otherwise, the algorithm is ran by increasing the value of x by 1. If there is a pair of integers (x, y), then compute the values p = x + y and q = x − y. Note that FFA1 only run a loop on searching the integer value on p + q via initial value of x. Bressoud [13] introduced FFA2, which is uses two loops on searching p + q and p − q to reduce the running time. Wu et al. [1] reformulated the Bressoud's method. Suppose there is modulus N = x 2 − y 2 where x = p+q 2 and y = p−q 2 . The modulus is derived into 4N = u 2 − v 2 where u = 2x and v = 2y. As the actual values of u and v are unknown, reset u = 2 √ N and v = 0. Now compute r = u 2 − v 2 − 4N. If r = 0, thus the solution of (u, v) is found. There are two cases for value of r as r = 0: • Case 1: When r > 0 The value of v needs to set larger; v ← v + 2 and then r ← r − (4v + 4) • Case 2: When r < 0 The value of u needs to set larger; u ← u + 2 and then r ← r + (4u + 4) When the initial value u and v are created, we need to check the value of r. If r = 0, there are two cases: r > 0 and r < 0. If r > 0, the new v is produced that is increased by 2 from the old v, then the new r is computed by r − (4v + 4). Otherwise, if r < 0, the new u is produced that is increased by 2 from the old u, then the new r is computed from r + (4u + 4). The iteration of both case will be run until r = 0. If (u, v) found, the factorisation of N occurs as p = u+v 2 and q = u−v 2 .

Remark 1.
The sign ← represents an assignment of changes on a same value. For example, v ← v + 2 means the new value v is computed from the old value v with increment by 2.

Continued Fraction
The continued fraction is a non-integer expansion method that represents a decimal number into a list of integers. The list of the integer can establish a partial quotient that brings into a convergent list in term of a rational number. The continued fraction is suitable for the representation of the rational and irrational number like π, Euler's number, e, and √ 2. Chung et al. [14] mentioned that the continued fraction for a rational number may produce a finite yield of integer number while for an irrational number may produce an infinite yield an infinite list of an integer number.
Let r be a real number which has unique continued fraction expansion, where m i ∈ Z and i ∈ N. The list of m i is a list integer form of r, thus, let r i with an amount of i represent the partial quotients as follows: The list of partial quotients, [r 0 , r 1 , r 2 , . . . , r i ] is also known as a convergent list. The list of the convergence is significantly used for several purposes such as shortening the distance of the initial value in Fermat's Factoring Algorithm and creating an approximate value of a rational number. Wu et al. [1] purposed Estimated Prime Factor in which used in application such as shortening the searching distance for (FFA2). It may give a "hint" for a new position for initial values of FFA2. The EPF will be discussed in the next section.

Estimated Prime Factor (EPF)
Wu et al. [1,9] proposed an approach to estimate p + q and p − q using EPF. The authors of [1,9] mentioned that the continued fraction of 1 √ N is used to give out the partial knowledge of D p −D q D p D q in which helps to find p + q and p − q as D p − D q and D p D q are unknown. From the list of convergent 1 . The value of k t is approximately less than N, k t N, in which k t need to be less and closer to the value of N. As the value of N is known, it is easy to select h t k t by k t comparing with the value of N, and k t could be good indicator to select a good convergent of 1 √ N as there is i convergents on the list.
We illustrate EPF process in Figure 1.

Methodology
As early discussed in Section 1, Bressoud [13] claimed that the FFA2 has a better component for loop count without any multiplication or division and exhibit faster computational time. However, the FFA2 requires a huge number of cycles because it needs to search for the value of p + q and p − q, separately. Compare to FFA2, FFA1 needs to search for the value of p + q only. This eliminates the process of searching for the value of p − q, and thus reduces the number of loop count. Table 1 shows the comparison of loop count between FFA1 and FFA2 based on three distinct moduli N = pq. The first modulus of N = 1,783,647,329 is taken from an example in [1]. Observed that the FFA1 dominates the smallest values of loop count (10,552) rather than the FFA2 (42,215) and the FFA2-EPF (11,455). For N = 195,656,557, again, the FFA1 dominates the smallest loop count compare to the other two methods. N = 1,952,194,393 is selected to illustrate the balanced prime situation. Similarly, the FFA1 recorded the smallest loop count, while the loop count for FFA2-EPF is not available as the initial value of u and v are larger than p + q and p − q. Overall, the FFA1 requires a lesser loop count, therefore it can factor modulus N relatively faster than the FFA2 and the FFA2-EPF.  Figure 2). The methodology is to introduce a new parameter λ ∈ N, such that √ N + λ will be serve as a new initial value for the FFA1. The reason is to establish a new distance, shown in Figure 2, where d new < d 0 . Therefore, a good λ is needed toward initial value of FFA1 to obtain the d new .
In this work, the EPF method is used to extend the initial value of FFA1. We show that the EPF approach is suitable to be used in FFA1 with following conditions. Suppose x = p+q 2 and y = p−q 2 . Note that from Section 2.4, we have p = From Equation (3), the value D p − D q is needed to improve FFA1, which obtained from the convergences of continued fraction of 1 √ N . Recall from Section 2.4, from the continued fraction of 1 N and h t be the additional extension λ to improve the initial value of FFA1.
We proceed with a lemma that shows x = √ N + h t 2 is always smaller than p+q 2 .
thus it can be rewritten as follows.
Observation 1. Consider Lemma 1. As √ N + h t 2 is always smaller than p+q 2 , therefore h t 2 via EPF can be use as the additional extension λ. Furthermore, we can set x = √ N + h t 2 to serve as the (improved) initial value of x in the FFA1 algorithm.
In this study, we discover two types of possible selected convergent on the list. The first is Type 1: h t k t from the convergent list of 1 √ N where k t N. For Type 1, Wu et al. [1] mentioned that h t k t can be an indicator of convergent with index t to select the good candidate for initial value.
Next, is the Type 2: where it is the last convergent on the list, which will be elaborated further. Thus, h i will be selected for additional extension for potential initial value.
The behaviour of Type 2 convergent selection is analysed via experiment on 50 distinct balanced prime moduli N.  Observation 2. Figure 3 shows that Situation 1 happens when the value of p+q 2 is larger than the two initial values, Situation 2 shows that position p+q 2 is in the middle of potential initial values, and Situation 3 is where the value of p+q 2 is smaller than the potential initial values.
The result via experimental analysis of 50 distinct moduli N indicates that 33 moduli are considered as Type 2 convergent selection and 42.42% of them have potential initial value with additional extension h i−3 and h i−4 larger than p+q 2 (i.e., Situation 3), while the rest might fall under Situation 1 or Situation 2. This experimental analysis suggests that the position of those potential initials values close to p+q 2 is undecidable. This study aims to provide solutions that covered unbalanced and balanced primes for all three situations. The in-depth analysis of Type 2 will be discussed in Section 4.3.

Results and Discussion
By the observation in Section 3, an improvement for FFA1 to increase the effectiveness of the algorithm to factor a modulus N is sought after. The aim is to focus on three important parts: (i) EPF's technique is used, (ii) establishing potential initial values for FFA1, and (iii) the alteration on the original FFA1 algorithm to suit the said potential initial value. Thus, we introduce mFFA1-EPF to improve the effectiveness of FFA1.

mFFA1-EPF: Unbalanced Prime
This section is dedicated for the modulus N with unbalanced primes factor. From Observation 1, we setting x = √ N + h t 2 as the improved initial value in FFA1 algorithm is which less than Answer. Interestingly, if we can find other candidates for initial values in which potentially reduces the distance d new , then it can be useful to reduce the loop count to search for the value of p+q 2 . Suppose the value of √ N + h t is considered as the other candidate of potential values (i.e., the value of λ). Then, such value is supposed close to p+q 2 . However, in general, it position is undecided whether √ N + h t is larger (as shown by Figure 4) or is smaller than p+q 2 (i.e., similar to Lemma 1). Next, suppose there exist h t−1 such that By empirical evident, the value √ N + h t−1 < p+q 2 can be considered as another candidate of additional extension for FFA1. Based on the empirical evident, it shows that the position of √ N + h t 2 and √ N + h t−1 are unpredictable as illustrated in Figure 5a,b.
(a) The position with There are three candidates for the potential values for λ: h t 2 , h t−1 , and h t . In answering Question 1, the algorithm will start to compute the first value, while the second value is a 2 = √ N + h t . Once a 1 and a 2 are established, then two After establishing the values of a's and y's, three procedures run simultaneously: • Procedure 1: The iteration with potential initial value a 1 and y 1 . The value a 1 is increased by 1 until y 1 is integer. • Procedure 2: The iteration with potential initial value a 2 and y 2 . The value a 2 is increased by 1 until y 2 is integer. • Procedure 3: The iteration with potential initial value a 2 and y 2 . The value a 2 is decreased by 1 until y 2 is integer.
Remark 3. Note that the same value a 2 is applied in both Procedure 2 and Procedure 3. As the value a 2 , might be larger than p+q 2 , the main role of Procedure 3 is to prevent the mFFA1-EPF algorithm to keep running forever. All of the procedure is done by parallel computing, which means that the algorithm will completely be stopped whenever one of the procedures outputs y 1 or y 2 as an integer. Eventually, p and q will be obtained.
Unbalanced prime is demonstrated in Algorithm 1 as follows and flowchart on Figure A1 in Appendix B.1.

Algorithm 1: mFFA1-EPF: Unbalanced Prime
Input: Modulus N Output: The prime p and q 1 Compute the continued fraction of 1 Compute y 1 = a 2 1 − N and y 2 = a 2 2 − N 5 do in parallel 6 Procedure 1: while y 1 = integer do 7 Compute a 1 ← a 1 +  since k t−1 < k t N. Now, the potential initial values are computed as follows: With a 1 = 26,676 and a 2 = 26,746, Algorithm 1 is performed. The algorithm is stopped when Procedure 2 satisfy the searching on Algorithm 1 where y 2 become an integer (y 2 = 66,126). Finally, p = a 2 + y 2 = 50,359 and q = a 2 − y 2 = 14,057 are computed.
The potential initial values are computed as follows: With a 1 = 87,553,628 and a 2 = 87,554,901, Algorithm 1 is performed. The algorithm is stopped when Procedure 2 satisfies the searching on Algorithm 1 where y 2 become an integer (y 2 = 96,393,384). Last, p = a 2 + y 2 = 136,721,029 and q = a 2 − y 2 = 56,065,739 are computed.
With a 1 = 29,682 and a 2 = 36,369, Algorithm 1 is performed. The algorithm is stopped when Procedure 3 satisfies the searching on Algorithm 1 where y 2 become integer (y 2 = 65,903). Last, p = a 2 + y 2 = 49,307 and q = a 2 − y 2 = 10,723 are computed.  since k t−1 < k t < N. Two potential initial values are computed as follows: Algorithm 1 is performed and stop when Procedure 1 satisfies that y 1 is an integer (y 1 = 31,664). Last, p = a 1 + y 1 = 84,449 and q = a 1 − y 1 = 21,121 are computed.

Discussion of Algorithm 1 (mFFA1-EPF: Unbalanced Primes)
This section presents a comparative analysis between the mFFA1-EPF and the previous technique, based on loop count and computational time. Note that all experimental results were using a computer running on 2.1 GHz on Intel® Core i3 with 4 GB of RAM.
According to Table 2, the loop count on Procedure 2 of Examples 1 and 2 is the shortest one. It shows that the mFFA1-EPF has the smallest loop count compared to the other methods. For Example 3, Procedure 3 has the shortest path (630), at the same time it indicates √ N + h t is larger than p+q 2 . Thus far, the results give a good visualization representing the factorization of modulus N by our method experimentally. Example 4 is the same example as given in Wu et al. [1]. Procedure 1 obtained the smallest loop count (346) compared to other methods. This N/A (Not Applicable) means that all the procedure in Algorithm 1 is stopped when one of the y's from any procedures got the integer first. The mFFA1-EPF is performed by parallel computing, which means Procedures 1-3 were run simultaneously. We recorded the computational time for the three different procedures. In Table 3, mFFA1-EPF is faster than FFA1 by 4 numerical examples. This seems to be a slight improvement for FFA1 as there is an involvement of additional extension. mFFA1-EPF is good in term of loop count, running without failure and computational time (compared to FFA1).  Table 4. This comparison highlights the improvement made by mFFA1-EPF compared to the method FFA-Euler, provided by Somsuk [6]. By two examples from in [6], the exhaustive search is improved with shortest loop counts, and the potential initial values are shorter than the FFA-Euler loop count. This shows that our method can be compatible with all unbalanced prime.

mFFA1-EPF: Balanced Prime
Previously, in the case of a modulus with unbalanced primes, three candidates are determined as the λ. Only two potential initial values that possibly shorten the d n ew were selected. In this section, we will explore the case of a modulus with balanced primes. The aim is to dictate the proper candidates from the convergent list (i.e., mFFA1-EPF) for the potential initial values via a similar approach.
Recall that h t k t with index t, where k t N, deemed as the indicator for selecting a good convergent to additional extension of initial values for FFA2-EPF [1]. When the EPF technique applied for the balanced prime case on FFA1, by empirical evidence, it shows that such indicator leads to the initial value ( √ N + h t ) relatively far away from the target value (exceeded by p+q 2 ). Therefore, we conjecture that the EPF method seems not to be an effective method to factor the modulus N with a balanced prime. Furthermore, the result in Somsuk [5] agreed that EPF is only suitable for unbalanced prime. It failed to address the convergent with index t as a suitable index to improve the initial value.
Therefore, in this section, we provide the strategies to address such drawback of factoring the modulus N with a balanced prime by imposing modification in the mFFA1-EPF algorithm. The strategies involve convergent selection and modification of potential initial values. Therefore, to enhance the effectiveness via mFFA1-EPF, the additional extension h t until h t−5 is observe empirically to determine the smallest value of d new . The result of the observation is presented on Figure 6, and the discussion follows.
Suppose h t k t with index t where k t N is chosen via EPF. Note that for the modulus N with balanced primes case, the value √ N + h t p+q 2 . Therefore, the additional extension from h t to h t−5 is analysed. Interestingly, the additional extension √ N + h t−j for j = 0, 1, 2, 3, 4, 5 can be a potential initial values as it moves closer to the value of p+q 2 . Figure 6a-f shows comparison of potential initial values between the additional extension of √ N + h t−j for j = 0, 1, 2, 3, 4, 5 and p+q 2 , respectively. The potential initial values decrease, because the value of additional extension is become smaller from h t to h t−5 (i.e.,

Question 2.
What are the suitable initial values that need to be implemented on mFFA1-EPF with balanced primes?
Answer. Based on Figure 6, the line graph between the initial value (represented by the blue dots) starts closer to the target value p+q 2 (represented by the red dots) as the value of initial values changes. A hindrance to the development process for this approach is that we can not determine the smallest value of d new via additional extension h t to h t−5 . In other words, the "closeness" of the potential initial values with additional extension unable to be decided simply from the results of Figure 6. This is because the additional extension a random value from the generation of convergent list of 1 √ N . It requests further analysis. A statistical analysis of 50 distinct moduli N with balanced primes is conducted to determine the closeness of potential initial value through index t to t − 5, as follows.
In this work, a measurement called Mahalanobis Distance (MD) is implemented. MD is the distance between two points in multivariate space. According to Çakmakçı et al. [15], MD measures the distance between a multidimensional point of probability distribution and distribution of distance. The smaller the value of MD, the closer the mean of candidate of potential initial values to the mean of the target value. In the one-dimensional case on the mFFA1-EPF for balanced prime, MD is used to calculate the normalized distance between the mean of each h t to h t−5 and the mean of the target value p+q 2 . The measurement formula is where µ IV is a mean of each data potential initial value of √ N + h t to √ N + h t−5 while µ AV is mean of actual value p+q 2 . The value σ IV+AV is calculated from combination data from potential initial value and the actual value p+q 2 . The following formula is represented for MD between √ N + h t and p+q 2 , We calculate MD for √ N + h t to √ N + h t−5 by same data of 50 moduli N and represent the MD value on Table 5. In the one-dimensional case on the mFFA1-EPF for balanced prime, MD is used to calculate the normalized distance between the mean of each h t to h t−5 and the mean of the target value p+q 2 . The measurement formula is where µ IV is a mean of each data potential initial value of √ N + h t to √ N + h t−5 while µ AV is mean of actual value p+q 2 . The value σ IV+AV is calculated from combination data from potential initial value and the actual value p+q 2 . The following formula is represented for MD between √ N + h t and p+q 2 , We calculate MD for √ N + h t to √ N + h t−5 by same data of 50 moduli N and represent the MD value on Table 5. Table 5 shows the comparison of the MD index of "closer distance" between several potential initial values from h t to h t−5 and p+q of √ N + h t−3 and √ N + h t−4 are the smallest MD values among other potential initial values, that is, 0.0114 and 0.0116, respectively. It means that √ N + h t−3 and √ N + h t−4 are the most suitable candidates for potential initial values, because they have the smallest d new on average with respect to MD measurement. Table 5. The comparison on the closeness of value between the candidate of potential initial value with p+q 2 by MD. Therefore, it is highly suggested to select convergents with index t − 3 and t − 4 to improve the initial values.

Mahalanobis Distance (MD) Value
Based on Observation 3, two potential initial values are set as follows: Remark that the FFA1 algorithm requires an initial value less than the target value and will keep increasing by one (i.e., +1) until it reaches p+q 2 . Therefore, in mFFA1-EPF, we use the variation technique, which means the value of b 1 and b 2 need to be increased and decreased by 1 simultaneously. Next, the following values are established: y 2 = b 2 2 − N Four procedures are introduced using the above values, with the variation technique as follows: • Procedure 1: The iteration with potential initial values b 1 and y 1 . The value of b 1 is increased by 1 until it is the same as the y 1 becomes an integer. • Procedure 2: The iteration with potential initial values b 2 and y 2 . The value of b 2 is increased by 1 until it is the same as y 2 becomes an integer. • Procedure 3: The iteration with potential initial values b 1 and y 1 . The value of b 1 is decreased by 1 until it is the same as the y 1 becomes an integer. • Procedure 4: The iteration with potential initial values b 2 and y 2 . The value of b 2 is decreased by 1 until it is the same as the y 2 becomes an integer.
Note that these four procedures were run simultaneously by parallel computing which will stop when one of the y's become the first integer. Algorithm 2 shows how the workflow runs. which is convergence to 1 end while 10 Compute p = b 1 + y 1 and q = b 1 − y 1

12
Procedure 2: while y 2 = integer do 13 Compute end while 16 Compute p = b 2 + y 2 and q = b 2 − y 2 Algorithm 2 is also illustrated as a flowchart in Figure A2 in Appendix B.2. The experimental result is represented using the mFFA1-EPF via balanced prime on Example 5 while applying mFFA1-EPF is represented on Somsuk's numerical example [6] in Example 6. since k t−4 < k t−3 < k t N. Now, there are two candidates of potential initial value and 2 y's are computed as follows: Algorithm 2 is performed because y 1 and y 2 not integers. The values b 1 and b 2 in Procedure 1 and 2 are increased by 1 while initial values in Procedure 3 and 4 are decreased by 1. The algorithm stop where y 1 from Procedure 1 is integer (y 1 = 801,204). Finally, compute p = b 1 + y 1 = 960,049 and q = b 1 − y 1 = 642,359. since k t−4 < k t−3 < k t < N. Now, there are two candidates of potential initial value and 2 y's are computed as follows: Algorithm 2 is performed because y 1 and y 2 not integer. The values b 1 and b 2 in Procedure 1 and 2 are increased by 1 while initial values in Procedure 3 and 4 are decreased by 1. The algorithm stop where y 1 from Procedure 1 is integer (y 1 = 587). We compute p = b 1 + y 1 = 653 and q = b 1 − y 1 = 521. Table 6 shows the comparison on count loop and computational time in seconds (s), between several FFAs with our proposed method toward Example 5. The loop count on Procedure 1 (15412) is the least number of loop count compared to previous methods. Besides, FFA2-EPF can not undergo the process and the loop count is not available since the initial value exceeded the value of p + q and p − q. When it goes on computational time, the algorithm is not shown the fastest one but it still improves from FFA1.  Table 7, mFFA1-EPF is applied toward [6] to compare the loop count and computational time. It shows the shortest loop count even the initial value is exactly the value of  as k i−4 < k i−3 < k i < N. We compute two candidates of initial value of x, y 1 and y 2 as follows: Since y 1 and y 2 are not integer, the values b 1 and b 2 in Procedures 1 and 2 are increased by 1 while initial values in Procedures 3 and 4 are decreased by 1. The algorithm stop where y 2 in Procedure 4 is integer (y 2 = 97,245). We compute p = b 2 + y 2 = 107,279 and q = b 2 − y 2 = 87,211. Table 8 shows the comparison on loop count and computational time in second between several FFAs with our propose method toward Example 7. Procedure 4 shows the smallest loop count with 1092 compared to FFA1 (1590) and FFA2 (10,553). The loop count of FFA2-EPF is unavailable as the initial values are exceeded the value of p + q and p − q. On computational time, our algorithm is slightly better than FFA1. Procedure 4 plays it crucial part to achieve the value p+q 2 , and, at the same time, Procedure 4 obtains the indicators of whether the value is larger or smaller than p+q 2 . Therefore, Algorithm 2 with Remark 5 helps to search for the value of p+q 2 without failure. The uniqueness of FFA2 is that it uses multiplication operation as the main process, it has less cost in computational time compared to the mFFA1-EPF which uses square root operation. Alas, FFA2 requires a greater number of iterations to achieve p + q and p − q. In this regard, the mFFA1-EPF uses less cost in terms of computational memory and less space to run the iteration compared to FFA2.
The objective of establishing additional extension on FFA2-EPF is the same as mFFA1-EPF, to shorten the path toward p + q and p − q. mFFA1-EPF has a shorter loop count than FFA2-EPF because the main operation comes from FFA2, which uses a huge number of iteration to achieve its target values: p + q and p − q. Thus, mFFA1-EPF requires less cost in terms of space compared to FFA2-EPF.

Conclusions and Future Works
In this study, we discovered two types of convergent list selections. The first is Type 1: h t k t is selected from the convergent list of 1 √ N where k t N. For Type 1, Wu et al. [1] mentioned that h t k t can be an indicator of convergent with index t to select a good candidate for initial value. Next, Type 2: where k i is the last convergent on the list (as illustrated by Figure 4) where h i will be selected for additional extension for potential initial value. This paper proposed two improved factoring algorithms called mFFA1-EPF for unbalanced primes and mFFA1-EPF for balanced primes. The general idea for designing the algorithms is due to a modification made to EPF and then implemented to (improved) FFA1. The resulting study shows a significant improvement that reduces the loop count of FFA1 via (improved) EPF compared to previous methods (FFA1, FFA2, FFA2-EPF, and FFA-Euler).
An interesting limitation to our work is that the computational time of mFFA1-EPF is still far beyond efficient to factor a modulus with 1024-bit size of balanced primes, with the current technology. We foresee that the mFFA1-EPF might be useful once a large quantum computer with stable qubits is available. The mFFA1-EPF is a type of searching algorithm, thus it might take advantage of making fine adjustments or manipulating the mathematical nature within Grover's searching quantum algorithm [16]. The mFFA1-EPF can be used in machine architecture with low power such as the Internet of Things-based devices, which requires to factor small composites integer [1,9]. Furthermore, we expect mFFA1-EPF to be an assistive tool to increase the effort on the machine learning and artificial intelligence approaches, such as in [17], have been introduced in the literature to deal with similar problems as ours.
Denote that N = pq. We substitute (A3) to p and (A4) to q and yield N is eliminated on the both side which generate Equation (A6) and lead to Equation (A7).
We do not have any informations about the value of D p − D q and D p D q . However, from Equation (A7), 1 √ N can be useful to get D p − D q and D p D q as N is publically known.
We use h t and k t to correspond the estimation of D p and D q that is The convergent with index t be the selection fraction for improving the FFA as it give an advantage on shorten the exhasutive search on p + q and p − q.