You are not logged in.
Take your Range x.
Delete All even No.'s then take all remaining no.'s and times by 3. Delete these no.'s Repeat for ALL PRIMES less than or = to sqrt.(x).
"Time not important. Only life important." - The Fifth Element 1997
Offline
Times by 3?
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
Multiplied rather than Times by...? Here is an example:
x=17 sqrt(17)=3 rounded down to the nearest prime.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 (Delete ALL Even No.'s)
1 3 5 7 9 11 13 15 17 (Multiply remaining no.'s by 3 = 3,9,15,21 etc.) Remove these No.'s Remaining = Primes bar 1
1 5 7 11 13 17
"Time not important. Only life important." - The Fifth Element 1997
Offline
That is incorrect. For example, 25 would remain after the process, but is not prime.
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
Say x=29,
sqrt(29)=5 rd. dwn. to nearest prime,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 Delete All Even No.'s,
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 Times remaining by 3= 3,9,15,21,27,33 etc.......Remove these:
1 5 7 11 13 17 19 23 25 29 Remaining No.'s Timesed by 5 = 5,25,35 etc. Remove theses again = 1 7 11 13 17 19 23 29.
Take all primes < or = to sqrt.(x).
"Time not important. Only life important." - The Fifth Element 1997
Offline
What is the advantage of this over the well known Sieve of Eratosthenes?
I think you meant to say "up to a limit" (e.g. find all primes up to 29) instead of "in a given range" (e.g. find all primes in the range 5,208,079 and 6,206,197).
Last edited by danaj (2014-08-28 20:08:19)
Offline
Yes. But should be able to work out a rule to find out the number of primes up to a limit.
"Time not important. Only life important." - The Fifth Element 1997
Offline