Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2014-08-27 03:25:44

Primenumbers
Member
Registered: 2013-01-22
Posts: 149

Find all the prime numbers in a given range....

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

#2 2014-08-27 03:52:58

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: Find all the prime numbers in a given range....

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

#3 2014-08-27 05:06:56

Primenumbers
Member
Registered: 2013-01-22
Posts: 149

Re: Find all the prime numbers in a given range....

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

#4 2014-08-27 05:56:26

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: Find all the prime numbers in a given range....

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

#5 2014-08-27 06:05:20

Primenumbers
Member
Registered: 2013-01-22
Posts: 149

Re: Find all the prime numbers in a given range....

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

#6 2014-08-28 20:07:16

danaj
Member
Registered: 2014-03-03
Posts: 29

Re: Find all the prime numbers in a given range....

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

#7 2014-10-07 03:15:41

Primenumbers
Member
Registered: 2013-01-22
Posts: 149

Re: Find all the prime numbers in a given range....

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

Board footer

Powered by FluxBB