You are not logged in.
Pages: 1
I have found what I think is a simple, possibly efficient, algorithm for a Prime Number Sieve.
This sieve is a process of taking a value from the set { 6x-1 U 6X+1 }, (5, 7, 11, 13, 17, 19, 23, 25, 29, 31, 35, 37 ... N ). Using that value as a starting point to move through the same of numbers, based a simple pattern that I have found, to mark / eliminate the non-primes. Repeating the process for all the primes.
The process using the multiple of 6, a pattern of the odd numbers, & an alternating switch to identify members of the set to be marked as non-prime.
The steps of this process are
Goto the starting value
Inside Loop
Add to the multiple the First Constant to the Starting Value and choose the Minus or Plus to set based on the alternating switch.
Add to the multiple the Second Constant to the Starting Value and choose the Minus or Plus set based on the alternating switch.
Repeat
The Outside Loop simply sets the First Constant and Second Constant.
I would like to hear comments about my idea. Is it as simple and efficient as I think it is?
Pages: 1