Goldbach Pair Calculator

Enter an even number (4 or greater) to find two primes that sum to it.

How it is calculated

The tool takes an even number n and tests each candidate p from 2 up to n / 2. For each one it checks by trial division whether both p and n − p are prime, and stops at the first success. It therefore returns the pair with the smallest first prime, listed as smaller prime and larger prime, and the two always add up to n. Only one pair is shown, even when several exist. The input must be a whole even number of at least 4 and no larger than 253; odd numbers, decimals, negatives, 2 and anything above that limit return no result. For n = 4 the answer is 2 + 2, and for n = 6 it is 3 + 3. Large results are printed with thousands separators, for example 999,983.

Worked example

Find a Goldbach pair for n = 50. Step 1: p = 2, and 50 − 2 = 48 is not prime. Step 2: p = 3, and 50 − 3 = 47 is prime, so the search stops. The tool prints a smaller prime of 3 and a larger prime of 47, and 3 + 47 = 50. Other pairs exist, such as 7 + 43, 13 + 37 and 19 + 31, but the tool reports only the first one it finds.

Try this example →

Common mistakes

  • Entering an odd number such as 51. The conjecture is about even numbers, so odd input returns no result.
  • Entering 2 or a negative number. The smallest accepted value is 4, because 2 cannot be split into two primes.
  • Expecting every possible pair. The tool shows only the pair with the smallest prime: for 50 that is 3 + 47, not 19 + 31.
  • Treating the result as a proof of the conjecture. A pair for one number says nothing about all even numbers; the conjecture remains unproven.
  • Counting 1 as a prime. It is not, so 1 + (n − 1) is never accepted as a pair.

About this calculator

The Goldbach conjecture, proposed by Christian Goldbach in a 1742 letter to Leonhard Euler, states that every even integer greater than 2 can be expressed as the sum of two prime numbers — for example, 28 = 5 + 23 or 11 + 17. Despite being one of the oldest unsolved problems in number theory, it has been verified by computer for all even numbers up to extremely large limits, far beyond four quintillion, even though no general mathematical proof exists.

Finding a Goldbach pair for a given even number is a classic exercise in number theory and computer science courses, typically solved by testing candidate primes smaller than the number and checking whether the remainder is also prime, and it is often used to illustrate prime-testing algorithms like trial division or the Sieve of Eratosthenes.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators