The Goldbach Conjecture - MATLAB Cody - MATLAB Central

Problem 60. The Goldbach Conjecture

Difficulty:Rate
The Goldbach conjecture asserts that every even integer greater than 2 can be expressed as the sum of two primes.
Given the even integer n, return primes p1 and p2 that satisfy the condition n = p1 + p2. Note that the primes are not always unique. The test is not sensitive to order or uniqueness. You just need to meet the appropriate conditions.
Example:
Input n = 286
Output (any of the following is acceptable)
[ 3 283]
[283 3]
[ 5 281]
[107 179]
[137 149]

Solution Stats

53.51% Correct | 46.49% Incorrect
Last Solution submitted on Mar 12, 2025

Problem Comments

Solution Comments

Show comments

Group

The Prime Directive Image
The Prime Directive
  • 14 Problems
  • 36 Finishers

Problem Recent Solvers5776

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page