## the sum of two prime numbers

Mechanics, discrete, statistics, ...
kimms0131
Posts: 2
Joined: Tue Mar 15, 2011 4:06 pm

### the sum of two prime numbers

maybe even numbers except 2 are expressed by p+q (p,q are differnt prime numbers)
if the even number(m) are expressed only one pair of sum of two prime numbers (p<q)
let fix the set of m =A, m<10000, n(A)=?

thundre
Posts: 356
Joined: Sun Mar 27, 2011 9:01 am

### Re: the sum of two prime numbers

Goldbach's Conjecture does not have the restriction that the primes must be different. It is unknown whether there are any exceptions to it. Your restriction forces the exceptions {4,6} at least.

The above image suggests A={8,10,12,14,38}.

http://en.wikipedia.org/wiki/Goldbach%27s_conjecture
http://en.wikipedia.org/wiki/File:Goldb ... ecture.gif

kimms0131
Posts: 2
Joined: Tue Mar 15, 2011 4:06 pm

### Re: the sum of two prime numbers

But Goldbach's conjecture can be possible in a huge number(very big).

In that case why only 8,10,12,14,38 exist?

I don't understand. Help me ㅠ_ㅠ

thundre
Posts: 356
Joined: Sun Mar 27, 2011 9:01 am

### Re: the sum of two prime numbers

To actually solve the problem as stated, you would write a program that generates primes up to 10,000 and counts each m=p+q where p<q.

Code: Select all

public class Rec2632 {
public static final int MAX_M = 10000;

public static void traverse() {
PrimeSieve sieve = PrimeSieve.getInstance();
int n = sieve.primeCount(MAX_M);
int c[] = new int[MAX_M + 1];

for (int i = 1; i < n; i++) {
int q = (int) sieve.prime[i];
for (int j = 0; j < i; j++) {
int p = (int) sieve.prime[j];
int m = p + q;
if (m <= MAX_M) {
c[m]++;
}
}
}

for (int m = 4; m <= MAX_M; m += 2) {
if (c[m] < 2) {
System.out.println(m + ":  " + c[m]);
}
}
}

public static void main(String args[]) {
traverse();
System.exit(0);
}
}
The output from the above shows {4,6} have 0 solutions and {8,10,12,14,38} have 1 each.

Going back to theory, the reason that the set is limited is that as m increases, the number of ways to partition it into two different odd numbers increases linearly. n = floor((m-2)/4)

But the probability that those numbers are prime is 1/(ln m), so the expected number of partitions is greater than n/(ln m)^2, which is generally increasing when m>8.

Mattwolf33
Posts: 1
Joined: Thu Feb 21, 2013 5:48 pm

### Re: the sum of two prime numbers

hmm, would this work?
974267642452