Cody

Problem 64. The Goldbach Conjecture, Part 2

Solution 2627050

Submitted on 29 Jun 2020 by 春樹 内糸
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))

r = 5 r = 4 r = 3 c = 1

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

r = 9 r = 8 r = 7 c = 1 r = 6 r = 5 c = 2

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

r = 49 r = 48 r = 47 c = 1 r = 46 r = 45 r = 44 r = 43 c = 2 r = 42 r = 41 r = 40 r = 39 r = 38 r = 37 c = 3 r = 36 r = 35 r = 34 r = 33 r = 32 r = 31 c = 4 r = 30 r = 29 r = 28 r = 27 r = 26 r = 25

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

r = 479 r = 478 r = 477 r = 476 r = 475 r = 474 r = 473 r = 472 r = 471 r = 470 r = 469 r = 468 r = 467 c = 1 r = 466 r = 465 r = 464 r = 463 c = 2 r = 462 r = 461 c = 3 r = 460 r = 459 r = 458 r = 457 c = 4 r = 456 r = 455 r = 454 r = 453 r = 452 r = 451 r = 450 r = 449 c = 5 r = 448 r = 447 r = 446 r = 445 r = 444 r = 443 c = 6 r = 442 r = 441 r = 440 r = 439 c = 7 r = 438 r = 437 r = 436 r = 435 r = 434 r = 433 c = 8 r = 432 r = 431 r = 430 r = 429 r = 428 r = 427 r = 426 r = 425 r = 424 r = 423 r = 422 r = 421 c = 9 r = 420 r = 419 c = 10 r = 418 r = 417 r = 416 r = 415 r = 414 r = 413 r = 412 r = 411 r = 410 r = 409 c = 11 r = 408 r = 407 r = 406 r = 405 r = 404 r = 403 r = 402 r = 401 c = 12 r = 400 r = 399 r = 398 r = 397 c = 13 r = 396 r = 395 r = 394 r = 393 r = 392 r = 391 r = 390 r = 389 r = 388 r = 387 r = 386 r = 385 r = 384 r = 383 c = 14 r = 382 r = 381 r = 380 r = 379 c = 15 r = 378 r = 377 r = 376 r = 375 r = 374 r = 373 c = 16 r = 372 r = 371 r = 370 r = 369 r = 368 r = 367 c = 17 r = 366 r = 365 r = 364 r = 363 r = 362 r = 361 r = 360 r = 359 r = 358 r = 357 r = 356 r = 355 r = 354 r = 353 c = 18 r = 352 r = 351 r = 350 r = 349 c = 19 r = 348 r = 347 r = 346 r = 345 r = 344 r = 343 r = 342 r = 341 r = 340 r = 339 r = 338 r = 337 r = 336 r = 335 r = 334 r = 333 r = 332 r = 331 c = 20 r = 330 r = 329 r = 328 r = 327 r = 326 r = 325 r = 324 r = 323 r = 322 r = 321 r = 320 r = 319 r = 318 r = 317 c = 21 r = 316 r = 315 r = 314 r = 313 c = 22 r = 312 r = 311 r = 310 r = 309 r = 308 r = 307 c = 23 r = 306 r = 305 r = 304 r = 303 r = 302 r = 301 r = 300 r = 299 r = 298 r = 297 r = 296 r = 295 r = 294 r = 293 r = 292 r = 291 r = 290 r = 289 r = 288 r = 287 r = 286 r = 285 r = 284 r = 283 c = 24 r = 282 r = 281 c = 25 r = 280 r = 279 r = 278 r = 277 r = 276 r = 275 r = 274 r = 273 r = 272 r = 271 r = 270 r = 269 c = 26 r = 268 r = 267 r = 266 r = 265 r = 264 r = 263 r = 262 r = 261 r = 260 r = 259 r = 258 r = 257 c = 27 r = 256 r = 255 r = 254 r = 253 r = 252 r = 251 c = 28 r = 250 r = 249 r = 248 r = 247 r = 246 r = 245 r = 244 r = 243 r = 242 r = 241 c = 29 r = 240

Suggested Problems

More from this Author95

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!