Cody

Solution 1822029

Submitted on 21 May 2019 by Anshil Kumar
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))

s = 1000 t = 1000 s = 999 fivemax = 199 threemax = 333 threes = Columns 1 through 30 3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 75 78 81 84 87 90 Columns 31 through 60 93 96 99 102 105 108 111 114 117 120 123 126 129 132 135 138 141 144 147 150 153 156 159 162 165 168 171 174 177 180 Columns 61 through 90 183 186 189 192 195 198 201 204 207 210 213 216 219 222 225 228 231 234 237 240 243 246 249 252 255 258 261 264 267 270 Columns 91 through 120 273 276 279 282 285 288 291 294 297 300 303 306 309 312 315 318 321 324 327 330 333 336 339 342 345 348 351 354 357 360 Columns 121 through 150 363 366 369 372 375 378 381 384 387 390 393 396 399 402 405 408 411 414 417 420 423 426 429 432 435 438 441 444 447 450 Columns 151 through 180 453 456 459 462 465 468 471 474 477 480 483 486 489 492 495 498 501 504 507 510 513 516 519 522 525 528 531 534 537 540 Columns 181 through 210 543 546 549 552 555 558 561 564 567 570 573 576 579 582 585 588 591 594 597 600 603 606 609 612 615 618 621 624 627 630 Columns 211 through 240 633 636 639 642 645 648 651 654 657 660 663 666 669 672 675 678 681 684 687 690 693 696 699 702 705 708 711 714 717 720 Columns 241 through 270 723 726 729 732 735 738 741 744 747 750 753 756 759 762 765 768 771 774 777 780 783 786 789 792 795 798 801 804 807 810 Columns 271 through 300 813 816 819 822 825 828 831 834 837 840 843 846 849 852 855 858 861 864 867 870 873 876 879 882 885 888 891 894 897 900 Columns 301 through 330 903 906 909 912 915 918 921 924 927 930 933 936 939 942 945 948 951 954 957 960 963 966 969 972 975 978 981 984 987 990 Columns 331 through 333 993 996 999 fives = Columns 1 through 30 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 110 115 120 125 130 135 140 145 150 Columns 31 through 60 155 160 165 170 175 180 185 190 195 200 205 210 215 220 225 230 235 240 245 250 255 260 265 270 275 280 285 290 295 300 Columns 61 through 90 305 310 315 320 325 330 335 340 345 350 355 360 365 370 375 380 385 390 395 400 405 410 415 420 425 430 435 440 445 450 Columns 91 through 120 455 460 465 470 475 480 485 490 495 500 505 510 515 520 525 530 535 540 545 550 555 560 565 570 575 580 585 590 595 600 Columns 121 through 150 605 610 615 620 625 630 635 640 645 650 655 660 665 670 675 680 685 690 695 700 705 710 715 720 725 730 735 740 745 750 Columns 151 through 180 755 760 765 770 775 780 785 790 795 800 805 810 815 820 825 830 835 840 845 850 855 860 865 870 875 880 885 890 895 900 Columns 181 through 199 905 910 915 920 925 930 935 940 945 950 955 960 965 970 975 980 985 990 995 y = Columns 1 through 30 3 5 6 9 10 12 15 18 20 21 24 25 27 30 33 35 36 39 40 42 45 48 50 51 54 55 57 60 63 65 Columns 31 through 60 66 69 70 72 75 78 80 81 84 85 87 90 93 95 96 99 100 102 105 108 110 111 114 115 117 120 123 125 126 129 Columns 61 through 90 130 132 135 138 140 141 144 145 147 150 153 155 156 159 160 162 165 168 170 171 174 175 177 180 183 185 186 189 190 192 Columns 91 through 120 195 198 200 201 204 205 207 210 213 215 216 219 220 222 225 228 230 231 234 235 237 240 243 245 246 249 250 252 255 258 Columns 121 through 150 260 261 264 265 267 270 273 275 276 279 280 282 285 288 290 291 294 295 297 300 303 305 306 309 310 312 315 318 320 321 Columns 151 through 180 324 325 327 330 333 335 336 339 340 342 345 348 350 351 354 355 357 360 363 365 366 369 370 372 375 378 380 381 384 385 Columns 181 through 210 387 390 393 395 396 399 400 402 405 408 410 411 414 415 417 420 423 425 426 429 430 432 435 438 440 441 444 445 447 450 Columns 211 through 240 453 455 456 459 460 462 465 468 470 471 474 475 477 480 483 485 486 489 490 492 495 498 500 501 504 505 507 510 513 515 Columns 241 through 270 516 519 520 522 525 528 530 531 534 535 537 540 543 545 546 549 550 552 555 558 560 561 564 565 567 570 573 575 576 579 Columns 271 through 300 580 582 585 588 590 591 594 595 597 600 603 605 606 609 610 612 615 618 620 621 624 625 627 630 633 635 636 639 640 642 Columns 301 through 330 645 648 650 651 654 655 657 660 663 665 666 669 670 672 675 678 680 681 684 685 687 690 693 695 696 699 700 702 705 708 Columns 331 through 360 710 711 714 715 717 720 723 725 726 729 730 732 735 738 740 741 744 745 747 750 753 755 756 759 760 762 765 768 770 771 Columns 361 through 390 774 775 777 780 783 785 786 789 790 792 795 798 800 801 804 805 807 810 813 815 816 819 820 822 825 828 830 831 834 835 Columns 391 through 420 837 840 843 845 846 849 850 852 855 858 860 861 864 865 867 870 873 875 876 879 880 882 885 888 890 891 894 895 897 900 Columns 421 through 450 903 905 906 909 910 912 915 918 920 921 924 925 927 930 933 935 936 939 940 942 945 948 950 951 954 955 957 960 963 965 Columns 451 through 466 966 969 970 972 975 978 980 981 984 985 987 990 993 995 996 999 y = 233168

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

s = 4000 t = 4000 s = 3999 fivemax = 799 threemax = 1333 threes = Columns 1 through 15 3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 Columns 16 through 30 48 51 54 57 60 63 66 69 72 75 78 81 84 87 90 Columns 31 through 45 93 96 99 102 105 108 111 114 117 120 123 126 129 132 135 Columns 46 through 60 138 141 144 147 150 153 156 159 162 165 168 171 174 177 180 Columns 61 through 75 183 186 189 192 195 198 201 204 207 210 213 216 219 222 225 Columns 76 through 90 228 231 234 237 240 243 246 249 252 255 258 261 264 267 270 Columns 91 through 105 273 276 279 282 285 288 291 294 297 300 303 306 309 312 315 Columns 106 through 120 318 321 324 327 330 333 336 339 342 345 348 351 354 357 360 Columns 121 through 135 363 366 369 372 375 378 381 384 387 390 393 396 399 402 405 Columns 136 through 150 408 411 414 417 420 423 426 429 432 435 438 441 444 447 450 Columns 151 through 165 453 456 459 462 465 468 471 474 477 480 483 486 489 492 495 Columns 166 through 180 498 501 504 507 510 513 516 519 522 525 528 531 534 537 540 Columns 181 through 195 543 546 549 552 555 558 561 564 567 570 573 576 579 582 585 Columns 196 through 210 588 591 594 597 600 603 606 609 612 615 618 621 624 627 630 Columns 211 through 225 633 636 639 642 645 648 651 654 657 660 663 666 669 672 675 Columns 226 through 240 678 681 684 687 690 693 696 699 702 705 708 711 714 717 720 Columns 241 through 255 723 726 729 732 735 738 741 744 747 750 753 756 759 762 765 Columns 256 through 270 768 771 774 777 780 783 786 789 792 795 798 801 804 807 810 Columns 271 through 285 813 816 819 822 825 828 831 834 837 840 843 846 849 852 855 Columns 286 through 300 858 861 864 867 870 873 876 879 882 885 888 891 894 897 900 Columns 301 through 315 903 906 909 912 915 918 921 924 927 930 933 936 939 942 945 Columns 316 through 330 948 951 954 957 960 963 966 969 972 975 978 981 984 987 990 Columns 331 through 345 993 996 999 1002 1005 1008 1011 1014 1017 1020 1023 1026 1029 1032 1035 Columns 346 through 360 1038 1041 1044 1047 1050 1053 1056 1059 1062 1065 1068 1071 1074 1077 1080 Columns 361 through 375 1083 1086 1089 1092 1095 1098 1101 1104 1107 1110 1113 1116 1119 1122 1125 Columns 376 through 390 1128 1131 1134 1137 1140 1143 1146 1149 1152 1155 1158 1161 1164 1167 1170 Columns 391 through 405 1173 1176 1179 1182 1185 1188 1191 1194 1197 1200 1203 1206 1209 1212 1215 Columns 406 through 420 1218 1221 1224 1227 1230 1233 1236 1239 1242 1245 1248 1251 1254 1257 1260 Columns 421 through 435 1263 1266 1269 1272 1275 1278 1281 1284 1287 1290 1293 1296 1299 1302 1305 Columns 436 through 450 1308 1311 1314 1317 1320 1323 1326 1329 1332 1335 1338 1341 1344 1347 1350 Columns 451 through 465 1353 1356 1359 1362 1365 1368 1371 1374 1377 1380 1383 1386 1389 1392 1395 Columns 466 through 480 1398 1401 1404 1407 1410 1413 1416 1419 1422 1425 1428 1431 1434 1437 1440 Columns 481 through 495 1443 1446 1449 1452 1455 1458 1461 1464 1467 1470 1473 1476 1479 1482 1485 Columns 496 through 510 1488 1491 1494 1497 1500 1503 1506 1509 1512 1515 1518 1521 1524 1527 1530 Columns 511 through 525 1533 1536 1539 1542 1545 1548 1551 1554 1557 1560 1563 1566 1569 1572 1575 Columns 526 through 540 1578 1581 1584 1587 1590 1593 1596 1599 1602 1605 1608 1611 1614 1617 1620 Columns 541 through 555 1623 1626 1629 1632 1635 1638 1641 1644 1647 1650 1653 1656 1659 1662 1665 Columns 556 through 570 1668 1671 1674 1677 1680 1683 1686 1689 1692 1695 1698 1701 1704 1707 1710 Columns 571 through 585 1713 1716 1719 1722 1725 1728 1731 1734 1737 1740 1743 1746 1749 1752 1755 Columns 586 through 600 1758 1761 1764 1767 1770 1773 1776 1779 1782 1785 1788 1791 1794 1797 1800 Columns 601 through 615 1803 1806 1809 1812 1815 1818 1821 1824 1827 1830 1833 1836 1839 1842 1845 Columns 616 through 630 1848 1851 1854 1857 1860 1863 1866 1869 1872 1875 1878 1881 1884 1887 1890 Columns 631 through 645 1893 1896 1899 1902 1905 1908 1911 1914 1917 1920 1923 1926 1929 1932 1935 Columns 646 through 660 1938 1941 1944 1947 1950 1953 1956 1959 1962 1965 1968 1971 1974 1977 1980 Columns 661 through 675 1983 1986 1989 1992 1995 1998 2001 2004 2007 2010 2013 2016 2019 2022 2025 Columns 676 through 690 2028 2031 2034 2037 2040 2043 2046 2049 2052 2055 2058 2061 2064 2067 2070 Columns 691 through 705 2073 2076 2079 2082 2085 2088 2091 2094 2097 2100 2103 2106 2109 2112 2115 Columns 706 through 720 2118 2121 2124 212...

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

s = 2340 t = 2340 s = 2339 t = 2339 fivemax = 467 threemax = 779 threes = Columns 1 through 15 3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 Columns 16 through 30 48 51 54 57 60 63 66 69 72 75 78 81 84 87 90 Columns 31 through 45 93 96 99 102 105 108 111 114 117 120 123 126 129 132 135 Columns 46 through 60 138 141 144 147 150 153 156 159 162 165 168 171 174 177 180 Columns 61 through 75 183 186 189 192 195 198 201 204 207 210 213 216 219 222 225 Columns 76 through 90 228 231 234 237 240 243 246 249 252 255 258 261 264 267 270 Columns 91 through 105 273 276 279 282 285 288 291 294 297 300 303 306 309 312 315 Columns 106 through 120 318 321 324 327 330 333 336 339 342 345 348 351 354 357 360 Columns 121 through 135 363 366 369 372 375 378 381 384 387 390 393 396 399 402 405 Columns 136 through 150 408 411 414 417 420 423 426 429 432 435 438 441 444 447 450 Columns 151 through 165 453 456 459 462 465 468 471 474 477 480 483 486 489 492 495 Columns 166 through 180 498 501 504 507 510 513 516 519 522 525 528 531 534 537 540 Columns 181 through 195 543 546 549 552 555 558 561 564 567 570 573 576 579 582 585 Columns 196 through 210 588 591 594 597 600 603 606 609 612 615 618 621 624 627 630 Columns 211 through 225 633 636 639 642 645 648 651 654 657 660 663 666 669 672 675 Columns 226 through 240 678 681 684 687 690 693 696 699 702 705 708 711 714 717 720 Columns 241 through 255 723 726 729 732 735 738 741 744 747 750 753 756 759 762 765 Columns 256 through 270 768 771 774 777 780 783 786 789 792 795 798 801 804 807 810 Columns 271 through 285 813 816 819 822 825 828 831 834 837 840 843 846 849 852 855 Columns 286 through 300 858 861 864 867 870 873 876 879 882 885 888 891 894 897 900 Columns 301 through 315 903 906 909 912 915 918 921 924 927 930 933 936 939 942 945 Columns 316 through 330 948 951 954 957 960 963 966 969 972 975 978 981 984 987 990 Columns 331 through 345 993 996 999 1002 1005 1008 1011 1014 1017 1020 1023 1026 1029 1032 1035 Columns 346 through 360 1038 1041 1044 1047 1050 1053 1056 1059 1062 1065 1068 1071 1074 1077 1080 Columns 361 through 375 1083 1086 1089 1092 1095 1098 1101 1104 1107 1110 1113 1116 1119 1122 1125 Columns 376 through 390 1128 1131 1134 1137 1140 1143 1146 1149 1152 1155 1158 1161 1164 1167 1170 Columns 391 through 405 1173 1176 1179 1182 1185 1188 1191 1194 1197 1200 1203 1206 1209 1212 1215 Columns 406 through 420 1218 1221 1224 1227 1230 1233 1236 1239 1242 1245 1248 1251 1254 1257 1260 Columns 421 through 435 1263 1266 1269 1272 1275 1278 1281 1284 1287 1290 1293 1296 1299 1302 1305 Columns 436 through 450 1308 1311 1314 1317 1320 1323 1326 1329 1332 1335 1338 1341 1344 1347 1350 Columns 451 through 465 1353 1356 1359 1362 1365 1368 1371 1374 1377 1380 1383 1386 1389 1392 1395 Columns 466 through 480 1398 1401 1404 1407 1410 1413 1416 1419 1422 1425 1428 1431 1434 1437 1440 Columns 481 through 495 1443 1446 1449 1452 1455 1458 1461 1464 1467 1470 1473 1476 1479 1482 1485 Columns 496 through 510 1488 1491 1494 1497 1500 1503 1506 1509 1512 1515 1518 1521 1524 1527 1530 Columns 511 through 525 1533 1536 1539 1542 1545 1548 1551 1554 1557 1560 1563 1566 1569 1572 1575 Columns 526 through 540 1578 1581 1584 1587 1590 1593 1596 1599 1602 1605 1608 1611 1614 1617 1620 Columns 541 through 555 1623 1626 1629 1632 1635 1638 1641 1644 1647 1650 1653 1656 1659 1662 1665 Columns 556 through 570 1668 1671 1674 1677 1680 1683 1686 1689 1692 1695 1698 1701 1704 1707 1710 Columns 571 through 585 1713 1716 1719 1722 1725 1728 1731 1734 1737 1740 1743 1746 1749 1752 1755 Columns 586 through 600 1758 1761 1764 1767 1770 1773 1776 1779 1782 1785 1788 1791 1794 1797 1800 Columns 601 through 615 1803 1806 1809 1812 1815 1818 1821 1824 1827 1830 1833 1836 1839 1842 1845 Columns 616 through 630 1848 1851 1854 1857 1860 1863 1866 1869 1872 1875 1878 1881 1884 1887 1890 Columns 631 through 645 1893 1896 1899 1902 1905 1908 1911 1914 1917 1920 1923 1926 1929 1932 1935 Columns 646 through 660 1938 1941 1944 1947 1950 1953 1956 1959 1962 1965 1968 1971 1974 1977 1980 Columns 661 through 675 1983 1986 1989 1992 1995 1998 2001 2004 2007 2010 2013 2016 2019 2022 2025 Columns 676 through 690 2028 2031 2034 2037 2040 2043 2046 2049 2052 2055 2058 2061 2064 2067 2070 Columns 691 through 705 2073 2076 2079 2082 2085 2088 2091 2094 2097 2100 2103 2106 2109 2112 2115 Columns 706 through 720 2118 2121 2...

4   Pass
x = 2341; y_correct = 1278810; assert(isequal(euler001(x),y_correct))

s = 2341 t = 2341 fivemax = 468 threemax = 780 threes = Columns 1 through 15 3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 Columns 16 through 30 48 51 54 57 60 63 66 69 72 75 78 81 84 87 90 Columns 31 through 45 93 96 99 102 105 108 111 114 117 120 123 126 129 132 135 Columns 46 through 60 138 141 144 147 150 153 156 159 162 165 168 171 174 177 180 Columns 61 through 75 183 186 189 192 195 198 201 204 207 210 213 216 219 222 225 Columns 76 through 90 228 231 234 237 240 243 246 249 252 255 258 261 264 267 270 Columns 91 through 105 273 276 279 282 285 288 291 294 297 300 303 306 309 312 315 Columns 106 through 120 318 321 324 327 330 333 336 339 342 345 348 351 354 357 360 Columns 121 through 135 363 366 369 372 375 378 381 384 387 390 393 396 399 402 405 Columns 136 through 150 408 411 414 417 420 423 426 429 432 435 438 441 444 447 450 Columns 151 through 165 453 456 459 462 465 468 471 474 477 480 483 486 489 492 495 Columns 166 through 180 498 501 504 507 510 513 516 519 522 525 528 531 534 537 540 Columns 181 through 195 543 546 549 552 555 558 561 564 567 570 573 576 579 582 585 Columns 196 through 210 588 591 594 597 600 603 606 609 612 615 618 621 624 627 630 Columns 211 through 225 633 636 639 642 645 648 651 654 657 660 663 666 669 672 675 Columns 226 through 240 678 681 684 687 690 693 696 699 702 705 708 711 714 717 720 Columns 241 through 255 723 726 729 732 735 738 741 744 747 750 753 756 759 762 765 Columns 256 through 270 768 771 774 777 780 783 786 789 792 795 798 801 804 807 810 Columns 271 through 285 813 816 819 822 825 828 831 834 837 840 843 846 849 852 855 Columns 286 through 300 858 861 864 867 870 873 876 879 882 885 888 891 894 897 900 Columns 301 through 315 903 906 909 912 915 918 921 924 927 930 933 936 939 942 945 Columns 316 through 330 948 951 954 957 960 963 966 969 972 975 978 981 984 987 990 Columns 331 through 345 993 996 999 1002 1005 1008 1011 1014 1017 1020 1023 1026 1029 1032 1035 Columns 346 through 360 1038 1041 1044 1047 1050 1053 1056 1059 1062 1065 1068 1071 1074 1077 1080 Columns 361 through 375 1083 1086 1089 1092 1095 1098 1101 1104 1107 1110 1113 1116 1119 1122 1125 Columns 376 through 390 1128 1131 1134 1137 1140 1143 1146 1149 1152 1155 1158 1161 1164 1167 1170 Columns 391 through 405 1173 1176 1179 1182 1185 1188 1191 1194 1197 1200 1203 1206 1209 1212 1215 Columns 406 through 420 1218 1221 1224 1227 1230 1233 1236 1239 1242 1245 1248 1251 1254 1257 1260 Columns 421 through 435 1263 1266 1269 1272 1275 1278 1281 1284 1287 1290 1293 1296 1299 1302 1305 Columns 436 through 450 1308 1311 1314 1317 1320 1323 1326 1329 1332 1335 1338 1341 1344 1347 1350 Columns 451 through 465 1353 1356 1359 1362 1365 1368 1371 1374 1377 1380 1383 1386 1389 1392 1395 Columns 466 through 480 1398 1401 1404 1407 1410 1413 1416 1419 1422 1425 1428 1431 1434 1437 1440 Columns 481 through 495 1443 1446 1449 1452 1455 1458 1461 1464 1467 1470 1473 1476 1479 1482 1485 Columns 496 through 510 1488 1491 1494 1497 1500 1503 1506 1509 1512 1515 1518 1521 1524 1527 1530 Columns 511 through 525 1533 1536 1539 1542 1545 1548 1551 1554 1557 1560 1563 1566 1569 1572 1575 Columns 526 through 540 1578 1581 1584 1587 1590 1593 1596 1599 1602 1605 1608 1611 1614 1617 1620 Columns 541 through 555 1623 1626 1629 1632 1635 1638 1641 1644 1647 1650 1653 1656 1659 1662 1665 Columns 556 through 570 1668 1671 1674 1677 1680 1683 1686 1689 1692 1695 1698 1701 1704 1707 1710 Columns 571 through 585 1713 1716 1719 1722 1725 1728 1731 1734 1737 1740 1743 1746 1749 1752 1755 Columns 586 through 600 1758 1761 1764 1767 1770 1773 1776 1779 1782 1785 1788 1791 1794 1797 1800 Columns 601 through 615 1803 1806 1809 1812 1815 1818 1821 1824 1827 1830 1833 1836 1839 1842 1845 Columns 616 through 630 1848 1851 1854 1857 1860 1863 1866 1869 1872 1875 1878 1881 1884 1887 1890 Columns 631 through 645 1893 1896 1899 1902 1905 1908 1911 1914 1917 1920 1923 1926 1929 1932 1935 Columns 646 through 660 1938 1941 1944 1947 1950 1953 1956 1959 1962 1965 1968 1971 1974 1977 1980 Columns 661 through 675 1983 1986 1989 1992 1995 1998 2001 2004 2007 2010 2013 2016 2019 2022 2025 Columns 676 through 690 2028 2031 2034 2037 2040 2043 2046 2049 2052 2055 2058 2061 2064 2067 2070 Columns 691 through 705 2073 2076 2079 2082 2085 2088 2091 2094 2097 2100 2103 2106 2109 2112 2115 Columns 706 through 720 2118 2121 2124 2127 2130 2133 ...