In the 1973 MAA Annual High School Mathematics Examination (Part 1, Problem #3), students explored one of the oldest unsolved problems in mathematics:
"The stronger Goldbach conjecture states that any even integer greater than 7 can be written as the sum of two different prime numbers. For such representations of the even number 126, the largest possible difference between the two primes is: (A) 112 (B) 100 (C) 92 (D) 88 (E) 80."
Christian Goldbach proposed in 1742 that every even number greater than 2 is the sum of two primes. The "stronger" version requires the two primes to be different ($p_1 < p_2$ such that $p_1 + p_2 = 126$).
To maximize the gap between the two primes:
$$\text{Difference} = p_2 - p_1 = (126 - p_1) - p_1 = 126 - 2p_1$$
Notice that to maximize $126 - 2p_1$, we need to find the smallest possible prime $p_1$ such that $126 - p_1$ is also prime!
Let's test primes $p_1$ starting from the smallest odd prime:
$p_1 = 13$: $126 - 13 = 113$. Is 113 prime? $\sqrt{113} \approx 10.63$. Testing primes $\le 10$: $113$ is not divisible by 2, 3, 5, or 7 ($113 = 7 \times 16 + 1$). Therefore, 113 is prime!
Thus, the pair with the smallest $p_1$ is $(13, 113)$, and the largest possible difference is:
$$113 - 13 = \mathbf{100}$$
In this lesson, we use the built-in is_prime(n) function in Lua to find all Goldbach pairs for 126, and explore the distribution of prime partitions!
Now you try. Replace ???? with N and run the code to see all 8 prime pairs and the maximum difference of 100.
Type your code here:
See your results here:
Share your code
Show a friend, family member, or teacher what you've done!
Here is a share link to your code:
Need a hint?
💡 What now?
The code uses the built-in is_prime(n) function, which returns true if $n$ is prime and false otherwise (for example, is_prime(13) is true while is_prime(121) is false).
The code has ???? for the total sum $126$. Replace ???? with N (or 126) and click Run Code to find all Goldbach pairs and the maximum difference!
Notice how 126 has 8 distinct representations because it has many small prime factors ($126 = 2 \times 3^2 \times 7$).
Check Example 1 to see how the number of Goldbach pairs varies across even numbers!