Cody

Solution 1390671

Submitted on 22 Dec 2017 by Brendan Gray
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
base=4;nstart=2;nend=6;y_correct=62; assert(isequal(sum_distinct_powers(base,nstart,nend),y_correct))

ans = 1 4 5 16 17 20

2   Pass
base=5;nstart=1;nend=1000;y_correct=1193853250; assert(isequal(sum_distinct_powers(base,nstart,nend),y_correct))

ans = Columns 1 through 14 1 5 6 25 26 30 31 125 126 130 131 150 151 155 Columns 15 through 28 156 625 626 630 631 650 651 655 656 750 751 755 756 775 Columns 29 through 42 776 780 781 3125 3126 3130 3131 3150 3151 3155 3156 3250 3251 3255 Columns 43 through 56 3256 3275 3276 3280 3281 3750 3751 3755 3756 3775 3776 3780 3781 3875 Columns 57 through 70 3876 3880 3881 3900 3901 3905 3906 15625 15626 15630 15631 15650 15651 15655 Columns 71 through 84 15656 15750 15751 15755 15756 15775 15776 15780 15781 16250 16251 16255 16256 16275 Columns 85 through 98 16276 16280 16281 16375 16376 16380 16381 16400 16401 16405 16406 18750 18751 18755 Columns 99 through 112 18756 18775 18776 18780 18781 18875 18876 18880 18881 18900 18901 18905 18906 19375 Columns 113 through 126 19376 19380 19381 19400 19401 19405 19406 19500 19501 19505 19506 19525 19526 19530 Columns 127 through 140 19531 78125 78126 78130 78131 78150 78151 78155 78156 78250 78251 78255 78256 78275 Columns 141 through 154 78276 78280 78281 78750 78751 78755 78756 78775 78776 78780 78781 78875 78876 78880 Columns 155 through 168 78881 78900 78901 78905 78906 81250 81251 81255 81256 81275 81276 81280 81281 81375 Columns 169 through 182 81376 81380 81381 81400 81401 81405 81406 81875 81876 81880 81881 81900 81901 81905 Columns 183 through 196 81906 82000 82001 82005 82006 82025 82026 82030 82031 93750 93751 93755 93756 93775 Columns 197 through 210 93776 93780 93781 93875 93876 93880 93881 93900 93901 93905 93906 94375 94376 94380 Columns 211 through 224 94381 94400 94401 94405 94406 94500 94501 94505 94506 94525 94526 94530 94531 96875 Columns 225 through 238 96876 96880 96881 96900 96901 96905 96906 97000 97001 97005 97006 97025 97026 97030 Columns 239 through 252 97031 97500 97501 97505 97506 97525 97526 97530 97531 97625 97626 97630 97631 97650 Columns 253 through 266 97651 97655 97656 390625 390626 390630 390631 390650 390651 390655 390656 390750 390751 390755 Columns 267 through 280 390756 390775 390776 390780 390781 391250 391251 391255 391256 391275 391276 391280 391281 391375 Columns 281 through 294 391376 391380 391381 391400 391401 391405 391406 393750 393751 393755 393756 393775 393776 393780 Columns 295 through 308 393781 393875 393876 393880 393881 393900 393901 393905 393906 394375 394376 394380 394381 394400 Columns 309 through 322 394401 394405 394406 394500 394501 394505 394506 394525 394526 394530 394531 406250 406251 406255 Columns 323 through 336 406256 406275 406276 406280 406281 406375 406376 406380 406381 406400 406401 406405 406406 406875 Columns 337 through 350 406876 406880 406881 406900 406901 406905 406906 407000 407001 407005 407006 407025 407026 407030 Columns 351 through 364 407031 409375 409376 409380 409381 409400 409401 409405 409406 409500 409501 409505 409506 409525 Columns 365 through 378 409526 409530 409531 410000 410001 410005 410006 410025 410026 410030 410031 410125 410126 410130 Columns 379 through 392 410131 410150 410151 410155 410156 468750 468751 468755 468756 468775 468776 468780 468781 468875 Columns 393 through 406 468876 468880 468881 468900 468901 468905 468906 469375 469376 469380 469381 469400 469401 469405 Columns 407 through 420 469406 469500 469501 469505 469506 469525 469526 469530 469531 471875 471876 471880 471881 471900 Columns 421 through 434 471901 471905 471906 472000 472001 472005 472006 472025 472026 472030 472031 472500 472501 472505 Columns 435 through 448 472506 472525 472526 472530 472531 472625 472626 472630 472631 472650 472651 472655 472656 484375 Columns 449 through 462 484376 484380 484381 484400 484401 484405 484406 484500 484501 484505 484506 484525 484526 484530 Columns 463 through 476 484531 485000 485001 485005 485006 485025 485026 485030 485031 485125 485126 485130 485131 485150 Columns 477 through 490 485151 485155 485156 487500 487501 487505 487506 487525 487526 487530 487531 487625 487626 487630 Columns 491 through 504 487631 487650 487651 487655 487656 488125 488126 488130 488131 488150 488151 488155 488156 488250 Columns 505 through 518 488251 488255 488256 488275 488276 488280 488281 1953125 1953126 1953130 1953131 1953150 1953151 1953155 Columns 519 through 532 1953156 1953250 1953251 1953255 1953256 1953275 1953276 1953280 1953281 1953750 1953751 1953755 1953756 1953775 Columns 533 through 546 1953776 1953780 1953781 1953875 1953876 1953880 1953881 1953900 1953901 1953905 1953906 1956250 1956251 1956255 Columns 547 through 560 1956256 1956275 1956276 1956280 1956281 1956375 1956376 1956380 1956381 1956400 1956401 1956405 1956406 1956875 Columns 561 through 574 1956876 1956880 1956881 1956900 1956901 1956905 1956906 1957000 1957001 1957005 1957006 1957025 1957026 1957030 Columns 575 through 588 1957031 1968750 1968751 1968755 1968756 1968775 1968776 1968780 1968781 1968875 1968876 1968880 1968881 1968900 Columns 589 through 602 1968901 1968905 1968906 1969375 1969376 1969380 1969381 1969400 1969401 1969405 1969406 1969500 1969501 1969505 Columns 603 through 616 1969506 1969525 1969526 1969530 1969531 1971875 1971876 1971880 1971881 1971900 1971901 1971905 1971906 1972000 Columns 617 through 630 1972001 1972005 1972006 1972025 1972026 1972030 1972031 1972500 1972501 1972505 1972506 1972525 1972526 1972530 Columns 631 through 644 1972531 1972625 1972626 1972630 1972631 1972650 1972651 1972655 1972656 2031250 2031251 2031255 2031256 2031275 Columns 645 through 658 2031276 2031280 2031281 2031375 2031376 2031380 2031381 2031400 2031401 2031405 2031406 2031875 2031876 2031880 Columns 659 through 672 2031881 2031900 2031901 2031905 2031906 2032000 2032001 2032005 2032006 2032025 2032026 2032030 2032031 2034375 Columns 673 through 686 2034376 2034380 2034381 2034400 2034401 2034405 2034406 2034500 2034501 2034505 2034506 2034525 2034526 2034530 Columns 687 through 700 2034531 2035000 2035001 2035005 2035006 2035025 2035026 2035030 2035031 2035125 2035126 2035130 2035131 2035150 Columns 701 through 714 2035151 2035155 2035156 2046875 2046876 2046880 2046881 2046900 2046901 2046905 2046906...

3   Pass
base=3;nstart=1;nend=1000;y_correct=14438162; assert(isequal(sum_distinct_powers(base,nstart,nend),y_correct))

ans = Columns 1 through 14 1 3 4 9 10 12 13 27 28 30 31 36 37 39 Columns 15 through 28 40 81 82 84 85 90 91 93 94 108 109 111 112 117 Columns 29 through 42 118 120 121 243 244 246 247 252 253 255 256 270 271 273 Columns 43 through 56 274 279 280 282 283 324 325 327 328 333 334 336 337 351 Columns 57 through 70 352 354 355 360 361 363 364 729 730 732 733 738 739 741 Columns 71 through 84 742 756 757 759 760 765 766 768 769 810 811 813 814 819 Columns 85 through 98 820 822 823 837 838 840 841 846 847 849 850 972 973 975 Columns 99 through 112 976 981 982 984 985 999 1000 1002 1003 1008 1009 1011 1012 1053 Columns 113 through 126 1054 1056 1057 1062 1063 1065 1066 1080 1081 1083 1084 1089 1090 1092 Columns 127 through 140 1093 2187 2188 2190 2191 2196 2197 2199 2200 2214 2215 2217 2218 2223 Columns 141 through 154 2224 2226 2227 2268 2269 2271 2272 2277 2278 2280 2281 2295 2296 2298 Columns 155 through 168 2299 2304 2305 2307 2308 2430 2431 2433 2434 2439 2440 2442 2443 2457 Columns 169 through 182 2458 2460 2461 2466 2467 2469 2470 2511 2512 2514 2515 2520 2521 2523 Columns 183 through 196 2524 2538 2539 2541 2542 2547 2548 2550 2551 2916 2917 2919 2920 2925 Columns 197 through 210 2926 2928 2929 2943 2944 2946 2947 2952 2953 2955 2956 2997 2998 3000 Columns 211 through 224 3001 3006 3007 3009 3010 3024 3025 3027 3028 3033 3034 3036 3037 3159 Columns 225 through 238 3160 3162 3163 3168 3169 3171 3172 3186 3187 3189 3190 3195 3196 3198 Columns 239 through 252 3199 3240 3241 3243 3244 3249 3250 3252 3253 3267 3268 3270 3271 3276 Columns 253 through 266 3277 3279 3280 6561 6562 6564 6565 6570 6571 6573 6574 6588 6589 6591 Columns 267 through 280 6592 6597 6598 6600 6601 6642 6643 6645 6646 6651 6652 6654 6655 6669 Columns 281 through 294 6670 6672 6673 6678 6679 6681 6682 6804 6805 6807 6808 6813 6814 6816 Columns 295 through 308 6817 6831 6832 6834 6835 6840 6841 6843 6844 6885 6886 6888 6889 6894 Columns 309 through 322 6895 6897 6898 6912 6913 6915 6916 6921 6922 6924 6925 7290 7291 7293 Columns 323 through 336 7294 7299 7300 7302 7303 7317 7318 7320 7321 7326 7327 7329 7330 7371 Columns 337 through 350 7372 7374 7375 7380 7381 7383 7384 7398 7399 7401 7402 7407 7408 7410 Columns 351 through 364 7411 7533 7534 7536 7537 7542 7543 7545 7546 7560 7561 7563 7564 7569 Columns 365 through 378 7570 7572 7573 7614 7615 7617 7618 7623 7624 7626 7627 7641 7642 7644 Columns 379 through 392 7645 7650 7651 7653 7654 8748 8749 8751 8752 8757 8758 8760 8761 8775 Columns 393 through 406 8776 8778 8779 8784 8785 8787 8788 8829 8830 8832 8833 8838 8839 8841 Columns 407 through 420 8842 8856 8857 8859 8860 8865 8866 8868 8869 8991 8992 8994 8995 9000 Columns 421 through 434 9001 9003 9004 9018 9019 9021 9022 9027 9028 9030 9031 9072 9073 9075 Columns 435 through 448 9076 9081 9082 9084 9085 9099 9100 9102 9103 9108 9109 9111 9112 9477 Columns 449 through 462 9478 9480 9481 9486 9487 9489 9490 9504 9505 9507 9508 9513 9514 9516 Columns 463 through 476 9517 9558 9559 9561 9562 9567 9568 9570 9571 9585 9586 9588 9589 9594 Columns 477 through 490 9595 9597 9598 9720 9721 9723 9724 9729 9730 9732 9733 9747 9748 9750 Columns 491 through 504 9751 9756 9757 9759 9760 9801 9802 9804 9805 9810 9811 9813 9814 9828 Columns 505 through 518 9829 9831 9832 9837 9838 9840 9841 19683 19684 19686 19687 19692 19693 19695 Columns 519 through 532 19696 19710 19711 19713 19714 19719 19720 19722 19723 19764 19765 19767 19768 19773 Columns 533 through 546 19774 19776 19777 19791 19792 19794 19795 19800 19801 19803 19804 19926 19927 19929 Columns 547 through 560 19930 19935 19936 19938 19939 19953 19954 19956 19957 19962 19963 19965 19966 20007 Columns 561 through 574 20008 20010 20011 20016 20017 20019 20020 20034 20035 20037 20038 20043 20044 20046 Columns 575 through 588 20047 20412 20413 20415 20416 20421 20422 20424 20425 20439 20440 20442 20443 20448 Columns 589 through 602 20449 20451 20452 20493 20494 20496 20497 20502 20503 20505 20506 20520 20521 20523 Columns 603 through 616 20524 20529 20530 20532 20533 20655 20656 20658 20659 20664 20665 20667 20668 20682 Columns 617 through 630 20683 20685 20686 20691 20692 20694 20695 20736 20737 20739 20740 20745 20746 20748 Columns 631 through 644 20749 20763 20764 20766 20767 20772 20773 20775 20776 21870 21871 21873 21874 21879 Columns 645 through 658 21880 21882 21883 21897 21898 21900 21901 21906 21907 21909 21910 21951 21952 21954 Columns 659 through 672 21955 21960 21961 21963 21964 21978 21979 21981 21982 21987 21988 21990 21991 22113 Columns 673 through 686 22114 22116 22117 22122 22123 22125 22126 22140 22141 22143 22144 22149 22150 22152 Columns 687 through 700 22153 22194 22195 22197 22198 22203 22204 22206 22207 22221 22222 22224 22225 22230 Columns 701 through 714 22231 22233 22234 22599 22600 22602 22603 22608 22609 22611 22612...

4   Pass
base=3;nstart=100;nend=1000;y_correct=14397354; assert(isequal(sum_distinct_powers(base,nstart,nend),y_correct))

ans = Columns 1 through 14 1 3 4 9 10 12 13 27 28 30 31 36 37 39 Columns 15 through 28 40 81 82 84 85 90 91 93 94 108 109 111 112 117 Columns 29 through 42 118 120 121 243 244 246 247 252 253 255 256 270 271 273 Columns 43 through 56 274 279 280 282 283 324 325 327 328 333 334 336 337 351 Columns 57 through 70 352 354 355 360 361 363 364 729 730 732 733 738 739 741 Columns 71 through 84 742 756 757 759 760 765 766 768 769 810 811 813 814 819 Columns 85 through 98 820 822 823 837 838 840 841 846 847 849 850 972 973 975 Columns 99 through 112 976 981 982 984 985 999 1000 1002 1003 1008 1009 1011 1012 1053 Columns 113 through 126 1054 1056 1057 1062 1063 1065 1066 1080 1081 1083 1084 1089 1090 1092 Columns 127 through 140 1093 2187 2188 2190 2191 2196 2197 2199 2200 2214 2215 2217 2218 2223 Columns 141 through 154 2224 2226 2227 2268 2269 2271 2272 2277 2278 2280 2281 2295 2296 2298 Columns 155 through 168 2299 2304 2305 2307 2308 2430 2431 2433 2434 2439 2440 2442 2443 2457 Columns 169 through 182 2458 2460 2461 2466 2467 2469 2470 2511 2512 2514 2515 2520 2521 2523 Columns 183 through 196 2524 2538 2539 2541 2542 2547 2548 2550 2551 2916 2917 2919 2920 2925 Columns 197 through 210 2926 2928 2929 2943 2944 2946 2947 2952 2953 2955 2956 2997 2998 3000 Columns 211 through 224 3001 3006 3007 3009 3010 3024 3025 3027 3028 3033 3034 3036 3037 3159 Columns 225 through 238 3160 3162 3163 3168 3169 3171 3172 3186 3187 3189 3190 3195 3196 3198 Columns 239 through 252 3199 3240 3241 3243 3244 3249 3250 3252 3253 3267 3268 3270 3271 3276 Columns 253 through 266 3277 3279 3280 6561 6562 6564 6565 6570 6571 6573 6574 6588 6589 6591 Columns 267 through 280 6592 6597 6598 6600 6601 6642 6643 6645 6646 6651 6652 6654 6655 6669 Columns 281 through 294 6670 6672 6673 6678 6679 6681 6682 6804 6805 6807 6808 6813 6814 6816 Columns 295 through 308 6817 6831 6832 6834 6835 6840 6841 6843 6844 6885 6886 6888 6889 6894 Columns 309 through 322 6895 6897 6898 6912 6913 6915 6916 6921 6922 6924 6925 7290 7291 7293 Columns 323 through 336 7294 7299 7300 7302 7303 7317 7318 7320 7321 7326 7327 7329 7330 7371 Columns 337 through 350 7372 7374 7375 7380 7381 7383 7384 7398 7399 7401 7402 7407 7408 7410 Columns 351 through 364 7411 7533 7534 7536 7537 7542 7543 7545 7546 7560 7561 7563 7564 7569 Columns 365 through 378 7570 7572 7573 7614 7615 7617 7618 7623 7624 7626 7627 7641 7642 7644 Columns 379 through 392 7645 7650 7651 7653 7654 8748 8749 8751 8752 8757 8758 8760 8761 8775 Columns 393 through 406 8776 8778 8779 8784 8785 8787 8788 8829 8830 8832 8833 8838 8839 8841 Columns 407 through 420 8842 8856 8857 8859 8860 8865 8866 8868 8869 8991 8992 8994 8995 9000 Columns 421 through 434 9001 9003 9004 9018 9019 9021 9022 9027 9028 9030 9031 9072 9073 9075 Columns 435 through 448 9076 9081 9082 9084 9085 9099 9100 9102 9103 9108 9109 9111 9112 9477 Columns 449 through 462 9478 9480 9481 9486 9487 9489 9490 9504 9505 9507 9508 9513 9514 9516 Columns 463 through 476 9517 9558 9559 9561 9562 9567 9568 9570 9571 9585 9586 9588 9589 9594 Columns 477 through 490 9595 9597 9598 9720 9721 9723 9724 9729 9730 9732 9733 9747 9748 9750 Columns 491 through 504 9751 9756 9757 9759 9760 9801 9802 9804 9805 9810 9811 9813 9814 9828 Columns 505 through 518 9829 9831 9832 9837 9838 9840 9841 19683 19684 19686 19687 19692 19693 19695 Columns 519 through 532 19696 19710 19711 19713 19714 19719 19720 19722 19723 19764 19765 19767 19768 19773 Columns 533 through 546 19774 19776 19777 19791 19792 19794 19795 19800 19801 19803 19804 19926 19927 19929 Columns 547 through 560 19930 19935 19936 19938 19939 19953 19954 19956 19957 19962 19963 19965 19966 20007 Columns 561 through 574 20008 20010 20011 20016 20017 20019 20020 20034 20035 20037 20038 20043 20044 20046 Columns 575 through 588 20047 20412 20413 20415 20416 20421 20422 20424 20425 20439 20440 20442 20443 20448 Columns 589 through 602 20449 20451 20452 20493 20494 20496 20497 20502 20503 20505 20506 20520 20521 20523 Columns 603 through 616 20524 20529 20530 20532 20533 20655 20656 20658 20659 20664 20665 20667 20668 20682 Columns 617 through 630 20683 20685 20686 20691 20692 20694 20695 20736 20737 20739 20740 20745 20746 20748 Columns 631 through 644 20749 20763 20764 20766 20767 20772 20773 20775 20776 21870 21871 21873 21874 21879 Columns 645 through 658 21880 21882 21883 21897 21898 21900 21901 21906 21907 21909 21910 21951 21952 21954 Columns 659 through 672 21955 21960 21961 21963 21964 21978 21979 21981 21982 21987 21988 21990 21991 22113 Columns 673 through 686 22114 22116 22117 22122 22123 22125 22126 22140 22141 22143 22144 22149 22150 22152 Columns 687 through 700 22153 22194 22195 22197 22198 22203 22204 22206 22207 22221 22222 22224 22225 22230 Columns 701 through 714 22231 22233 22234 22599 22600 22602 22603 22608 22609 22611 22612...

5   Pass
base=2;nstart=1;nend=2017;y_correct=2035153; assert(isequal(sum_distinct_powers(base,nstart,nend),y_correct))

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

6   Pass
base=7;nstart=1234;nend=2345;y_correct=843569026324; assert(isequal(sum_distinct_powers(base,nstart,nend),y_correct))

ans = 1.0e+09 * Columns 1 through 17 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 Columns 18 through 34 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 Columns 35 through 51 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 Columns 52 through 68 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0001 0.0001 0.0001 0.0001 0.0001 Columns 69 through 85 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 Columns 86 through 102 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 Columns 103 through 119 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 Columns 120 through 136 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 Columns 137 through 153 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 Columns 154 through 170 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 Columns 171 through 187 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 Columns 188 through 204 0.0008 0.0008 0.0008 0.0008 0.0009 0.0009 0.0009 0.0009 0.0009 0.0009 0.0009 0.0009 0.0009 0.0009 0.0009 0.0009 0.0009 Columns 205 through 221 0.0009 0.0009 0.0009 0.0009 0.0009 0.0009 0.0009 0.0009 0.0009 0.0009 0.0009 0.0009 0.0009 0.0009 0.0009 0.0009 0.0009 Columns 222 through 238 0.0009 0.0009 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 Columns 239 through 255 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 Columns 256 through 272 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 Columns 273 through 289 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 Columns 290 through 306 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 Columns 307 through 323 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0058 0.0059 0.0059 0.0059 0.0059 Columns 324 through 340 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 Columns 341 through 357 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 Columns 358 through 374 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 Columns 375 through 391 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0059 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 Columns 392 through 408 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 Columns 409 through 425 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 Columns 426 through 442 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 0.0066 Columns 443 through 459 0.0066 0.0066 0.0066 0.0066 0.0066 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 Columns 460 through 476 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 Columns 477 through 493 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 Columns 494 through 510 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 0.0067 Columns 511 through 527 0.0067 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 Columns 528 through 544 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 Columns 545 through 561 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 Columns 562 through 578 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0404 0.0405 0.0405 0.0405 Columns 579 through 595 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 Columns 596 through 612 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 Columns 613 through 629 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 Columns 630 through 646 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0405 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 Columns 647 through 663 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 Columns 664 through 680 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 Columns 681 through 697 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 Columns 698 through 714 0.0412 0.0412 0.0412 0.0412 0.0412 0.0412 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 Columns 715 through 731 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 Columns 732 through 748 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 Columns 749 through 765 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 0.0413 Columns 766 through 782 0.0413 0.0413 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 Columns 783 through 799 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 Columns 800 through 816 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 Columns 817 through 833 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0461 0.0462 0.0462 Columns 834 through 850 0.0462 0.0462 0.0462 0.0462 0.0462 0.0462 0.0462 0.0462 0.0462 0.0462 0.0462 0.0462 0.0462 0.0462 0.0462 0.0462 0.0462 Columns 851 through 867 0.0462 ...

7   Pass
base=7;nstart=1;nend=10;y_correct=1265; assert(isequal(sum_distinct_powers(base,nstart,nend),y_correct))

ans = 1 7 8 49 50 56 57 343 344 350

8   Pass
nstart=1;nend=50; junk=arrayfun(@(base) sum_distinct_powers(base,nstart,nend),2:10); y_correct=[1275 7120 26365 75000 178591 374560 714465 1266280 2116675]; assert(isequal(junk,y_correct))

ans = Columns 1 through 29 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 Columns 30 through 50 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 ans = Columns 1 through 29 1 3 4 9 10 12 13 27 28 30 31 36 37 39 40 81 82 84 85 90 91 93 94 108 109 111 112 117 118 Columns 30 through 50 120 121 243 244 246 247 252 253 255 256 270 271 273 274 279 280 282 283 324 325 327 ans = Columns 1 through 14 1 4 5 16 17 20 21 64 65 68 69 80 81 84 Columns 15 through 28 85 256 257 260 261 272 273 276 277 320 321 324 325 336 Columns 29 through 42 337 340 341 1024 1025 1028 1029 1040 1041 1044 1045 1088 1089 1092 Columns 43 through 50 1093 1104 1105 1108 1109 1280 1281 1284 ans = Columns 1 through 14 1 5 6 25 26 30 31 125 126 130 131 150 151 155 Columns 15 through 28 156 625 626 630 631 650 651 655 656 750 751 755 756 775 Columns 29 through 42 776 780 781 3125 3126 3130 3131 3150 3151 3155 3156 3250 3251 3255 Columns 43 through 50 3256 3275 3276 3280 3281 3750 3751 3755 ans = Columns 1 through 14 1 6 7 36 37 42 43 216 217 222 223 252 253 258 Columns 15 through 28 259 1296 1297 1302 1303 1332 1333 1338 1339 1512 1513 1518 1519 1548 Columns 29 through 42 1549 1554 1555 7776 7777 7782 7783 7812 7813 7818 7819 7992 7993 7998 Columns 43 through 50 7999 8028 8029 8034 8035 9072 9073 9078 ans = Columns 1 through 14 1 7 8 49 50 56 57 343 344 350 351 392 393 399 Columns 15 through 28 400 2401 2402 2408 2409 2450 2451 2457 2458 2744 2745 2751 2752 2793 Columns 29 through 42 2794 2800 2801 16807 16808 16814 16815 16856 16857 16863 16864 17150 17151 17157 Columns 43 through 50 17158 17199 17200 17206 17207 19208 19209 19215 ans = Columns 1 through 14 1 8 9 64 65 72 73 512 513 520 521 576 577 584 Columns 15 through 28 585 4096 4097 4104 4105 4160 4161 4168 4169 4608 4609 4616 4617 4672 Columns 29 through 42 4673 4680 4681 32768 32769 32776 32777 32832 32833 32840 32841 33280 33281 33288 Columns 43 through 50 33289 33344 33345 33352 33353 36864 36865 36872 ans = Columns 1 through 14 1 9 10 81 82 90 91 729 730 738 739 810 811 819 Columns 15 through 28 820 6561 6562 6570 6571 6642 6643 6651 6652 7290 7291 7299 7300 7371 Columns 29 through 42 7372 7380 7381 59049 59050 59058 59059 59130 59131 59139 59140 59778 59779 59787 Columns 43 through 50 59788 59859 59860 59868 59869 65610 65611 65619 ans = Columns 1 through 14 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 Columns 15 through 28 1111 10000 10001 10010 10011 10100 10101 10110 10111 11000 11001 11010 11011 11100 Columns 29 through 42 11101 11110 11111 100000 100001 100010 100011 100100 100101 100110 100111 101000 101001 101010 Columns 43 through 50 101011 101100 101101 101110 101111 110000 110001 110010