Cody

# Problem 60. The Goldbach Conjecture

Solution 1931531

Submitted on 12 Sep 2019 by Hieu Vu
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
nList = 28:6:76; for i = 1:length(nList) n = nList(i); [p1,p2] = goldbach(n) assert(isprime(p1) && isprime(p2) && (p1+p2==n)); end

11 12 p1 = 11 p2 = 17 11 12 p1 = 11 p2 = 23 11 12 p1 = 11 p2 = 29 11 12 13 14 15 16 17 18 p1 = 17 p2 = 29 11 12 p1 = 11 p2 = 41 11 12 p1 = 11 p2 = 47 11 12 p1 = 11 p2 = 53 11 12 p1 = 11 p2 = 59 11 12 13 14 15 16 17 18 p1 = 17 p2 = 59

2   Pass
nList = [18 20 22 100 102 114 1000 2000 36 3600]; for i = 1:length(nList) n = nList(i); [p1,p2] = goldbach(n) assert(isprime(p1) && isprime(p2) && (p1+p2==n)); end

11 12 p1 = 11 p2 = 7 11 12 13 14 p1 = 13 p2 = 7 11 12 p1 = 11 p2 = 11 11 12 p1 = 11 p2 = 89 11 12 13 14 p1 = 13 p2 = 89 11 12 p1 = 11 p2 = 103 11 12 13 14 15 16 17 18 p1 = 17 p2 = 983 11 12 13 14 p1 = 13 p2 = 1987 11 12 13 14 p1 = 13 p2 = 23 11 12 13 14 15 16 17 18 p1 = 17 p2 = 3583