Thread: Power???
View Single Post
Old 2011-08-30, 15:55   #5
JohnFullspeed
 
May 2011
France

7×23 Posts
Default Find!

The polynome was goof the error was at the line just after.

I make N= N^2 ((an optimization) but it's good only if you begin at one:

Quote:
  1. Create a list of consecutive integers from 2 to n: (2, 3, 4, ..., n).
  2. Initially, let p equal 2, the first prime number.
  3. Starting from p, count up in increments of p and mark each of these numbers greater than p itself in the list. These numbers will be 2p, 3p, 4p, etc.; note that some of them may have already been marked.
  4. Find the first number greater than p in the list that is not marked; let p now equal this number (which is the next prime).
  5. If p is less than n, repeat from step 3. Otherwise, stop.

You can modify

3- Starting from p^2, count up in increments of p and mark each of these numbers greater than p itself in the list. These numbers will be 2p, 3p, 4p, etc.; note that some of them may have already been marked.

not if you make a continue search not a set of continues integers
John
JohnFullspeed is offline   Reply With Quote