prime number sieve l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Prime Number Sieve PowerPoint Presentation
Download Presentation
Prime Number Sieve

Loading in 2 Seconds...

play fullscreen
1 / 5

Prime Number Sieve - PowerPoint PPT Presentation


  • 125 Views
  • Uploaded on

Next_Prime = 3 ====> Mark multiples of 3 as non-prime. 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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 . Prime Number Sieve.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Prime Number Sieve' - kalei


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
prime number sieve

Next_Prime = 3 ====> Mark multiples of 3 as non-prime.

23 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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52

Prime Number Sieve

Next_Prime = 2 ====> Mark multiples of 2 as non-prime.

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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52

prime number sieve cont d

Next_Prime = 5 ====> Mark multiples of 5 as non-prime.

Next_Prime = 7 ====> Mark multiples of 7 as non-prime.

23 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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52

23 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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52

Prime Number Sieve (cont’d)

Optimization #1

Q:Do you need to mark multiples of 11 between 1 and 50 ?

A: No ! (They are already marked by the help of primes ≤ 7)

Optimization #2

Q:Do you need to mark multiples of 7 between 1 and 48?

A: No ! (They are already marked by the help of primes < 7)

slide3

Sequential Time Complexity Analysis

Optimization #1:

Optimization #2:

programming project
Programming Project:

Parallel Prime Number Generation

Read at: http://www.mst.edu/~ercal/387/387.html