JAMP  Vol.7 No.2 , February 2019
How to Check If a Number Is Prime Using a Finite Definite Integral
Abstract: In the history of mathematics different methods have been used to detect if a number is prime or not. In this paper a new one will be shown. It will be demonstrated that if the following equation is zero for a certain number p, this number p would be prime. And being m an integer number higher than (the lowest, the most efficient the operation). . If the result is an integer, this result will tell us how many permutations of two divisors, the input number has. As you can check, no recurrent division by odd or prime numbers is done, to check if the number is prime or has divisors. To get to this point, we will do the following. First, we will create a domain with all the composite numbers. This is easy, as you can just multiply one by one all the integers (greater or equal than 2) in that domain. So, you will get all the composite numbers (not getting any prime) in that domain. Then, we will use the Fourier transform to change from this original domain (called discrete time domain in this regards) to the frequency domain. There, we can check, using Parseval’s theorem, if a certain number is there or not. The use of Parseval’s theorem leads to the above integral. If the number p that we want to check is not in the domain, the result of the integral is zero and the number is a prime. If instead, the result is an integer, this integer will tell us how many permutations of two divisors the number p has. And, in consequence information how many factors, the number p has. So, for any number p lower than 2m - 1, you can check if it is prime or not, just making the numerical definite integration. We will apply this integral in a computer program to check the efficiency of the operation. We will check, if no further developments are done, the numerical integration is inefficient computing-wise compared with brute-force checking. To be added, is the question regarding the level of accuracy needed (number of decimals and number of steps in the numerical integration) to have a reliable result for large numbers. This will be commented on the paper, but a separate study will be needed to have detailed conclusions. Of course, the best would be that in the future, an analytical result (or at least an approximation) for the summation or for the integration is achieved.
Cite this paper: Sánchez, J. (2019) How to Check If a Number Is Prime Using a Finite Definite Integral. Journal of Applied Mathematics and Physics, 7, 364-380. doi: 10.4236/jamp.2019.72028.

[1]   Fourier, J.B.J. (1878 [1822]) The Analytical Theory of Heat. Freeman, A., Trans., The University Press, Cambridge, United Kingdom. (Translated from French)


[3]   Euclid’s Elements, Book IX, Proposition 35.


[5]   des Chênes, P. (1799) Marc-Antoine Mémoire sur les séries et sur l’intégration complète d’une équation aux différences partielles linéaire du second ordre, à coefficients constants. Sciences, mathématiques et physiques (Savants étrangers), 1, 638-648.


[7]   Hazewinkel, M. (Ed.) (2001) Euler Formulas. Encyclopaedia of Mathematics, Springer.


[9]   Rivest, R., Shamir, A. and Adleman, L. (1978) A Method for Obtaining Digital Signatures and Public-Key Cryptosystems. Communications of the ACM, 21, 120-126.

[10]   Apostol, T.M. (1999) An Elementary View of Euler’s Summation Formula. The American Mathematical Monthly. Mathematical Association of America, 106, 409-418.