A New Method for Testing Whether a Number Is Prime


  •  Bouchaïb Bahbouhi    

Abstract

The present paper describes a new method for the decomposition of integer numbers into their prime factors. To know if a number is prime, the classic and oldest method is to perform a series of Euclidean divisions by the prime factors in increasing order. In this article, I report a new and alternative method to the classic one. It is based on the fact that an even number that precedes a prime number must in no case have a potential prime factor that lacks a unit. This even number with one unit before the number to be decomposed can then be used to prove its primality or not by looking if it has a factor missing one unit. To achieve this, we divide the even by the prime factors (p) in ascending order and follow the decimal part. If the latter is equal to a ratio of (p - 1)/p (p is any prime factor), then the number to be decomposed is not prime and the prime number giving the ratio is its prime factor. This method has the potential to have applications in computer science and to lead to a new algorithm for decomposing numbers or further improve the performance of those existing.



This work is licensed under a Creative Commons Attribution 4.0 License.