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, 23.06.2019 12:50
Which syntax error in programming is unlikely to be highlighted by a compiler or an interpreter? a variable name misspelling a missing space a comma in place of a period a missing closing quotation mark
Answers: 1
question
Computers and Technology, 23.06.2019 18:20
What is wi-fi infrastructure? a metropolitan area network that uses radio signals to transmit and receive data a communications technology aimed at providing high-speed wireless data over metropolitan area networks a means by which portable devices can connect wirelessly to a local area network, using access points that send and receive data via radio waves includes the inner workings of a wi-fi service or utility, including the signal transmitters, towers, or poles and additional equipment required to send out a wi-fi signal
Answers: 2
question
Computers and Technology, 24.06.2019 14:00
In simple terms, how would you define a protocol?
Answers: 2
question
Computers and Technology, 24.06.2019 20:20
3. write assignment statements that perform the following operations with the variables a, b, and c: a. adds 2 to a and assigns the result to b b. multiplies b times 4 and assigns the result to a c. divides a by 3.14 and assigns the result to b
Answers: 2
You know the right answer?
The Sieve of Eratosthenes and Goldbach's Conjecture. In Java Implement the Sieve of Eratosthenes an...
Questions
question
Mathematics, 30.01.2021 01:00
question
Computers and Technology, 30.01.2021 01:00
question
Mathematics, 30.01.2021 01:00
question
Mathematics, 30.01.2021 01:00
Questions on the website: 13722360