I have a Goldbach conjecture (if you do not know what it is, in a simplified way **any even number greater than two may be represented by the sum of two prime numbers.** )

G (n) = {(p1, p2) | p1 + p2 = n, p1 and p2 are prime numbers with p1 <p2}

For example:

G (6) =

{(3, 3)}G (12) =

{(5, 7)}G (26) =

{(3, 23), (7, 19), (13, 13)}

So, I have to make an algorithm that determines which are the three numbers n1, n2 and n3 between **1,000,000** and **2,000,000** for which the

**G (n1)**, **G (n2)** and **G (n3)** have the largest number of items.

I do not know if I need to improve something in my code, or even optimize a badly written part, does it currently take about 12 seconds

```
public class Goldbach {
private static int j;
private static int k;
private static int [] prime numbers;
private static int [] just_primes;
private static int [] spouse;
public static void main (String[] args)
{
prime numbers = new int[2000000];
for (int i = 0; i <2000000; i ++) {
the first ones[i] = i + 1;
}
for (int i = 1; i <1000000; i ++) {
if (bonuses[i] ! = 0) {
j = prime numbers[i];
k = j;
while (k <= 2000000) {
k + = j;
if (k <= 2000000) {
the first ones[ k-1 ] = 0;
}
}
}
}
just_primes = new int [primes.length];
for (int i = 0; i <prime.length-1; i ++) {
juste_primes[i] = 0;
}
k = 0;
for (int i = 1; i< primes.length-1 ; i++ ) {
if ( primes[i] > 0) {
juste_primes[k] = prime numbers[i];
k ++;
}
}
spouse = new int[1000001];
for (int i = 0; i <1000001; i ++) {
joint[i] = 0;
}
int p;
for (int i = 0; i <k; i ++) {
for (int j = i; j< k ; j++ ) {
int w = just_primes[i]+just_primes[j];
if ( w >= 1000000 && w <= 2000000) {
p = w - 1000000;
joint[p]++;
}
}
}
int big1 = 0;
int big2 = 0;
int big3 = 0;
int n1 = 0;
int n2 = 0;
int n3 = 0;
for (int i = 0; i<1000001 ; i++ ) {
if ( conjunct[i] >= big1) {
big3 = big2;
big2 = big1;
big1 = spouse[i];
n3 = n2;
n2 = n1;
n1 = i;
} other {
if (spouse[i] > = big2) {
big3 = big2;
big2 = spouse[i];
n3 = n2;
n2 = i;
} other {
if (spouse[i] > = big3) {
big3 = spouse[i];
n3 = i;
}
}
}
}
System.out.println ("The largest conjunction 1:" + n1 + "" + 1000000 + big1 + "pairs");
System.out.println ("The biggest spouse 2:" + n2 + "" + 1000000 + big2 + "pairs");
System.out.println ("The biggest spouse 3:" + n3 + "" + 1000000 + big3 + "pairs");
}
```

}

Expected result:

```
The biggest spouse 1: 981980 100000027988 pairs
The biggest spouse 2: 951950 100000027802 pairs
The biggest spouse 3: 995630 100000027730 pairs
```