Problem 60. The Goldbach Conjecture

Created by Cody Team in Community

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.


 Input  n = 286
 Output (any of the following is acceptable) 
        [  3 283]
        [283   3]
        [  5 281]
        [107 179]
        [137 149]

Solution Stats

51.41% Correct | 48.59% Incorrect
Last solution submitted on Mar 22, 2019

Problem Comments

Solution Comments

Recent Solvers2957

Suggested Problems

More from this Author95


Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!