A Simple Algorithm for Prime Factorization and Primality Testing - Kabenge Hamiss (Journal of Mathematics)
We propose a new simple and faster algorithm to factor numbers based on the nature of the prime numbers contained in such composite numbers. It is well known that every composite number has a unique representation as a product of prime numbers. In this study, we focus mainly on composite numbers that contain a product of prime numbers that are greater than or equal to 5 which are of the form 6k+1 or 6k+5. Therefore, we use the condition that every prime or composite P of primes greater than or equal to 5 satisfies P2≡1 mod24. This algorithm is very fast especially when the difference in the prime components of a composite number (prime gap) is not so large. When the difference between the factors (prime gap) is not so large, it often requires just a single iteration to obtain the factors.