Development of sieve of Eratosthenes and sieve of Sundaram's proof

We make two algorithms that generate all prime numbers up to a given limit, they are a development of sieve of Eratosthenes algorithm, we use two formulas to achieve this development, where all the multiples of prime number 2 are eliminated in the first formula, and all the multiples of prime numbers 2 and 3 are eliminated in the second formula. Using the first algorithm we proof sieve of Sundaram's algorithm, then we improve it to be more efficient prime generating algorithm. We will show the difference in performance between all the algorithms we will make and sieve of Eratosthenes algorithm in terms of run time.


Introduction
Sieve of Eratosthenes algorithm (SOE) is a well known algorithm that generates all prime numbers up to a given limit N, it contains some rules that control the elimination process of the multiples of prime numbers see [3,4,5,6,7], two of these rules are 1.
Where N f is the first uncommon multiple of prime number R with prime numbers smaller than R, which will be the first multiple to be eliminated.

2.
Where R l is the last prime number whose multiples will be eliminated. Using equations (3.2) and (3.4) in reference [2] and SOE algorithm we will develop two algorithms that generate all prime numbers up to a given limit N. We use the advantage of equation (3.2) in reference [2] which is Where all multiples of 2 are eliminated, so we will set our rules to eliminate the orders of the multiples of prime numbers greater that 2 from n, then the remaining values of n will be entered to equation (1.3) to get its corresponding prime numbers.
We will use the first produced algorithm as a proof to Sieve of Sundaram's algorithm [1] ,then we will develop it using the property of the exact match of the mathematical concepts between these two algorithms.
Then we will use equation (3.4) in reference [2] to make the second development to SOE algorithm, this is the formula Where all multiples of 2 and 3 are eliminated, we will set some rules to eliminate the orders of the multiples of prime numbers greater than 3 from n 1 .

First development of SOE (D1SOE)
In this developed algorithm we eliminate the corresponding n of the multiples of prime numbers greater than 2 from n -in equation (1.3) -up to a certain limit n m , where We take the floor to the right hand-side of equation (2.1) because we are interested in the integer value of n m . To obtain the order of the first uncommon multiple of a prime number with prime numbers smaller we substitute by (N f = 2m + 1) and (R = 2z + 1) in equation (1.1) 2m + 1 = (2z + 1) 2 2m + 1 = 4z 2 + 4z + 1 m: Is the order of the first multiple we will eliminate.
z: Is the order of the prime number whose multiples we want to eliminate. In this case the multiples of prime numbers are equidistant numbers, consequently their orders too see [2], in order to eliminate the multiples of prime numbers we need to know the difference between the orders of any two successive multiples, we can get the multiples of any number by multiplying this number by the integer numbers, but in this case we will multiply it by the odd numbers because the multiples of 2 are already eliminated, so for p prime number, the multiples of p are ((1 * p), (3 * p), (5 * p), (7 * p), ...).
using first two successive multiples which are (1p) and (3p) then substituting by each one in the inverse of equation (1.3) then subtracting the corresponding n of (1p) from the corresponding n of (3p) we obtain The difference between the orders of any two successive multiples of a prime number p.
We will eliminate all the numbers starting from m with d steps to n m which are the orders of the multiples of prime number p.
The order of the last prime number its multiples should be eliminated will be derived from equation (1.2) -without the floor-by substituting by We will take the floor to the right hand-side of equation (2.4) because we are interested in the integer value of k The order of the number whose first prime number smaller than it is the last prime number whose multiples we want to eliminate.
q: The order of the limit which we want to generate all prime numbers up to. After eliminating all the orders of prime numbers starting from 3 to the first prime number smaller than k from n we substitute by the remaining values of n in equation Sieve of Sundaram's algorithm [1] eliminates all the values of y from the integer numbers up to a limit l where y ≤ l. We can write equation (3.1) as follows Condition i ≤ j will control the starting point of y, which is the value of y when i = j.
Equation (3.4) is the same as equation (2.2)  Using equation (2.5) this is the limit of i should be used where k ′ : Is the order of -the corresponding n of-the limit of i.
q ′ : Is the order of -the corresponding n of-N.
Changing these conditions in Sundaram's algorithm it will be exactly the same as D1SOE algorithm.
Following a c++ code representation for DSOS algorithm.
The limit of n 1 is N: The limit which we want to generate all the prime numbers up to. n 1m : The order of N.
The order of the first multiple we want to eliminate will be calculated by substituting by Using ISEF from reference [2] g = 4( 3b+1 g: The order of the first multiple will be eliminated. b: The order of the prime number whose multiples we want to eliminate. The multiples of the prime numbers in equation (1.4) are divided into two sequences see [2], and g can equal any number from these two sequences.
We need to know the following information to be able to eliminate the multiples of the prime numbers in this case 1. The difference between the orders of any two successive multiples in any sequence of these two sequences, let it be f 1 .
Using computer programming the following relation is true for p equals the integers from 1 to 10 10 We assume that this relation is true for p equals all integers upto infinity.
2. The difference between the orders of the first (or the second or the third, ...etc) numbers in both sequence, let it be f 2 .
3. The difference between the order of the first number in the second sequence and the order of the second number in the first sequence, let it be f 3 .
4. Whether g belongs to the first or the second sequence, the second sequence could be represented by (3x − 1) where x is an integer, so by adding 1 to g and then dividing it by 3 we can know that it belongs to the second sequence if the result is an integer, if the result is not an integer then it belongs to the first sequence, while the first sequence could be represented by (3x + 1).
After calculating g we will determine whether g belongs to the first or the second sequence, Then we will eliminate this sequence by adding f 1 to g then we will eliminate the result then we will repeat adding f 1 to the last result and eliminate the resultant number, our limit will be n 1m .
After eliminating the sequence which g belongs to we will eliminate the other sequence by the same method but starting from (g + f 3 ) if g belongs to the second sequence, and from ((g + f 2 ) or (g − f 3 )) if g belongs to the first sequence.
The order of the last prime number its multiples should be eliminated will be derived from equation (2.4) by substituting by where h: The order -corresponding n 1 -of the number whose first prime number smaller than it is the last prime number whose multiples we want to eliminate. e: The order -corresponding n 1 -of the limit which we want to generate all prime numbers up to. After eliminating the orders of the multiples of prime numbers from n 1 we will substitute by the remaining n 1 in equation (1.4) to obtain prime numbers.
Following a c++ code representation for D2SOE algorithm.

Implementation results
To know in general the speed difference between these algorithms we use the same coding concept for all algorithms and the same device under the same circumstances, the results are listed in the next D2SOE is the fastest algorithm then D1SOE then DSOS with almost the same speed as D1SOE, then the last and the slowest one is SOE algorithm.

conclusion
Using sieve of Eratosthenes algorithm and two of my prime numbers formulas we was able to make two developments to sieve of Eratosthenes algorithm, the first one we used a formula where all the multiples of 2 are eliminated and we derived all the required formulas to accomplish the elimination of the multiples of the prime numbers, and the generation of all the prime numbers up to a gives limit see 2, and we used this algorithm to proof sieve of Sundaram's algorithm by showing the exact match between these two algorithms, then we used this match to improve sieve of Sundaram see section 3.
In the second algorithm we used a formula where all the multiples of the prime numbers 2 and 3 are eliminated, and derived the required formulas for the elimination process see section 4.
Finally we showed the run time differences between our developed algorithms and sieve of Eratosthenes algorithm see section 5.