Design a type of sieve algorithm that would (1) Create a list of consecutive integers from 1 to n. (2) Initially, let k=2. (3) Consider each of the multiples of k less than or equal to n and either place or remove a mark on it as follows:
- If you encounter an unmarked multiple, mark it with a zero.
- If you encounter a multiple that has already been marked, remove the mark by restoring to its original value.
(4) Increase k by one. (5) Repeat steps (3) and (4) as long as k <=>=>
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here