subject

The Sieve of Eratosthenes and Goldbach's Conjecture. In Java Implement the Sieve of Eratosthenes and use it to find all prime numbers less than or equal to one million.
Use the result to prove Goldbach's Conjecture for all even integers between four and one million, inclusive.
Implement a method with the following declaration:
public static void sieve(int[] array);
This function takes an integer array as its argument. The array should be initialized to the values 1 through 1000000.
The function modifies the array so that only the prime numbers remain; all other values are zeroed out.
This function must be written to accept an integer array of any size.
You must output for all prime numbers between 1 and 1000000, but when I test your function it may be on an array of a different size.
Implement a method with the following declaration:
public static void goldbach(int[] array);
This function takes the same argument as the previous method and displays each even integer between 4 and 1000000 with two prime numbers that add to it.
The goal here is to provide an efficient implementation. This means no multiplication, division, or modulus when determining if a number is prime.
It also means that the second method must find two primes efficiently.
Outputs for your program: All prime numbers between 1 and 1000000 and all even numbers between 4 and 1000000 and the two prime numbers that sum up to it.
Use command line arguments!

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 14:00
Var add = function( x, y ) { return ( x + y ); } alert( add (5, 3) ); 11. (refer to code example 2.) the function a. accepts 2 parameters and returns 2 values. b. accepts 2 parameters and returns 1 value. c. accepts 2 parameters and does not return a value. d. does not accept a parameter and returns 1 value.
Answers: 1
question
Computers and Technology, 22.06.2019 06:50
Match the personality traits with their description
Answers: 1
question
Computers and Technology, 22.06.2019 12:30
An atom's diameter is about 0.1 nanometer (1×10-9m), and a human hair is about 1×10-3m. how many times greater is a human hair than an atom's diameter? sorry pushed wronf button but this is math
Answers: 3
question
Computers and Technology, 22.06.2019 18:00
When is it appropriate to use an absolute reference
Answers: 1
You know the right answer?
The Sieve of Eratosthenes and Goldbach's Conjecture. In Java Implement the Sieve of Eratosthenes an...
Questions
question
Mathematics, 02.03.2020 23:15
question
Mathematics, 02.03.2020 23:15
question
Mathematics, 02.03.2020 23:15
Questions on the website: 13722362