Cody

Solution 2012791

Submitted on 10 Nov 2019 by Romain Demory
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
n = 6; c_correct = 1; assert(isequal(goldbach2(n),c_correct))

M = 4 5 7 0 6 8 0 0 10 c = 1

2   Pass
n = 10; c_correct = 2; assert(isequal(goldbach2(n),c_correct))

M = 4 5 7 9 0 6 8 10 0 0 10 12 0 0 0 14 c = 2

3   Pass
n = 50; c_correct = 4; assert(isequal(goldbach2(n),c_correct))

M = 4 5 7 9 13 15 19 21 25 31 33 39 43 45 49 0 6 8 10 14 16 20 22 26 32 34 40 44 46 50 0 0 10 12 16 18 22 24 28 34 36 42 46 48 52 0 0 0 14 18 20 24 26 30 36 38 44 48 50 54 0 0 0 0 22 24 28 30 34 40 42 48 52 54 58 0 0 0 0 0 26 30 32 36 42 44 50 54 56 60 0 0 0 0 0 0 34 36 40 46 48 54 58 60 64 0 0 0 0 0 0 0 38 42 48 50 56 60 62 66 0 0 0 0 0 0 0 0 46 52 54 60 64 66 70 0 0 0 0 0 0 0 0 0 58 60 66 70 72 76 0 0 0 0 0 0 0 0 0 0 62 68 72 74 78 0 0 0 0 0 0 0 0 0 0 0 74 78 80 84 0 0 0 0 0 0 0 0 0 0 0 0 82 84 88 0 0 0 0 0 0 0 0 0 0 0 0 0 86 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 94 c = 4

4   Pass
n = 480; c_correct = 29; assert(isequal(goldbach2(n),c_correct))

M = Columns 1 through 29 4 5 7 9 13 15 19 21 25 31 33 39 43 45 49 55 61 63 69 73 75 81 85 91 99 103 105 109 111 0 6 8 10 14 16 20 22 26 32 34 40 44 46 50 56 62 64 70 74 76 82 86 92 100 104 106 110 112 0 0 10 12 16 18 22 24 28 34 36 42 46 48 52 58 64 66 72 76 78 84 88 94 102 106 108 112 114 0 0 0 14 18 20 24 26 30 36 38 44 48 50 54 60 66 68 74 78 80 86 90 96 104 108 110 114 116 0 0 0 0 22 24 28 30 34 40 42 48 52 54 58 64 70 72 78 82 84 90 94 100 108 112 114 118 120 0 0 0 0 0 26 30 32 36 42 44 50 54 56 60 66 72 74 80 84 86 92 96 102 110 114 116 120 122 0 0 0 0 0 0 34 36 40 46 48 54 58 60 64 70 76 78 84 88 90 96 100 106 114 118 120 124 126 0 0 0 0 0 0 0 38 42 48 50 56 60 62 66 72 78 80 86 90 92 98 102 108 116 120 122 126 128 0 0 0 0 0 0 0 0 46 52 54 60 64 66 70 76 82 84 90 94 96 102 106 112 120 124 126 130 132 0 0 0 0 0 0 0 0 0 58 60 66 70 72 76 82 88 90 96 100 102 108 112 118 126 130 132 136 138 0 0 0 0 0 0 0 0 0 0 62 68 72 74 78 84 90 92 98 102 104 110 114 120 128 132 134 138 140 0 0 0 0 0 0 0 0 0 0 0 74 78 80 84 90 96 98 104 108 110 116 120 126 134 138 140 144 146 0 0 0 0 0 0 0 0 0 0 0 0 82 84 88 94 100 102 108 112 114 120 124 130 138 142 144 148 150 0 0 0 0 0 0 0 0 0 0 0 0 0 86 90 96 102 104 110 114 116 122 126 132 140 144 146 150 152 0 0 0 0 0 0 0 0 0 0 0 0 0 0 94 100 106 108 114 118 120 126 130 136 144 148 150 154 156 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 106 112 114 120 124 126 132 136 142 150 154 156 160 162 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 118 120 126 130 132 138 142 148 156 160 162 166 168 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 122 128 132 134 140 144 150 158 162 164 168 170 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 134 138 140 146 150 156 164 168 170 174 176 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 142 144 150 154 160 168 172 174 178 180 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 146 152 156 162 170 174 176 180 182 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 158 162 168 176 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