Goldbach's Other Conjecture
It was proposed by Christian Goldbach that every odd composite number can be written as the sum of a prime and twice a square. It turns out that the conjecture was false. What is the smallest odd c...
Problem Statement
This archive keeps the full statement, math, and original media on the page.
It was proposed by Christian Goldbach that every odd composite number can be written as the sum of a prime and twice a square. \begin {align*} 9 = 7 + 2 \times 1^2\\ 15 = 7 + 2 \times 2^2\\ 21 = 3 + 2 \times 3^2\\ 25 = 7 + 2 \times 3^2\\ 27 = 19 + 2 \times 2^2\\ 33 = 31 + 2 \times 1^2 \end {align*}
It turns out that the conjecture was false.
What is the smallest odd composite that cannot be written as the sum of a prime and twice a square?
Problem 46: Goldbach’s Other Conjecture
Mathematical Development
Formal Development
Definition 1 (Goldbach Representability). An odd integer is Goldbach-representable if there exist a prime and an integer such that . Let denote the set of all Goldbach-representable odd integers.
Definition 2 (Odd Composites). Let .
Goldbach’s other conjecture asserts that . We seek .
Lemma 1 (Bound on the square index). Let . If , then there exists a witness with , where .
Proof. Suppose with prime and . Since , we have , whence . Therefore .
Lemma 2 (Parity of the remainder). For any odd integer and any integer , the value is odd.
Proof. Since is odd and is even, their difference is odd.
Lemma 3 (Reduction to primality testing). An odd composite belongs to if and only if there exists such that is prime.
Proof. () By definition, with prime and . By Lemma 1, , so is prime for some in the stated range.
() If is prime for some , set . Then with prime and , so .
Theorem 1. The smallest odd composite number that is not Goldbach-representable is . That is, .
Proof. The proof proceeds in three parts.
Part 1 (5777 is an odd composite). We verify , where and are both prime. Hence is composite. Since and are both odd, their product is odd. Thus .
Part 2 (5777 is not Goldbach-representable). By Lemma 3, it suffices to show that is composite for every . We compute . For each , define . By Lemma 2, each is odd, so the question reduces to whether any is an odd prime. Exhaustive computation confirms that none of is prime. Representative values:
| Factorization | ||
|---|---|---|
| 1 | 5775 | |
| 2 | 5769 | |
| 3 | 5759 | |
| composite | ||
| 53 | 159 |
Since no witness exists, .
Part 3 (Minimality). By exhaustive computation (via sieve-assisted primality lookup), every odd composite with satisfies : for each such , at least one yields a prime remainder .
Combining Parts 1—3, .
Editorial
We first build a primality table up to a search limit using the Sieve of Eratosthenes. Then we inspect odd composite integers in increasing order, and for each such we test all values of with to see whether the remainder is prime. The first odd composite for which no such witness exists is the smallest counterexample to Goldbach’s other conjecture.
Pseudocode
Algorithm: Smallest Odd Composite Violating Goldbach's Other Conjecture
Require: A prime table on a search interval.
Ensure: The smallest odd composite n that cannot be written as p + 2k^2.
1: Build a primality table on the search interval.
2: For each odd composite n in increasing order do:
3: For each k ≥ 1 with 2k^2 < n, test whether n - 2k^2 is prime.
4: If no such k succeeds, return n.
Complexity Analysis
Proposition (Time complexity). Let denote the answer. The algorithm runs in time.
Proof. The sieve of Eratosthenes on with runs in time (classical result). The main loop iterates over at most odd integers. For each odd composite , the inner loop runs at most iterations, each performing an sieve lookup. The total work in the main loop is therefore . Since dominates , the overall complexity is . With , this yields approximately operations.
Proposition (Space complexity). The algorithm uses space.
Proof. The sieve array of size is the only data structure. All other variables are .
Answer
Code
Each problem page includes the exact C++ and Python source files from the local archive.
#include <bits/stdc++.h>
using namespace std;
int main() {
const int LIMIT = 10000;
vector<bool> is_prime(LIMIT, true);
is_prime[0] = is_prime[1] = false;
for (int i = 2; i * i < LIMIT; i++)
if (is_prime[i])
for (int j = i * i; j < LIMIT; j += i)
is_prime[j] = false;
for (int n = 9; n < LIMIT; n += 2) {
if (is_prime[n]) continue;
bool found = false;
for (int k = 1; 2 * k * k < n; k++) {
if (is_prime[n - 2 * k * k]) {
found = true;
break;
}
}
if (!found) {
cout << n << endl;
return 0;
}
}
return 0;
}
"""
Problem 46: Goldbach's Other Conjecture
Find the smallest odd composite that cannot be written as p + 2k^2
where p is prime and k >= 1.
"""
def sieve(limit):
is_prime = [True] * limit
is_prime[0] = is_prime[1] = False
for i in range(2, int(limit**0.5) + 1):
if is_prime[i]:
for j in range(i * i, limit, i):
is_prime[j] = False
return is_prime
def solve():
LIMIT = 10000
is_prime = sieve(LIMIT)
for n in range(9, LIMIT, 2):
if is_prime[n]:
continue
found = False
k = 1
while 2 * k * k < n:
if is_prime[n - 2 * k * k]:
found = True
break
k += 1
if not found:
return n
answer = solve()
assert answer == 5777
print(answer)