an algorithm known as the sieve of erastosthenes can generate
Project Description:
an algorithm known as the sieve of erastosthenes can generate prime numbers. the algorithm for this procedure is presented here. write a program that implements this algorithm. have the program find all prime numbers up to n = 150.what can you say about this algorithm as compared to the ones used in the text for calculating prime numbers?
step 1: define an array of integers p. set all elements pi to 0, 2 _= i _= n.
step 2: set i to 2.
step 3: if i _ n, the algorithm terminates.
step 4: if pi is 0, i is prime.
step 5: for all positive integer values of j, such that ij_=n, n, set pixj to 1.
step 6: add 1 to i and go to step 3.
step 1: define an array of integers p. set all elements pi to 0, 2 _= i _= n.
step 2: set i to 2.
step 3: if i _ n, the algorithm terminates.
step 4: if pi is 0, i is prime.
step 5: for all positive integer values of j, such that ij_=n, n, set pixj to 1.
step 6: add 1 to i and go to step 3.
Skills Required:
Project Stats:
Price Type: Negotiable
Expired
Total Proposals: 1
1 Current viewersl
14 Total views
Proposals
Proposals
Reputation
Price offered

(Private Proposal)7 Jobs 1 Reviews $0 in 0 Day