Cody

Problem 64. The Goldbach Conjecture, Part 2

Solution 1769347

Submitted on 2 Apr 2019 by Rajpurohith Urmila
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 = 2 3 5 l = 3 x = [] c = 0 x = 3 3 c = 1

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

m = 2 3 5 7 l = 4 x = [] c = 0 x = 3 7 c = 1 x = 3 7 5 5 c = 2

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

m = 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 l = 15 x = [] c = 0 x = 3 47 c = 1 x = 3 47 7 43 c = 2 x = 3 47 7 43 13 37 c = 3 x = 3 47 7 43 13 37 19 31 c = 4

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

m = Columns 1 through 30 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 Columns 31 through 60 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 Columns 61 through 90 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 Columns 91 through 92 467 479 l = 92 x = [] c = 0 x = 13 467 c = 1 x = 13 467 17 463 c = 2 x = 13 467 17 463 19 461 c = 3 x = 13 467 17 463 19 461 23 457 c = 4 x = 13 467 17 463 19 461 23 457 31 449 c = 5 x = 13 467 17 463 19 461 23 457 31 449 37 443 c = 6 x = 13 467 17 463 19 461 23 457 31 449 37 443 41 439 c = 7 x = 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 c = 8 x = 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 59 421 c = 9 x = 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 59 421 61 419 c = 10 x = 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 59 421 61 419 71 409 c = 11 x = 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 59 421 61 419 71 409 79 401 c = 12 x = 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 59 421 61 419 71 409 79 401 83 397 c = 13 x = 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 59 421 61 419 71 409 79 401 83 397 97 383 c = 14 x = 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 59 421 61 419 71 409 79 401 83 397 97 383 101 379 c = 15 x = Columns 1 through 30 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 59 421 61 419 71 409 79 401 83 397 97 383 101 379 Columns 31 through 32 107 373 c = 16 x = Columns 1 through 30 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 59 421 61 419 71 409 79 401 83 397 97 383 101 379 Columns 31 through 34 107 373 113 367 c = 17 x = Columns 1 through 30 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 59 421 61 419 71 409 79 401 83 397 97 383 101 379 Columns 31 through 36 107 373 113 367 127 353 c = 18 x = Columns 1 through 30 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 59 421 61 419 71 409 79 401 83 397 97 383 101 379 Columns 31 through 38 107 373 113 367 127 353 131 349 c = 19 x = Columns 1 through 30 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 59 421 61 419 71 409 79 401 83 397 97 383 101 379 Columns 31 through 40 107 373 113 367 127 353 131 349 149 331 c = 20 x = Columns 1 through 30 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 59 421 61 419 71 409 79 401 83 397 97 383 101 379 Columns 31 through 42 107 373 113 367 127 353 131 349 149 331 163 317 c = 21 x = Columns 1 through 30 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 59 421 61 419 71 409 79 401 83 397 97 383 101 379 Columns 31 through 44 107 373 113 367 127 353 131 349 149 331 163 317 167 313 c = 22 x = Columns 1 through 30 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 59 421 61 419 71 409 79 401 83 397 97 383 101 379 Columns 31 through 46 107 373 113 367 127 353 131 349 149 331 163 317 167 313 173 307 c = 23 x = Columns 1 through 30 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 59 421 61 419 71 409 79 401 83 397 97 383 101 379 Columns 31 through 48 107 373 113 367 127 353 131 349 149 331 163 317 167 313 173 307 197 283 c = 24 x = Columns 1 through 30 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 59 421 61 419 71 409 79 401 83 397 97 383 101 379 Columns 31 through 50 107 373 113 367 127 353 131 349 149 331 163 317 167 313 173 307 197 283 199 281 c = 25 x = Columns 1 through 30 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 59 421 61 419 71 409 79 401 83 397 97 383 101 379 Columns 31 through 52 107 373 113 367 127 353 131 349 149 331 163 317 167 313 173 307 197 283 199 281 211 269 c = 26 x = Columns 1 through 30 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 59 421 61 419 71 409 79 401 83 397 97 383 101 379 Columns 31 through 54 107 373 113 367 127 353 131 349 149 331 163 317 167 313 173 307 197 283 199 281 211 269 223 257 c = 27 x = Columns 1 through 30 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 59 421 61 419 71 409 79 401 83 397 97 383 101 379 Columns 31 through 56 107 373 113 367 127 353 131 349 149 331 163 317 167 313 173 307 197 283 199 281 211 269 223 257 229 251 c = 28 x = Columns 1 through 30 13 467 17 463 19 461 23 457 31 449 37 443 41 439 47 433 59 421 61 419 71 409 79 401 83 397 97 383 101 379 Columns 31 through 58 107 373 113 367 127 353 131 349 149 331 163 317 167 313 173 307 197 283 199 281 211 269 223 257 229 251 239 241 c = 29