Cody

Solution 50434

Submitted on 24 Feb 2012 by Mike
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
%% x = 1000; y_correct = 233168; assert(isequal(euler001(x),y_correct))

a = Columns 1 through 10 1 2 3 4 5 6 7 8 9 10 Columns 11 through 20 11 12 13 14 15 16 17 18 19 20 Columns 21 through 30 21 22 23 24 25 26 27 28 29 30 Columns 31 through 40 31 32 33 34 35 36 37 38 39 40 Columns 41 through 50 41 42 43 44 45 46 47 48 49 50 Columns 51 through 60 51 52 53 54 55 56 57 58 59 60 Columns 61 through 70 61 62 63 64 65 66 67 68 69 70 Columns 71 through 80 71 72 73 74 75 76 77 78 79 80 Columns 81 through 90 81 82 83 84 85 86 87 88 89 90 Columns 91 through 100 91 92 93 94 95 96 97 98 99 100 Columns 101 through 110 101 102 103 104 105 106 107 108 109 110 Columns 111 through 120 111 112 113 114 115 116 117 118 119 120 Columns 121 through 130 121 122 123 124 125 126 127 128 129 130 Columns 131 through 140 131 132 133 134 135 136 137 138 139 140 Columns 141 through 150 141 142 143 144 145 146 147 148 149 150 Columns 151 through 160 151 152 153 154 155 156 157 158 159 160 Columns 161 through 170 161 162 163 164 165 166 167 168 169 170 Columns 171 through 180 171 172 173 174 175 176 177 178 179 180 Columns 181 through 190 181 182 183 184 185 186 187 188 189 190 Columns 191 through 200 191 192 193 194 195 196 197 198 199 200 Columns 201 through 210 201 202 203 204 205 206 207 208 209 210 Columns 211 through 220 211 212 213 214 215 216 217 218 219 220 Columns 221 through 230 221 222 223 224 225 226 227 228 229 230 Columns 231 through 240 231 232 233 234 235 236 237 238 239 240 Columns 241 through 250 241 242 243 244 245 246 247 248 249 250 Columns 251 through 260 251 252 253 254 255 256 257 258 259 260 Columns 261 through 270 261 262 263 264 265 266 267 268 269 270 Columns 271 through 280 271 272 273 274 275 276 277 278 279 280 Columns 281 through 290 281 282 283 284 285 286 287 288 289 290 Columns 291 through 300 291 292 293 294 295 296 297 298 299 300 Columns 301 through 310 301 302 303 304 305 306 307 308 309 310 Columns 311 through 320 311 312 313 314 315 316 317 318 319 320 Columns 321 through 330 321 322 323 324 325 326 327 328 329 330 Columns 331 through 340 331 332 333 334 335 336 337 338 339 340 Columns 341 through 350 341 342 343 344 345 346 347 348 349 350 Columns 351 through 360 351 352 353 354 355 356 357 358 359 360 Columns 361 through 370 361 362 363 364 365 366 367 368 369 370 Columns 371 through 380 371 372 373 374 375 376 377 378 379 380 Columns 381 through 390 381 382 383 384 385 386 387 388 389 390 Columns 391 through 400 391 392 393 394 395 396 397 398 399 400 Columns 401 through 410 401 402 403 404 405 406 407 408 409 410 Columns 411 through 420 411 412 413 414 415 416 417 418 419 420 Columns 421 through 430 421 422 423 424 425 426 427 428 429 430 Columns 431 through 440 431 432 433 434 435 436 437 438 439 440 Columns 441 through 450 441 442 443 444 445 446 447 448 449 450 Columns 451 through 460 451 452 453 454 455 456 457 458 459 460 Columns 461 through 470 461 462 463 464 465 466 467 468 469 470 Columns 471 through 480 471 472 473 474 475 476 477 478 479 480 Columns 481 through 490 481 482 483 484 485 486 487 488 489 490 Columns 491 through 500 491 492 493 494 495 496 497 498 499 500 Columns 501 through 510 501 502 503 504 505 506 507 508 509 510 Columns 511 through 520 511 512 513 514 515 516 517 518 519 520 Columns 521 through 530 521 522 523 524 525 526 527 528 529 530 Columns 531 through 540 531 532 533 534 535 536 537 538 539 540 Columns 541 through 550 541 542 543 544 545 546 547 548 549 550 Columns 551 through 560 551 552 553 554 555 556 557 558 559 560 Columns 561 through 570 561 562 563 564 565 566 567 568 569 570 Columns 571 through 580 571 572 573 574 575 576 577 578 579 580 Columns 581 through 590 581 582 583 584 585 586 587 588 589 590 Columns 591 through 600 591 592 593 594 595 596 597 598 599 600 Columns 601 through 610 601 602 603 604 605 606 607 608 609 610 Columns 611 through 620 611 612 613 614 615 616 617 618 619 620 Columns 621 through 630 621 622 623 624 625 626 627 628 629 630 Columns 631 through 640 631 632 633 634 635 636 637 638 639 640 Columns 641 through 650 641 642 643 644 645 646 647 648 649 650 Columns 651 through 660 651 652 653 654 655 656 657 658 659 660 Columns 661 through 670 661 662 663 664 665 666 667 668 669 670 Columns 671 through 680 671 672 673 674 675 676 677 678 679 680 Columns 681 through 690 681 682 683 684 685 686 687 688 689 690 Columns 691 through 700 691 692 693 694 695 696 697 698 699 700 Columns 701 through 710 701 702 703 704 705 706 707 708 709 710 Columns 711 through 720 711 712 713 714 715 716 717 718 719 720 Columns 721 through 730 721 722 723 724 725 726 727 728 729 730 Columns 731 through 740 731 732 733 734 735 736 737 738 739 740 Columns 741 through 750 741 742 743 744 745 746 747 748 749 750 Columns 751 through 760 751 752 753 754 755 756 757 758 759 760 Columns 761 through 770 761 762 763 764 765 766 767 768 769 770 Columns 771 through 780 771 772 773 774 775 776 777 778 779 780 Columns 781 through 790 781 782 783 784 785 786 787 788 789 790 Columns 791 through 800 791 792 793 794 795 796 797 798 799 800 Columns 801 through 810 801 802 803 804 805 806 807 808 809 810 Columns 811 through 820 811 812 813 814 815 816 817 818 819 820 Columns 821 through 830 821 822 823 824 825 826 827 828 829 830 Columns 831 through 840 831 832 833 834 835 836 837 838 839 840 Columns 841 through 850 841 842 843 844 845 846 847 848 849 850 Columns 851 through 860 851 852 853 854 855 856 857 858 859 860 Columns 861 through 870 861 862 863 864 865 866 867 868 869 870 Columns 871 through 880 871 872 873 874 875 876 877 878 879 880 Columns 881 through 890 881 882 883 884 885 886 887 888 889 890 Columns 891 through 900 891 892 893 894 895 896 897 898 899 900 Columns 901 through 910 901 902 903 904 905 906 907 908 909 910 Columns 911 through 920 911 912 913 914 915 916 917 918 919 920 Columns 921 through 930 921 922 923 924 925 926 927 928 929 930 Columns 931 through 940 931 932 933 934 935 936 937 938 939 940 Columns 941 through 950 941 942 943 944 945 946 947 948 949 950 Columns 951 through 960 951 952 953 954 955 956 957 958 959 960 Columns 961 through 970 961 962 963 964 965 966 967 968 969 970 Columns 971 through 980 971 972 973 974 975 976 977 978 979 980 Columns 981 through 990 981 982 983 984 985 986 987 988 989 990 Columns 991 through 999 991 992 993 994 995 996 997 998 999

2   Pass
%% x = 4000; y_correct = 3732668; assert(isequal(euler001(x),y_correct))

a = Columns 1 through 5 1 2 3 4 5 Columns 6 through 10 6 7 8 9 10 Columns 11 through 15 11 12 13 14 15 Columns 16 through 20 16 17 18 19 20 Columns 21 through 25 21 22 23 24 25 Columns 26 through 30 26 27 28 29 30 Columns 31 through 35 31 32 33 34 35 Columns 36 through 40 36 37 38 39 40 Columns 41 through 45 41 42 43 44 45 Columns 46 through 50 46 47 48 49 50 Columns 51 through 55 51 52 53 54 55 Columns 56 through 60 56 57 58 59 60 Columns 61 through 65 61 62 63 64 65 Columns 66 through 70 66 67 68 69 70 Columns 71 through 75 71 72 73 74 75 Columns 76 through 80 76 77 78 79 80 Columns 81 through 85 81 82 83 84 85 Columns 86 through 90 86 87 88 89 90 Columns 91 through 95 91 92 93 94 95 Columns 96 through 100 96 97 98 99 100 Columns 101 through 105 101 102 103 104 105 Columns 106 through 110 106 107 108 109 110 Columns 111 through 115 111 112 113 114 115 Columns 116 through 120 116 117 118 119 120 Columns 121 through 125 121 122 123 124 125 Columns 126 through 130 126 127 128 129 130 Columns 131 through 135 131 132 133 134 135 Columns 136 through 140 136 137 138 139 140 Columns 141 through 145 141 142 143 144 145 Columns 146 through 150 146 147 148 149 150 Columns 151 through 155 151 152 153 154 155 Columns 156 through 160 156 157 158 159 160 Columns 161 through 165 161 162 163 164 165 Columns 166 through 170 166 167 168 169 170 Columns 171 through 175 171 172 173 174 175 Columns 176 through 180 176 177 178 179 180 Columns 181 through 185 181 182 183 184 185 Columns 186 through 190 186 187 188 189 190 Columns 191 through 195 191 192 193 194 195 Columns 196 through 200 196 197 198 199 200 Columns 201 through 205 201 202 203 204 205 Columns 206 through 210 206 207 208 209 210 Columns 211 through 215 211 212 213 214 215 Columns 216 through 220 216 217 218 219 220 Columns 221 through 225 221 222 223 224 225 Columns 226 through 230 226 227 228 229 230 Columns 231 through 235 231 232 233 234 235 Columns 236 through 240 236 237 238 239 240 Columns 241 through 245 241 242 243 244 245 Columns 246 through 250 246 247 248 249 250 Columns 251 through 255 251 252 253 254 255 Columns 256 through 260 256 257 258 259 260 Columns 261 through 265 261 262 263 264 265 Columns 266 through 270 266 267 268 269 270 Columns 271 through 275 271 272 273 274 275 Columns 276 through 280 276 277 278 279 280 Columns 281 through 285 281 282 283 284 285 Columns 286 through 290 286 287 288 289 290 Columns 291 through 295 291 292 293 294 295 Columns 296 through 300 296 297 298 299 300 Columns 301 through 305 301 302 303 304 305 Columns 306 through 310 306 307 308 309 310 Columns 311 through 315 311 312 313 314 315 Columns 316 through 320 316 317 318 319 320 Columns 321 through 325 321 322 323 324 325 Columns 326 through 330 326 327 328 329 330 Columns 331 through 335 331 332 333 334 335 Columns 336 through 340 336 337 338 339 340 Columns 341 through 345 341 342 343 344 345 Columns 346 through 350 346 347 348 349 350 Columns 351 through 355 351 352 353 354 355 Columns 356 through 360 356 357 358 359 360 Columns 361 through 365 361 362 363 364 365 Columns 366 through 370 366 367 368 369 370 Columns 371 through 375 371 372 373 374 375 Columns 376 through 380 376 377 378 379 380 Columns 381 through 385 381 382 383 384 385 Columns 386 through 390 386 387 388 389 390 Columns 391 through 395 391 392 393 394 395 Columns 396 through 400 396 397 398 399 400 Columns 401 through 405 401 402 403 404 405 Columns 406 through 410 406 407 408 409 410 Columns 411 through 415 411 412 413 414 415 Columns 416 through 420 416 417 418 419 420 Columns 421 through 425 421 422 423 424 425 Columns 426 through 430 426 427 428 429 430 Columns 431 through 435 431 432 433 434 435 Columns 436 through 440 436 437 438 439 440 Columns 441 through 445 441 442 443 444 445 Columns 446 through 450 446 447 448 449 450 Columns 451 through 455 451 452 453 454 455 Columns 456 through 460 456 457 458 459 460 Columns 461 through 465 461 462 463 464 465 Columns 466 through 470 466 467 468 469 470 Columns 471 through 475 471 472 473 474 475 Columns 476 through 480 476 477 478 479 480 Columns 481 through 485 481 482 483 484 485 Columns 486 through 490 486 487 488 489 490 Columns 491 through 495 491 492 493 494 495 Columns 496 through 500 496 497 498 499 500 Columns 501 through 505 501 502 503 504 505 Columns 506 through 510 506 507 508 509 510 Columns 511 through 515 511 512 513 514 515 Columns 516 through 520 516 517 518 519 520 Columns 521 through 525 521 522 523 524 525 Columns 526 through 530 526 527 528 529 530 Columns 531 through 535 531 532 533 534 535 Columns 536 through 540 536 537 538 539 540 Columns 541 through 545 541 542 543 544 545 Columns 546 through 550 546 547 548 549 550 Columns 551 through 555 551 552 553 554 555 Columns 556 through 560 556 557 558 559 560 Columns 561 through 565 561 562 563 564 565 Columns 566 through 570 566 567 568 569 570 Columns 571 through 575 571 572 573 574 575 Columns 576 through 580 ...

3   Pass
%% x = 2340; y_correct = 1276470; assert(isequal(euler001(x),y_correct))

a = Columns 1 through 5 1 2 3 4 5 Columns 6 through 10 6 7 8 9 10 Columns 11 through 15 11 12 13 14 15 Columns 16 through 20 16 17 18 19 20 Columns 21 through 25 21 22 23 24 25 Columns 26 through 30 26 27 28 29 30 Columns 31 through 35 31 32 33 34 35 Columns 36 through 40 36 37 38 39 40 Columns 41 through 45 41 42 43 44 45 Columns 46 through 50 46 47 48 49 50 Columns 51 through 55 51 52 53 54 55 Columns 56 through 60 56 57 58 59 60 Columns 61 through 65 61 62 63 64 65 Columns 66 through 70 66 67 68 69 70 Columns 71 through 75 71 72 73 74 75 Columns 76 through 80 76 77 78 79 80 Columns 81 through 85 81 82 83 84 85 Columns 86 through 90 86 87 88 89 90 Columns 91 through 95 91 92 93 94 95 Columns 96 through 100 96 97 98 99 100 Columns 101 through 105 101 102 103 104 105 Columns 106 through 110 106 107 108 109 110 Columns 111 through 115 111 112 113 114 115 Columns 116 through 120 116 117 118 119 120 Columns 121 through 125 121 122 123 124 125 Columns 126 through 130 126 127 128 129 130 Columns 131 through 135 131 132 133 134 135 Columns 136 through 140 136 137 138 139 140 Columns 141 through 145 141 142 143 144 145 Columns 146 through 150 146 147 148 149 150 Columns 151 through 155 151 152 153 154 155 Columns 156 through 160 156 157 158 159 160 Columns 161 through 165 161 162 163 164 165 Columns 166 through 170 166 167 168 169 170 Columns 171 through 175 171 172 173 174 175 Columns 176 through 180 176 177 178 179 180 Columns 181 through 185 181 182 183 184 185 Columns 186 through 190 186 187 188 189 190 Columns 191 through 195 191 192 193 194 195 Columns 196 through 200 196 197 198 199 200 Columns 201 through 205 201 202 203 204 205 Columns 206 through 210 206 207 208 209 210 Columns 211 through 215 211 212 213 214 215 Columns 216 through 220 216 217 218 219 220 Columns 221 through 225 221 222 223 224 225 Columns 226 through 230 226 227 228 229 230 Columns 231 through 235 231 232 233 234 235 Columns 236 through 240 236 237 238 239 240 Columns 241 through 245 241 242 243 244 245 Columns 246 through 250 246 247 248 249 250 Columns 251 through 255 251 252 253 254 255 Columns 256 through 260 256 257 258 259 260 Columns 261 through 265 261 262 263 264 265 Columns 266 through 270 266 267 268 269 270 Columns 271 through 275 271 272 273 274 275 Columns 276 through 280 276 277 278 279 280 Columns 281 through 285 281 282 283 284 285 Columns 286 through 290 286 287 288 289 290 Columns 291 through 295 291 292 293 294 295 Columns 296 through 300 296 297 298 299 300 Columns 301 through 305 301 302 303 304 305 Columns 306 through 310 306 307 308 309 310 Columns 311 through 315 311 312 313 314 315 Columns 316 through 320 316 317 318 319 320 Columns 321 through 325 321 322 323 324 325 Columns 326 through 330 326 327 328 329 330 Columns 331 through 335 331 332 333 334 335 Columns 336 through 340 336 337 338 339 340 Columns 341 through 345 341 342 343 344 345 Columns 346 through 350 346 347 348 349 350 Columns 351 through 355 351 352 353 354 355 Columns 356 through 360 356 357 358 359 360 Columns 361 through 365 361 362 363 364 365 Columns 366 through 370 366 367 368 369 370 Columns 371 through 375 371 372 373 374 375 Columns 376 through 380 376 377 378 379 380 Columns 381 through 385 381 382 383 384 385 Columns 386 through 390 386 387 388 389 390 Columns 391 through 395 391 392 393 394 395 Columns 396 through 400 396 397 398 399 400 Columns 401 through 405 401 402 403 404 405 Columns 406 through 410 406 407 408 409 410 Columns 411 through 415 411 412 413 414 415 Columns 416 through 420 416 417 418 419 420 Columns 421 through 425 421 422 423 424 425 Columns 426 through 430 426 427 428 429 430 Columns 431 through 435 431 432 433 434 435 Columns 436 through 440 436 437 438 439 440 Columns 441 through 445 441 442 443 444 445 Columns 446 through 450 446 447 448 449 450 Columns 451 through 455 451 452 453 454 455 Columns 456 through 460 456 457 458 459 460 Columns 461 through 465 461 462 463 464 465 Columns 466 through 470 466 467 468 469 470 Columns 471 through 475 471 472 473 474 475 Columns 476 through 480 476 477 478 479 480 Columns 481 through 485 481 482 483 484 485 Columns 486 through 490 486 487 488 489 490 Columns 491 through 495 491 492 493 494 495 Columns 496 through 500 496 497 498 499 500 Columns 501 through 505 501 502 503 504 505 Columns 506 through 510 506 507 508 509 510 Columns 511 through 515 511 512 513 514 515 Columns 516 through 520 516 517 518 519 520 Columns 521 through 525 521 522 523 524 525 Columns 526 through 530 526 527 528 529 530 Columns 531 through 535 531 532 533 534 535 Columns 536 through 540 536 537 538 539 540 Columns 541 through 545 541 542 543 544 545 Columns 546 through 550 546 547 548 549 550 Columns 551 through 555 551 552 553 554 555 Columns 556 through 560 556 557 558 559 560 Columns 561 through 565 561 562 563 564 565 Columns 566 through 570 566 567 568 569 570 Columns 571 through 575 571 572 573 574 575 Columns 576 through 580 ...

4   Fail