Cody

Solution 1095689

Submitted on 31 Dec 2016 by Pritesh Shah
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 = 9; y_correct = 6; assert(isequal(odd_elimination(n),y_correct))

2 4 6 8 2 6 6

2   Pass
n = 1000; y_correct = 510; assert(isequal(odd_elimination(n),y_correct))

Columns 1 through 8 2 4 6 8 10 12 14 16 Columns 9 through 16 18 20 22 24 26 28 30 32 Columns 17 through 24 34 36 38 40 42 44 46 48 Columns 25 through 32 50 52 54 56 58 60 62 64 Columns 33 through 40 66 68 70 72 74 76 78 80 Columns 41 through 48 82 84 86 88 90 92 94 96 Columns 49 through 56 98 100 102 104 106 108 110 112 Columns 57 through 64 114 116 118 120 122 124 126 128 Columns 65 through 72 130 132 134 136 138 140 142 144 Columns 73 through 80 146 148 150 152 154 156 158 160 Columns 81 through 88 162 164 166 168 170 172 174 176 Columns 89 through 96 178 180 182 184 186 188 190 192 Columns 97 through 104 194 196 198 200 202 204 206 208 Columns 105 through 112 210 212 214 216 218 220 222 224 Columns 113 through 120 226 228 230 232 234 236 238 240 Columns 121 through 128 242 244 246 248 250 252 254 256 Columns 129 through 136 258 260 262 264 266 268 270 272 Columns 137 through 144 274 276 278 280 282 284 286 288 Columns 145 through 152 290 292 294 296 298 300 302 304 Columns 153 through 160 306 308 310 312 314 316 318 320 Columns 161 through 168 322 324 326 328 330 332 334 336 Columns 169 through 176 338 340 342 344 346 348 350 352 Columns 177 through 184 354 356 358 360 362 364 366 368 Columns 185 through 192 370 372 374 376 378 380 382 384 Columns 193 through 200 386 388 390 392 394 396 398 400 Columns 201 through 208 402 404 406 408 410 412 414 416 Columns 209 through 216 418 420 422 424 426 428 430 432 Columns 217 through 224 434 436 438 440 442 444 446 448 Columns 225 through 232 450 452 454 456 458 460 462 464 Columns 233 through 240 466 468 470 472 474 476 478 480 Columns 241 through 248 482 484 486 488 490 492 494 496 Columns 249 through 256 498 500 502 504 506 508 510 512 Columns 257 through 264 514 516 518 520 522 524 526 528 Columns 265 through 272 530 532 534 536 538 540 542 544 Columns 273 through 280 546 548 550 552 554 556 558 560 Columns 281 through 288 562 564 566 568 570 572 574 576 Columns 289 through 296 578 580 582 584 586 588 590 592 Columns 297 through 304 594 596 598 600 602 604 606 608 Columns 305 through 312 610 612 614 616 618 620 622 624 Columns 313 through 320 626 628 630 632 634 636 638 640 Columns 321 through 328 642 644 646 648 650 652 654 656 Columns 329 through 336 658 660 662 664 666 668 670 672 Columns 337 through 344 674 676 678 680 682 684 686 688 Columns 345 through 352 690 692 694 696 698 700 702 704 Columns 353 through 360 706 708 710 712 714 716 718 720 Columns 361 through 368 722 724 726 728 730 732 734 736 Columns 369 through 376 738 740 742 744 746 748 750 752 Columns 377 through 384 754 756 758 760 762 764 766 768 Columns 385 through 392 770 772 774 776 778 780 782 784 Columns 393 through 400 786 788 790 792 794 796 798 800 Columns 401 through 408 802 804 806 808 810 812 814 816 Columns 409 through 416 818 820 822 824 826 828 830 832 Columns 417 through 424 834 836 838 840 842 844 846 848 Columns 425 through 432 850 852 854 856 858 860 862 864 Columns 433 through 440 866 868 870 872 874 876 878 880 Columns 441 through 448 882 884 886 888 890 892 894 896 Columns 449 through 456 898 900 902 904 906 908 910 912 Columns 457 through 464 914 916 918 920 922 924 926 928 Columns 465 through 472 930 932 934 936 938 940 942 944 Columns 473 through 480 946 948 950 952 954 956 958 960 Columns 481 through 488 962 964 966 968 970 972 974 976 Columns 489 through 496 978 980 982 984 986 988 990 992 Columns 497 through 500 994 996 998 1000 Columns 1 through 16 2 6 10 14 18 22 26 30 34 38 42 46 50 54 58 62 Columns 17 through 32 66 70 74 78 82 86 90 94 98 102 106 110 114 118 122 126 Columns 33 through 48 130 134 138 142 146 150 154 158 162 166 170 174 178 182 186 190 Columns 49 through 64 194 198 202 206 210 214 218 222 226 230 234 238 242 246 250 254 Columns 65 through 80 258 262 266 270 274 278 282 286 290 294 298 302 306 310 314 318 Columns 81 through 96 322 326 330 334 338 342 346 350 354 358 362 366 370 374 378 382 Columns 97 through 112 386 390 394 398 402 406 410 414 418 422 426 430 434 438 442 446 Columns 113 through 128 450 454 458 462 466 470 474 478 482 486 490 494 498 502 506 510 Columns 129 through 144 514 518 522 526 530 534 538 542 546 550 554 558 562 566 570 574 Columns 145 through 160 578 582 586 590 594 598 602 606 610 614 618 622 626 630 634 638 Columns 161 through 176 642 646 650 654 658 662 666 670 674 678 682 686 690 694 698 702 Columns 177 through 192 706 710 714 718 722 726 730 734 738 742 746 750 754 758 762 766 Columns 193 through 208 770 774 778 782 786 790 794 798 802 806 810 814 818 822 826 830 Columns 209 through 224 834 838 842 846 850 854 858 862 866 870 874 878 882 886 890 894 Columns 225 through 240 898 902 906 910 914 918 922 926 930 934 938 942 946 950 954 958 Columns 241 through 250 962 966 970 974 978 982 986 990 994 998 Columns 1 through 16 6 14 22 30 38 46 54 62 70 78 86 94 102 110 118 126 Columns 17 through 32 134 142 150 158 166 174 182 190 198 206 214 222 230 238 246 254 Column...

3   Pass
n = 99; y_correct = 56; assert(isequal(odd_elimination(n),y_correct))

Columns 1 through 16 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 Columns 17 through 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 Columns 33 through 48 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 Column 49 98 Columns 1 through 16 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 Columns 17 through 24 68 72 76 80 84 88 92 96 8 16 24 32 40 48 56 64 72 80 88 96 8 24 40 56 72 88 24 56 88 56

4   Pass
n = 5000; y_correct = 2014; assert(isequal(odd_elimination(n),y_correct))

Columns 1 through 8 2 4 6 8 10 12 14 16 Columns 9 through 16 18 20 22 24 26 28 30 32 Columns 17 through 24 34 36 38 40 42 44 46 48 Columns 25 through 32 50 52 54 56 58 60 62 64 Columns 33 through 40 66 68 70 72 74 76 78 80 Columns 41 through 48 82 84 86 88 90 92 94 96 Columns 49 through 56 98 100 102 104 106 108 110 112 Columns 57 through 64 114 116 118 120 122 124 126 128 Columns 65 through 72 130 132 134 136 138 140 142 144 Columns 73 through 80 146 148 150 152 154 156 158 160 Columns 81 through 88 162 164 166 168 170 172 174 176 Columns 89 through 96 178 180 182 184 186 188 190 192 Columns 97 through 104 194 196 198 200 202 204 206 208 Columns 105 through 112 210 212 214 216 218 220 222 224 Columns 113 through 120 226 228 230 232 234 236 238 240 Columns 121 through 128 242 244 246 248 250 252 254 256 Columns 129 through 136 258 260 262 264 266 268 270 272 Columns 137 through 144 274 276 278 280 282 284 286 288 Columns 145 through 152 290 292 294 296 298 300 302 304 Columns 153 through 160 306 308 310 312 314 316 318 320 Columns 161 through 168 322 324 326 328 330 332 334 336 Columns 169 through 176 338 340 342 344 346 348 350 352 Columns 177 through 184 354 356 358 360 362 364 366 368 Columns 185 through 192 370 372 374 376 378 380 382 384 Columns 193 through 200 386 388 390 392 394 396 398 400 Columns 201 through 208 402 404 406 408 410 412 414 416 Columns 209 through 216 418 420 422 424 426 428 430 432 Columns 217 through 224 434 436 438 440 442 444 446 448 Columns 225 through 232 450 452 454 456 458 460 462 464 Columns 233 through 240 466 468 470 472 474 476 478 480 Columns 241 through 248 482 484 486 488 490 492 494 496 Columns 249 through 256 498 500 502 504 506 508 510 512 Columns 257 through 264 514 516 518 520 522 524 526 528 Columns 265 through 272 530 532 534 536 538 540 542 544 Columns 273 through 280 546 548 550 552 554 556 558 560 Columns 281 through 288 562 564 566 568 570 572 574 576 Columns 289 through 296 578 580 582 584 586 588 590 592 Columns 297 through 304 594 596 598 600 602 604 606 608 Columns 305 through 312 610 612 614 616 618 620 622 624 Columns 313 through 320 626 628 630 632 634 636 638 640 Columns 321 through 328 642 644 646 648 650 652 654 656 Columns 329 through 336 658 660 662 664 666 668 670 672 Columns 337 through 344 674 676 678 680 682 684 686 688 Columns 345 through 352 690 692 694 696 698 700 702 704 Columns 353 through 360 706 708 710 712 714 716 718 720 Columns 361 through 368 722 724 726 728 730 732 734 736 Columns 369 through 376 738 740 742 744 746 748 750 752 Columns 377 through 384 754 756 758 760 762 764 766 768 Columns 385 through 392 770 772 774 776 778 780 782 784 Columns 393 through 400 786 788 790 792 794 796 798 800 Columns 401 through 408 802 804 806 808 810 812 814 816 Columns 409 through 416 818 820 822 824 826 828 830 832 Columns 417 through 424 834 836 838 840 842 844 846 848 Columns 425 through 432 850 852 854 856 858 860 862 864 Columns 433 through 440 866 868 870 872 874 876 878 880 Columns 441 through 448 882 884 886 888 890 892 894 896 Columns 449 through 456 898 900 902 904 906 908 910 912 Columns 457 through 464 914 916 918 920 922 924 926 928 Columns 465 through 472 930 932 934 936 938 940 942 944 Columns 473 through 480 946 948 950 952 954 956 958 960 Columns 481 through 488 962 964 966 968 970 972 974 976 Columns 489 through 496 978 980 982 984 986 988 990 992 Columns 497 through 504 994 996 998 1000 1002 1004 1006 1008 Columns 505 through 512 1010 1012 1014 1016 1018 1020 1022 1024 Columns 513 through 520 1026 1028 1030 1032 1034 1036 1038 1040 Columns 521 through 528 1042 1044 1046 1048 1050 1052 1054 1056 Columns 529 through 536 1058 1060 1062 1064 1066 1068 1070 1072 Columns 537 through 544 1074 1076 1078 1080 1082 1084 1086 1088 Columns 545 through 552 1090 1092 1094 1096 1098 1100 1102 1104 Columns 553 through 560 1106 1108 1110 1112 1114 1116 1118 1120 Columns 561 through 568 1122 1124 1126 1128 1130 1132 1134 1136 Columns 569 through 576 1138 1140 1142 1144 1146 1148 1150 1152 Columns 577 through 584 1154 1156 1158 1160 1162 1164 1166 1168 Columns 585 through 592 1170 1172 1174 1176 1178 1180 1182 1184 Columns 593 through 600 1186 1188 1190 1192 1194 1196 1198 1200 Columns 601 through 608 1202 1204 1206 1208 1210 1212 1214 1216 Columns 609 through 616 1218 1220 1222 1224 1226 1228 1230 1232 Columns 617 through 624 1234 1236 1238 1240 1242 1244 1246 1248 Columns 625 through 632 1250 1252 1254 1256 1258 1260 1262 1264 Columns 633 through 640 1266 1268 1270 1272 1274 1276 1278 1280 Columns 641 through 648 ...

5   Pass
n = 100000; y_correct = 55286; assert(isequal(odd_elimination(n),y_correct))

Columns 1 through 8 2 4 6 8 10 12 14 16 Columns 9 through 16 18 20 22 24 26 28 30 32 Columns 17 through 24 34 36 38 40 42 44 46 48 Columns 25 through 32 50 52 54 56 58 60 62 64 Columns 33 through 40 66 68 70 72 74 76 78 80 Columns 41 through 48 82 84 86 88 90 92 94 96 Columns 49 through 56 98 100 102 104 106 108 110 112 Columns 57 through 64 114 116 118 120 122 124 126 128 Columns 65 through 72 130 132 134 136 138 140 142 144 Columns 73 through 80 146 148 150 152 154 156 158 160 Columns 81 through 88 162 164 166 168 170 172 174 176 Columns 89 through 96 178 180 182 184 186 188 190 192 Columns 97 through 104 194 196 198 200 202 204 206 208 Columns 105 through 112 210 212 214 216 218 220 222 224 Columns 113 through 120 226 228 230 232 234 236 238 240 Columns 121 through 128 242 244 246 248 250 252 254 256 Columns 129 through 136 258 260 262 264 266 268 270 272 Columns 137 through 144 274 276 278 280 282 284 286 288 Columns 145 through 152 290 292 294 296 298 300 302 304 Columns 153 through 160 306 308 310 312 314 316 318 320 Columns 161 through 168 322 324 326 328 330 332 334 336 Columns 169 through 176 338 340 342 344 346 348 350 352 Columns 177 through 184 354 356 358 360 362 364 366 368 Columns 185 through 192 370 372 374 376 378 380 382 384 Columns 193 through 200 386 388 390 392 394 396 398 400 Columns 201 through 208 402 404 406 408 410 412 414 416 Columns 209 through 216 418 420 422 424 426 428 430 432 Columns 217 through 224 434 436 438 440 442 444 446 448 Columns 225 through 232 450 452 454 456 458 460 462 464 Columns 233 through 240 466 468 470 472 474 476 478 480 Columns 241 through 248 482 484 486 488 490 492 494 496 Columns 249 through 256 498 500 502 504 506 508 510 512 Columns 257 through 264 514 516 518 520 522 524 526 528 Columns 265 through 272 530 532 534 536 538 540 542 544 Columns 273 through 280 546 548 550 552 554 556 558 560 Columns 281 through 288 562 564 566 568 570 572 574 576 Columns 289 through 296 578 580 582 584 586 588 590 592 Columns 297 through 304 594 596 598 600 602 604 606 608 Columns 305 through 312 610 612 614 616 618 620 622 624 Columns 313 through 320 626 628 630 632 634 636 638 640 Columns 321 through 328 642 644 646 648 650 652 654 656 Columns 329 through 336 658 660 662 664 666 668 670 672 Columns 337 through 344 674 676 678 680 682 684 686 688 Columns 345 through 352 690 692 694 696 698 700 702 704 Columns 353 through 360 706 708 710 712 714 716 718 720 Columns 361 through 368 722 724 726 728 730 732 734 736 Columns 369 through 376 738 740 742 744 746 748 750 752 Columns 377 through 384 754 756 758 760 762 764 766 768 Columns 385 through 392 770 772 774 776 778 780 782 784 Columns 393 through 400 786 788 790 792 794 796 798 800 Columns 401 through 408 802 804 806 808 810 812 814 816 Columns 409 through 416 818 820 822 824 826 828 830 832 Columns 417 through 424 834 836 838 840 842 844 846 848 Columns 425 through 432 850 852 854 856 858 860 862 864 Columns 433 through 440 866 868 870 872 874 876 878 880 Columns 441 through 448 882 884 886 888 890 892 894 896 Columns 449 through 456 898 900 902 904 906 908 910 912 Columns 457 through 464 914 916 918 920 922 924 926 928 Columns 465 through 472 930 932 934 936 938 940 942 944 Columns 473 through 480 946 948 950 952 954 956 958 960 Columns 481 through 488 962 964 966 968 970 972 974 976 Columns 489 through 496 978 980 982 984 986 988 990 992 Columns 497 through 504 994 996 998 1000 1002 1004 1006 1008 Columns 505 through 512 1010 1012 1014 1016 1018 1020 1022 1024 Columns 513 through 520 1026 1028 1030 1032 1034 1036 1038 1040 Columns 521 through 528 1042 1044 1046 1048 1050 1052 1054 1056 Columns 529 through 536 1058 1060 1062 1064 1066 1068 1070 1072 Columns 537 through 544 1074 1076 1078 1080 1082 1084 1086 1088 Columns 545 through 552 1090 1092 1094 1096 1098 1100 1102 1104 Columns 553 through 560 1106 1108 1110 1112 1114 1116 1118 1120 Columns 561 through 568 1122 1124 1126 1128 1130 1132 1134 1136 Columns 569 through 576 1138 1140 1142 1144 1146 1148 1150 1152 Columns 577 through 584 1154 1156 1158 1160 1162 1164 1166 1168 Columns 585 through 592 1170 1172 1174 1176 1178 1180 1182 1184 Columns 593 through 600 1186 1188 1190 1192 1194 1196 1198 1200 Columns 601 through 608 1202 1204 1206 1208 1210 1212 1214 1216 Columns 609 through 616 1218 1220 1222 1224 1226 1228 1230 1232 Columns 617 through 624 1234 1236 1238 1240 1242 1244 1246 1248 Columns 625 through 632 1250 1252 1254 1256 1258 1260 1262 1264 Columns 633 through 640 1266 1268 1270 1272 1274 1276 1278 1280 Columns 641 through 648 ...

6   Pass
n = 666; y_correct = 480; assert(isequal(odd_elimination(n),y_correct))

Columns 1 through 16 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 Columns 17 through 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 Columns 33 through 48 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 Columns 49 through 64 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 Columns 65 through 80 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 Columns 81 through 96 162 164 166 168 170 172 174 176 178 180 182 184 186 188 190 192 Columns 97 through 112 194 196 198 200 202 204 206 208 210 212 214 216 218 220 222 224 Columns 113 through 128 226 228 230 232 234 236 238 240 242 244 246 248 250 252 254 256 Columns 129 through 144 258 260 262 264 266 268 270 272 274 276 278 280 282 284 286 288 Columns 145 through 160 290 292 294 296 298 300 302 304 306 308 310 312 314 316 318 320 Columns 161 through 176 322 324 326 328 330 332 334 336 338 340 342 344 346 348 350 352 Columns 177 through 192 354 356 358 360 362 364 366 368 370 372 374 376 378 380 382 384 Columns 193 through 208 386 388 390 392 394 396 398 400 402 404 406 408 410 412 414 416 Columns 209 through 224 418 420 422 424 426 428 430 432 434 436 438 440 442 444 446 448 Columns 225 through 240 450 452 454 456 458 460 462 464 466 468 470 472 474 476 478 480 Columns 241 through 256 482 484 486 488 490 492 494 496 498 500 502 504 506 508 510 512 Columns 257 through 272 514 516 518 520 522 524 526 528 530 532 534 536 538 540 542 544 Columns 273 through 288 546 548 550 552 554 556 558 560 562 564 566 568 570 572 574 576 Columns 289 through 304 578 580 582 584 586 588 590 592 594 596 598 600 602 604 606 608 Columns 305 through 320 610 612 614 616 618 620 622 624 626 628 630 632 634 636 638 640 Columns 321 through 333 642 644 646 648 650 652 654 656 658 660 662 664 666 Columns 1 through 16 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 Columns 17 through 32 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 Columns 33 through 48 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 Columns 49 through 64 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 256 Columns 65 through 80 260 264 268 272 276 280 284 288 292 296 300 304 308 312 316 320 Columns 81 through 96 324 328 332 336 340 344 348 352 356 360 364 368 372 376 380 384 Columns 97 through 112 388 392 396 400 404 408 412 416 420 424 428 432 436 440 444 448 Columns 113 through 128 452 456 460 464 468 472 476 480 484 488 492 496 500 504 508 512 Columns 129 through 144 516 520 524 528 532 536 540 544 548 552 556 560 564 568 572 576 Columns 145 through 160 580 584 588 592 596 600 604 608 612 616 620 624 628 632 636 640 Columns 161 through 166 644 648 652 656 660 664 Columns 1 through 16 8 16 24 32 40 48 56 64 72 80 88 96 104 112 120 128 Columns 17 through 32 136 144 152 160 168 176 184 192 200 208 216 224 232 240 248 256 Columns 33 through 48 264 272 280 288 296 304 312 320 328 336 344 352 360 368 376 384 Columns 49 through 64 392 400 408 416 424 432 440 448 456 464 472 480 488 496 504 512 Columns 65 through 80 520 528 536 544 552 560 568 576 584 592 600 608 616 624 632 640 Columns 81 through 83 648 656 664 Columns 1 through 16 16 32 48 64 80 96 112 128 144 160 176 192 208 224 240 256 Columns 17 through 32 272 288 304 320 336 352 368 384 400 416 432 448 464 480 496 512 Columns 33 through 41 528 544 560 576 592 608 624 640 656 Columns 1 through 16 32 64 96 128 160 192 224 256 288 320 352 384 416 448 480 512 Columns 17 through 20 544 576 608 640 32 96 160 224 288 352 416 480 544 608 96 224 352 480 608 224 480 480

Suggested Problems

More from this Author12