Is an even number that is large enough to be written as the sum of two prime numbers.
1 # include <stdio. h> 2 # include <math. h> 3 4 int main (void) 5 {6 int I, j; 7 int num = 30284; // any number greater than 6 is 8 int p, q; 9 int flagp, flagq; 10 11 p = 1; 12 do13 {14 p = p + 1; 15 q = num-P; 16 flagp = 1; 17 flagq = 1; 18 19 for (I = 2; I <SQRT (double) P); ++ I) 20 {21 if (P % I = 0) 22 {23 flagp = 0; 24 break; 25} 26} 27 28 J = 2; 29 While (j <SQRT (double) q )) 30 {31 if (Q % J = 0) 32 {33 flagq = 0; 34 break; 35} 36 + + J; 37} 38} while (flagq * flagq = 0); 39 40 printf ("% d = % d + % d \ n", num, p, q ); 41 return 0; 42}
The idea is to start from p = 1 and determine whether to separate the two numbers P after the large number is decomposed. Q is a prime number. If not, the result is output. If not, the Operation will continue with 1.
Use C program to verify the gedebach Conjecture