Table of Contents
Fetching ...

Generation and Distribution of Prime Numbers Using a Modified Lagrange Polynomial

Dileep Sivaraman, Branesh M. Pillai, Jackrit Suthakorn, Songpol Ongwattanakul

Abstract

A modified Lagrange Polynomial is introduced for polynomial extrapolation, which can be used to estimate the equally spaced values of a polynomial function. As an example of its application, this article presents a prime-generating algorithm based on a 1-degree polynomial that can generate prime numbers from consecutive primes. The algorithm is based on the condition that infinitely many prime numbers exist that satisfy the equation $Π_{n} =2Π_{n-1} - Π_{n-2} \pm 2 \ \ \forall \ Π_{n} >7$. where $Π_{n-1}$ and $Π_{n-2}$ are the consecutive primes.

Generation and Distribution of Prime Numbers Using a Modified Lagrange Polynomial

Abstract

A modified Lagrange Polynomial is introduced for polynomial extrapolation, which can be used to estimate the equally spaced values of a polynomial function. As an example of its application, this article presents a prime-generating algorithm based on a 1-degree polynomial that can generate prime numbers from consecutive primes. The algorithm is based on the condition that infinitely many prime numbers exist that satisfy the equation . where and are the consecutive primes.
Paper Structure (6 sections, 11 equations, 6 figures)

This paper contains 6 sections, 11 equations, 6 figures.

Figures (6)

  • Figure 1: The histogram of the prime numbers produced by $\Pi_{n} =2\Pi_{n-1} - \Pi_{n-2} \pm 2 \ \ \forall \ \Pi_{n} >7$ appears to be different from the normal prime number distribution because the ranges of the two outputs are different. The normal prime number distribution considers all prime numbers within a certain range, whereas the prime numbers produced by $\Pi_{n}$ consider only a subset of prime numbers that satisfy a specific condition. In addition, the prime numbers produced by $\Pi_{n}$ may not be distributed uniformly, which can also affect the shape of the histogram.
  • Figure 2: Using MATLAB script that finds prime numbers using a condition based on the difference between two consecutive primes. The script first initializes some variables, including the maximum number of primes to find (N = 1000). The script then checks odd numbers in the range for primality using the condition $\Pi_{n} =2\Pi_{n-1} - \Pi_{n-2} \pm 2$. The script then displays the primes found using the condition and the primes found using the primes function. The primes function is a built-in MATLAB function that finds all the prime numbers less than or equal to a given number. Finally, the script plots a graph to visualize the comparison of the two methods.
  • Figure 3: MATLAB utilizes a sieve algorithm luo1989practical to generate a list of prime numbers. Subsequently, the code checks each odd number within the specified range for primality, followed by the application of a condition to identify a subset of prime numbers that satisfies a specific criterion. The distribution of the differences between consecutive primes was obtained using the condition $\Pi_{n} =2\Pi_{n-1} - \Pi_{n-2} \pm 2$, where $\Pi_{n-1}$ and $\Pi_{n-2}$ represent the two previous primes in the list. The resulting plot depicts the index of difference on the x-axis and the actual difference between consecutive primes on the y-axis. The plot revealed that the differences between consecutive primes obtained using this condition were unevenly distributed and clustered around specific values. Furthermore, the plot shows that large gaps existed between clusters of differences, signifying that the condition did not yield any primes for certain ranges. The blue dots in the plot represent the actual differences between consecutive primes.
  • Figure 4: The graph shows the distribution of the differences between consecutive prime numbers obtained using the condition $\Pi_{n} =2\Pi_{n-1} - \Pi_{n-2} \pm 2$, where $\Pi_{n-1}$ and $\Pi_{n-2}$ are the two previous primes in the list. The x-axis represents the index of differences, the y-axis represents the actual difference between consecutive primes, and the z-axis represents zero.
  • Figure 5: The code generates a list of prime twins by checking if the conditions $\Pi_{n} =2\Pi_{n-1} - \Pi_{n-2} \pm 2$ are satisfied for each pair of consecutive primes within a range of 10000 numbers. The resulting prime twin pairs are plotted in a scatter plot that shows the distribution of prime twins. The graph reveals that prime twins tend to cluster together in some areas while being more spread out in others.
  • ...and 1 more figures