#include<bits/stdc++.h>
using namespace std;
#define N 1000000
int p[N];
void prime();
int main()
{
prime();
int n, i, j, a, b, c;
while(cin >> n)
{
if(n == 0)
break;
c = 0;
for(i=2;i<n;i++)
{
a = n - i;
if(p[a] == 0)
{
if(p[i] == 0)
{
b = i;
c = 1;
break;
}
}
}
if(c == 1)
cout << n << " = " << b << " + " << a << endl;
else
cout << "Goldbach's conjecture is wrong." << endl;
}
return 0;
}
void prime()
{
int l, i, j;
l = sqrt(N);
p[1] = 1;
for(i=2;i<=l;i++)
{
if(p[i] == 0)
{
for(j=2;i*j<=N;j++)
p[i*j] = 1;
}
}
}
using namespace std;
#define N 1000000
int p[N];
void prime();
int main()
{
prime();
int n, i, j, a, b, c;
while(cin >> n)
{
if(n == 0)
break;
c = 0;
for(i=2;i<n;i++)
{
a = n - i;
if(p[a] == 0)
{
if(p[i] == 0)
{
b = i;
c = 1;
break;
}
}
}
if(c == 1)
cout << n << " = " << b << " + " << a << endl;
else
cout << "Goldbach's conjecture is wrong." << endl;
}
return 0;
}
void prime()
{
int l, i, j;
l = sqrt(N);
p[1] = 1;
for(i=2;i<=l;i++)
{
if(p[i] == 0)
{
for(j=2;i*j<=N;j++)
p[i*j] = 1;
}
}
}
Comments
Post a Comment