Cody

Solution 1924157

Submitted on 6 Sep 2019 by Zhichen Zhu
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

p1 = 15 p2 = 13 tf1 = logical 0 tf2 = logical 1 p1 = 16 p2 = 12 tf1 = logical 0 tf2 = logical 0 p1 = 17 p2 = 11 tf1 = logical 1 tf2 = logical 1 p1 = 17 p2 = 11 p1 = 18 p2 = 16 tf1 = logical 0 tf2 = logical 0 p1 = 19 p2 = 15 tf1 = logical 1 tf2 = logical 0 p1 = 20 p2 = 14 tf1 = logical 0 tf2 = logical 0 p1 = 21 p2 = 13 tf1 = logical 0 tf2 = logical 1 p1 = 22 p2 = 12 tf1 = logical 0 tf2 = logical 0 p1 = 23 p2 = 11 tf1 = logical 1 tf2 = logical 1 p1 = 23 p2 = 11 p1 = 21 p2 = 19 tf1 = logical 0 tf2 = logical 1 p1 = 22 p2 = 18 tf1 = logical 0 tf2 = logical 0 p1 = 23 p2 = 17 tf1 = logical 1 tf2 = logical 1 p1 = 23 p2 = 17 p1 = 24 p2 = 22 tf1 = logical 0 tf2 = logical 0 p1 = 25 p2 = 21 tf1 = logical 0 tf2 = logical 0 p1 = 26 p2 = 20 tf1 = logical 0 tf2 = logical 0 p1 = 27 p2 = 19 tf1 = logical 0 tf2 = logical 1 p1 = 28 p2 = 18 tf1 = logical 0 tf2 = logical 0 p1 = 29 p2 = 17 tf1 = logical 1 tf2 = logical 1 p1 = 29 p2 = 17 p1 = 27 p2 = 25 tf1 = logical 0 tf2 = logical 0 p1 = 28 p2 = 24 tf1 = logical 0 tf2 = logical 0 p1 = 29 p2 = 23 tf1 = logical 1 tf2 = logical 1 p1 = 29 p2 = 23 p1 = 30 p2 = 28 tf1 = logical 0 tf2 = logical 0 p1 = 31 p2 = 27 tf1 = logical 1 tf2 = logical 0 p1 = 32 p2 = 26 tf1 = logical 0 tf2 = logical 0 p1 = 33 p2 = 25 tf1 = logical 0 tf2 = logical 0 p1 = 34 p2 = 24 tf1 = logical 0 tf2 = logical 0 p1 = 35 p2 = 23 tf1 = logical 0 tf2 = logical 1 p1 = 36 p2 = 22 tf1 = logical 0 tf2 = logical 0 p1 = 37 p2 = 21 tf1 = logical 1 tf2 = logical 0 p1 = 38 p2 = 20 tf1 = logical 0 tf2 = logical 0 p1 = 39 p2 = 19 tf1 = logical 0 tf2 = logical 1 p1 = 40 p2 = 18 tf1 = logical 0 tf2 = logical 0 p1 = 41 p2 = 17 tf1 = logical 1 tf2 = logical 1 p1 = 41 p2 = 17 p1 = 33 p2 = 31 tf1 = logical 0 tf2 = logical 1 p1 = 34 p2 = 30 tf1 = logical 0 tf2 = logical 0 p1 = 35 p2 = 29 tf1 = logical 0 tf2 = logical 1 p1 = 36 p2 = 28 tf1 = logical 0 tf2 = logical 0 p1 = 37 p2 = 27 tf1 = logical 1 tf2 = logical 0 p1 = 38 p2 = 26 tf1 = logical 0 tf2 = logical 0 p1 = 39 p2 = 25 tf1 = logical 0 tf2 = logical 0 p1 = 40 p2 = 24 tf1 = logical 0 tf2 = logical 0 p1 = 41 p2 = 23 tf1 = logical 1 tf2 = logical 1 p1 = 41 p2 = 23 p1 = 36 p2 = 34 tf1 = logical 0 tf2 = logical 0 p1 = 37 p2 = 33 tf1 = logical 1 tf2 = logical 0 p1 = 38 p2 = 32 tf1 = logical 0 tf2 = logical 0 p1 = 39 p2 = 31 tf1 = logical 0 tf2 = logical 1 p1 = 40 p2 = 30 tf1 = logical 0 tf2 = logical 0 p1 = 41 p2 = 29 tf1 = logical 1 tf2 = logical 1 p1 = 41 p2 = 29 p1 = 39 p2 = 37 tf1 = logical 0 tf2 = logical 1 p1 = 40 p2 = 36 tf1 = logical 0 tf2 = logical 0 p1 = 41 p2 = 35 tf1 = logical 1 tf2 = logical 0 p1 = 42 p2 = 34 tf1 = logical 0 tf2 = logical 0 p1 = 43 p2 = 33 tf1 = logical 1 tf2 = logical 0 p1 = 44 p2 = 32 tf1 = logical 0 tf2 = logical 0 p1 = 45 p2 = 31 tf1 = logical 0 tf2 = logical 1 p1 = 46 p2 = 30 tf1 = logical 0 tf2 = logical 0 p1 = 47 p2 = 29 tf1 = logical 1 tf2 = logical 1 p1 = 47 p2 = 29

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

p1 = 10 p2 = 8 tf1 = logical 0 tf2 = logical 0 p1 = 11 p2 = 7 tf1 = logical 1 tf2 = logical 1 p1 = 11 p2 = 7 p1 = 11 p2 = 9 tf1 = logical 1 tf2 = logical 0 p1 = 12 p2 = 8 tf1 = logical 0 tf2 = logical 0 p1 = 13 p2 = 7 tf1 = logical 1 tf2 = logical 1 p1 = 13 p2 = 7 p1 = 12 p2 = 10 tf1 = logical 0 tf2 = logical 0 p1 = 13 p2 = 9 tf1 = logical 1 tf2 = logical 0 p1 = 14 p2 = 8 tf1 = logical 0 tf2 = logical 0 p1 = 15 p2 = 7 tf1 = logical 0 tf2 = logical 1 p1 = 16 p2 = 6 tf1 = logical 0 tf2 = logical 0 p1 = 17 p2 = 5 tf1 = logical 1 tf2 = logical 1 p1 = 17 p2 = 5 p1 = 51 p2 = 49 tf1 = logical 0 tf2 = logical 0 p1 = 52 p2 = 48 tf1 = logical 0 tf2 = logical 0 p1 = 53 p2 = 47 tf1 = logical 1 tf2 = logical 1 p1 = 53 p2 = 47 p1 = 52 p2 = 50 tf1 = logical 0 tf2 = logical 0 p1 = 53 p2 = 49 tf1 = logical 1 tf2 = logical 0 p1 = 54 p2 = 48 tf1 = logical 0 tf2 = logical 0 p1 = 55 p2 = 47 tf1 = logical 0 tf2 = logical 1 p1 = 56 p2 = 46 tf1 = logical 0 tf2 = logical 0 p1 = 57 p2 = 45 tf1 = logical 0 tf2 = logical 0 p1 = 58 p2 = 44 tf1 = logical 0 tf2 = logical 0 p1 = 59 p2 = 43 tf1 = logical 1 tf2 = logical 1 p1 = 59 p2 = 43 p1 = 58 p2 = 56 tf1 = logical 0 tf2 = logical 0 p1 = 59 p2 = 55 tf1 = logical 1 tf2 = logical 0 p1 = 60 p2 = 54 tf1 = logical 0 tf2 = logical 0 p1 = 61 p2 = 53 tf1 = logical 1 tf2 = logical 1 p1 = 61 p2 = 53 p1 = 501 p2 = 499 tf1 = logical 0 tf2 = logical 1 p1 = 502 p2 = 498 tf1 = logical 0 tf2 = logical 0 p1 = 503 p2 = 497 tf1 = logical 1 tf2 = logical 0 p1 = 504 p2 = 496 tf1 = logical 0 tf2 = logical 0 p1 = 505 p2 = 495 tf1 = logical 0 tf2 = logical 0 p1 = 506 p2 = 494 tf1 = logical 0 tf2 = logical 0 p1 = 507 p2 = 493 tf1 = logical 0 tf2 = logical 0 p1 = 508 p2 = 492 tf1 = logical 0 tf2 = logical 0 p1 = 509 p2 = 491 tf1 = logical 1 tf2 = logical 1 p1 = 509 p2 = 491 p1 = 1001 p2 = 999 tf1 = logical 0 tf2 = logical 0 p1 = 1002 p2 = 998 tf1 = logical 0 tf2 = logical 0 p1 = 1003 p2 = 997 tf1 = logical 0 tf2 = logical 1 p1 = 1004 p2 = 996 tf1 = logical 0 tf2 = logical 0 p1 = 1005 p2 = 995 tf1 = logical 0 tf2 = logical 0 p1 = 1006 p2 = 994 tf1 = logical 0 tf2 = logical 0 p1 = 1007 p2 = 993 tf1 = logical 0 tf2 = logical 0 p1 = 1008 p2 = 992 tf1 = logical 0 tf2 = logical 0 p1 = 1009 p2 = 991 tf1 = logical 1 tf2 = logical 1 p1 = 1009 p2 = 991 p1 = 19 p2 = 17 tf1 = logical 1 tf2 = logical 1 p1 = 19 p2 = 17 p1 = 1801 p2 = 1799 tf1 = logical 1 tf2 = logical 0 p1 = 1802 p2 = 1798 tf1 = logical 0 tf2 = logical 0 p1 = 1803 p2 = 1797 tf1 = logical 0 tf2 = logical 0 p1 = 1804 p2 = 1796 tf1 = logical 0 tf2 = logical 0 p1 = 1805 p2 = 1795 tf1 = logical 0 tf2 = logical 0 p1 = 1806 p2 = 1794 tf1 = logical 0 tf2 = logical 0 p1 = 1807 p2 = 1793 tf1 = logical 0 tf2 = logical 0 p1 = 1808 p2 = 1792 tf1 = logical 0 tf2 = logical 0 p1 = 1809 p2 = 1791 tf1 = logical 0 tf2 = logical 0 p1 = 1810 p2 = 1790 tf1 = logical 0 tf2 = logical 0 p1 = 1811 p2 = 1789 tf1 = logical 1 tf2 = logical 1 p1 = 1811 p2 = 1789