Cody

Solution 2230248

Submitted on 23 Apr 2020 by Yaroslav Br
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
filetext = fileread('divisible_by_3.m'); assert(isempty(strfind(filetext, '*')),'* forbidden') assert(isempty(strfind(filetext, 'mtimes')),'mtimes() forbidden') assert(isempty(strfind(filetext, 'cross')),'cross() forbidden') assert(isempty(strfind(filetext, 'prod')),'prod() forbidden') assert(isempty(strfind(filetext, 'cumprod')),'cumprod() forbidden') assert(isempty(strfind(filetext, 'times')),'times() forbidden') assert(isempty(strfind(filetext, 'mldivide')),'mldivide() forbidden') assert(isempty(strfind(filetext, 'mrdivide')),'mrdivide() forbidden') assert(isempty(strfind(filetext, '/')),'/ forbidden') assert(isempty(strfind(filetext, '\')),'\ forbidden') assert(isempty(strfind(filetext, '^')),'^ forbidden') assert(isempty(strfind(filetext, 'dot')),'dot() forbidden') assert(isempty(strfind(filetext, 'rem')),'rem() forbidden') assert(isempty(strfind(filetext, 'mod')),'mod() forbidden') assert(isempty(strfind(filetext, 'round')),'round() forbidden') assert(isempty(strfind(filetext, 'ceil')),'ceil() forbidden') assert(isempty(strfind(filetext, 'floor')),'floor() forbidden') assert(isempty(strfind(filetext, 'java')),'java forbidden')

2   Pass
n_str = '12'; assert(isequal(divisible_by_3(n_str),1))

nn = 1 nn = 3 n = '3' tf = logical 1

3   Pass
n_str = '13'; assert(isequal(divisible_by_3(n_str),0))

nn = 1 nn = 4 n = '4' tf = logical 0

4   Pass
n_str = '222'; assert(isequal(divisible_by_3(n_str),1))

nn = 2 nn = 4 nn = 6 n = '6' tf = logical 1

5   Pass
n_str = '232'; assert(isequal(divisible_by_3(n_str),0))

nn = 2 nn = 5 nn = 7 n = '7' tf = logical 0

6   Pass
n_str = '223'; assert(isequal(divisible_by_3(n_str),0))

nn = 2 nn = 4 nn = 7 n = '7' tf = logical 0

7   Pass
n_str = '1236127'; assert(isequal(divisible_by_3(n_str),0))

nn = 1 nn = 3 nn = 6 nn = 12 nn = 13 nn = 15 nn = 22 n = '22' nn = 2 nn = 4 n = '4' tf = logical 0

8   Pass
n_str = '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; assert(isequal(divisible_by_3(n_str),1))

nn = 1 nn = 3 nn = 6 nn = 10 nn = 15 nn = 21 nn = 28 nn = 36 nn = 45 nn = 45 nn = 46 nn = 48 nn = 51 nn = 55 nn = 60 nn = 66 nn = 73 nn = 81 nn = 90 nn = 90 nn = 91 nn = 93 nn = 96 nn = 100 nn = 105 nn = 111 nn = 118 nn = 126 nn = 135 nn = 135 nn = 136 nn = 138 nn = 141 nn = 145 nn = 150 nn = 156 nn = 163 nn = 171 nn = 180 nn = 180 nn = 181 nn = 183 nn = 186 nn = 190 nn = 195 nn = 201 nn = 208 nn = 216 nn = 225 nn = 225 nn = 226 nn = 228 nn = 231 nn = 235 nn = 240 nn = 246 nn = 253 nn = 261 nn = 270 nn = 270 nn = 271 nn = 273 nn = 276 nn = 280 nn = 285 nn = 291 nn = 298 nn = 306 nn = 315 nn = 315 nn = 316 nn = 318 nn = 321 nn = 325 nn = 330 nn = 336 nn = 343 nn = 351 nn = 360 nn = 360 nn = 361 nn = 363 nn = 366 nn = 370 nn = 375 nn = 381 nn = 388 nn = 396 nn = 405 nn = 405 nn = 406 nn = 408 nn = 411 nn = 415 nn = 420 nn = 426 nn = 433 nn = 441 nn = 450 nn = 450 nn = 451 nn = 453 nn = 456 nn = 460 nn = 465 nn = 471 nn = 478 nn = 486 nn = 495 nn = 495 nn = 496 nn = 498 nn = 501 nn = 505 nn = 510 nn = 516 nn = 523 nn = 531 nn = 540 nn = 540 nn = 541 nn = 543 nn = 546 nn = 550 nn = 555 nn = 561 nn = 568 nn = 576 nn = 585 nn = 585 nn = 586 nn = 588 nn = 591 nn = 595 nn = 600 nn = 606 nn = 613 nn = 621 nn = 630 nn = 630 nn = 631 nn = 633 nn = 636 nn = 640 nn = 645 nn = 651 nn = 658 nn = 666 nn = 675 nn = 675 nn = 676 nn = 678 nn = 681 nn = 685 nn = 690 nn = 696 nn = 703 nn = 711 nn = 720 nn = 720 nn = 721 nn = 723 nn = 726 nn = 730 nn = 735 nn = 741 nn = 748 nn = 756 nn = 765 nn = 765 nn = 766 nn = 768 nn = 771 nn = 775 nn = 780 nn = 786 nn = 793 nn = 801 nn = 810 nn = 810 n = '810' nn = 8 nn = 9 nn = 9 n = '9' tf = logical 1

9   Pass
n_str = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901'; assert(isequal(divisible_by_3(n_str),0))

nn = 1 nn = 3 nn = 6 nn = 10 nn = 15 nn = 21 nn = 28 nn = 36 nn = 45 nn = 45 nn = 46 nn = 48 nn = 51 nn = 55 nn = 60 nn = 66 nn = 73 nn = 81 nn = 90 nn = 90 nn = 91 nn = 93 nn = 96 nn = 100 nn = 105 nn = 111 nn = 118 nn = 126 nn = 135 nn = 135 nn = 136 nn = 138 nn = 141 nn = 145 nn = 150 nn = 156 nn = 163 nn = 171 nn = 180 nn = 180 nn = 181 nn = 183 nn = 186 nn = 190 nn = 195 nn = 201 nn = 208 nn = 216 nn = 225 nn = 225 nn = 226 nn = 228 nn = 231 nn = 235 nn = 240 nn = 246 nn = 253 nn = 261 nn = 270 nn = 270 nn = 271 nn = 273 nn = 276 nn = 280 nn = 285 nn = 291 nn = 298 nn = 306 nn = 315 nn = 315 nn = 316 nn = 318 nn = 321 nn = 325 nn = 330 nn = 336 nn = 343 nn = 351 nn = 360 nn = 360 nn = 361 nn = 363 nn = 366 nn = 370 nn = 375 nn = 381 nn = 388 nn = 396 nn = 405 nn = 405 nn = 406 nn = 408 nn = 411 nn = 415 nn = 420 nn = 426 nn = 433 nn = 441 nn = 450 nn = 450 nn = 451 nn = 453 nn = 456 nn = 460 nn = 465 nn = 471 nn = 478 nn = 486 nn = 495 nn = 495 nn = 496 nn = 498 nn = 501 nn = 505 nn = 510 nn = 516 nn = 523 nn = 531 nn = 540 nn = 540 nn = 541 nn = 543 nn = 546 nn = 550 nn = 555 nn = 561 nn = 568 nn = 576 nn = 585 nn = 585 nn = 586 nn = 588 nn = 591 nn = 595 nn = 600 nn = 606 nn = 613 nn = 621 nn = 630 nn = 630 nn = 631 nn = 633 nn = 636 nn = 640 nn = 645 nn = 651 nn = 658 nn = 666 nn = 675 nn = 675 nn = 676 nn = 678 nn = 681 nn = 685 nn = 690 nn = 696 nn = 703 nn = 711 nn = 720 nn = 720 nn = 721 nn = 723 nn = 726 nn = 730 nn = 735 nn = 741 nn = 748 nn = 756 nn = 765 nn = 765 nn = 766 nn = 768 nn = 771 nn = 775 nn = 780 nn = 786 nn = 793 nn = 801 nn = 810 nn = 810 nn = 811 n = '811' nn = 8 nn = 9 nn = 10 n = '10' nn = 1 nn = 1 n = '1' tf = logical 0

10   Pass
n_str = '123678900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'; assert(isequal(divisible_by_3(n_str),1))

nn = 1 nn = 3 nn = 6 nn = 12 nn = 19 nn = 27 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 n = '36' nn = 3 nn = 9 n = '9' tf = logical 1

11   Pass
n_str = '123678900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001'; assert(isequal(divisible_by_3(n_str),0))

nn = 1 nn = 3 nn = 6 nn = 12 nn = 19 nn = 27 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 37 n = '37' nn = 3 nn = 10 n = '10' nn = 1 nn = 1 n = '1' tf = logical 0

12   Pass
n_str = '3141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351885752724891227938183011949129833673362440656643086021394946395224737190702179860943702770539217176293176752384674818467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050792279689258923542019956112129021960864034418159813629774771309960518707211349999998372978049951059731732816096318595024459455346908302642522308253344685035261931188171010003137838752886587533208381420617177669147303598253490428755468731159562863882353787593751957781857780532171226806613001927876611195909216420198938095257201065485863278865936153381827968230301952035301852968995773622599413891249721775283479131515574857242454150695950829533116861727855889075098381754637464939319255060400927701671139009848824012858361603563707660104710181942955596198946767837449448255379774726847104047534646208046684259069491293313677028989152104752162056966024058038150193511253382430035587640247496473263914199272604269922796'; assert(isequal(divisible_by_3(n_str),1))

nn = 3 nn = 4 nn = 8 nn = 9 nn = 14 nn = 23 nn = 25 nn = 31 nn = 36 nn = 39 nn = 44 nn = 52 nn = 61 nn = 68 nn = 77 nn = 80 nn = 82 nn = 85 nn = 93 nn = 97 nn = 103 nn = 105 nn = 111 nn = 115 nn = 118 nn = 121 nn = 129 nn = 132 nn = 134 nn = 141 nn = 150 nn = 155 nn = 155 nn = 157 nn = 165 nn = 173 nn = 177 nn = 178 nn = 187 nn = 194 nn = 195 nn = 201 nn = 210 nn = 213 nn = 222 nn = 231 nn = 234 nn = 241 nn = 246 nn = 247 nn = 247 nn = 252 nn = 260 nn = 262 nn = 262 nn = 271 nn = 278 nn = 282 nn = 291 nn = 295 nn = 299 nn = 304 nn = 313 nn = 315 nn = 318 nn = 318 nn = 325 nn = 333 nn = 334 nn = 340 nn = 344 nn = 344 nn = 350 nn = 352 nn = 360 nn = 366 nn = 368 nn = 368 nn = 376 nn = 385 nn = 394 nn = 402 nn = 408 nn = 410 nn = 418 nn = 418 nn = 421 nn = 425 nn = 433 nn = 435 nn = 440 nn = 443 nn = 447 nn = 449 nn = 450 nn = 451 nn = 458 nn = 458 nn = 464 nn = 471 nn = 480 nn = 488 nn = 490 nn = 491 nn = 495 nn = 503 nn = 503 nn = 511 nn = 517 nn = 522 nn = 523 nn = 526 nn = 528 nn = 536 nn = 538 nn = 541 nn = 541 nn = 547 nn = 553 nn = 557 nn = 564 nn = 564 nn = 573 nn = 576 nn = 584 nn = 588 nn = 592 nn = 598 nn = 598 nn = 607 nn = 612 nn = 617 nn = 617 nn = 622 nn = 630 nn = 632 nn = 634 nn = 637 nn = 638 nn = 645 nn = 647 nn = 652 nn = 655 nn = 660 nn = 669 nn = 673 nn = 673 nn = 681 nn = 682 nn = 684 nn = 692 nn = 696 nn = 704 nn = 705 nn = 706 nn = 707 nn = 714 nn = 718 nn = 723 nn = 723 nn = 725 nn = 733 nn = 737 nn = 738 nn = 738 nn = 740 nn = 747 nn = 747 nn = 748 nn = 757 nn = 760 nn = 768 nn = 773 nn = 775 nn = 776 nn = 777 nn = 777 nn = 782 nn = 787 nn = 792 nn = 801 nn = 807 nn = 811 nn = 815 nn = 821 nn = 823 nn = 825 nn = 834 nn = 838 nn = 846 nn = 855 nn = 860 nn = 864 nn = 873 nn = 876 nn = 876 nn = 879 nn = 887 nn = 888 nn = 897 nn = 903 nn = 907 nn = 911 nn = 913 nn = 921 nn = 929 nn = 930 nn = 930 nn = 939 nn = 946 nn = 951 nn = 957 nn = 963 nn = 968 nn = 977 nn = 980 nn = 983 nn = 987 nn = 991 nn = 997 nn = 998 nn = 1000 nn = 1008 nn = 1012 nn = 1019 nn = 1024 nn = 1030 nn = 1034 nn = 1042 nn = 1044 nn = 1047 nn = 1050 nn = 1057 nn = 1065 nn = 1071 nn = 1078 nn = 1086 nn = 1089 nn = 1090 nn = 1096 nn = 1101 nn = 1103 nn = 1110 nn = 1111 nn = 1113 nn = 1113 nn = 1114 nn = 1123 nn = 1123 nn = 1132 nn = 1133 nn = 1137 nn = 1142 nn = 1148 nn = 1152 nn = 1160 nn = 1165 nn = 1171 nn = 1177 nn = 1186 nn = 1188 nn = 1191 nn = 1195 nn = 1201 nn = 1201 nn = 1204 nn = 1208 nn = 1216 nn = 1222 nn = 1223 nn = 1223 nn = 1227 nn = 1232 nn = 1236 nn = 1239 nn = 1241 nn = 1247 nn = 1253 nn = 1257 nn = 1265 nn = 1267 nn = 1268 nn = 1271 nn = 1274 nn = 1283 nn = 1286 nn = 1292 nn = 1292 nn = 1299 nn = 1301 nn = 1307 nn = 1307 nn = 1309 nn = 1313 nn = 1322 nn = 1323 nn = 1327 nn = 1328 nn = 1330 nn = 1337 nn = 1340 nn = 1347 nn = 1349 nn = 1353 nn = 1358 nn = 1366 nn = 1373 nn = 1373 nn = 1373 nn = 1379 nn = 1385 nn = 1385 nn = 1391 nn = 1394 nn = 1395 nn = 1400 nn = 1405 nn = 1413 nn = 1421 nn = 1422 nn = 1429 nn = 1433 nn = 1441 nn = 1449 nn = 1450 nn = 1455 nn = 1457 nn = 1457 nn = 1466 nn = 1468 nn = 1468 nn = 1477 nn = 1483 nn = 1485 nn = 1493 nn = 1495 nn = 1504 nn = 1506 nn = 1511 nn = 1515 nn = 1515 nn = 1524 nn = 1525 nn = 1532 nn = 1533 nn = 1538 nn = 1541 nn = 1547 nn = 1551 nn = 1554 nn = 1560 nn = 1567 nn = 1575 nn = 1584 nn = 1586 nn = 1591 nn = 1600 nn = 1600 nn = 1603 nn = 1609 nn = 1609 nn = 1609 nn = 1610 nn = 1611 nn = 1614 nn = 1617 nn = 1617 nn = 1622 nn = 1625 nn = 1625 nn = 1630 nn = 1634 nn = 1642 nn = 1650 nn = 1652 nn = 1652 nn = 1656 nn = 1662 nn = 1668 nn = 1673 nn = 1675 nn = 1676 nn = 1679 nn = 1687 nn = 1691 nn = 1692 nn = 1696 nn = 1702 nn = 1711 nn = 1716 nn = 1717 nn = 1726 nn = 1730 nn = 1731 nn = 1736 nn = 1737 nn = 1738 nn = 1744 nn = 1744 nn = 1753 nn = 1757 nn = 1760 nn = 1763 nn = 1763 nn = 1768 nn = 1775 nn = 1777 nn = 1784 nn = 1784 nn = 1787 nn = 1793 nn = 1798 nn = 1805 nn = 1810 nn = 1819 nn = 1824 nn = 1833 nn = 1834 nn = 1843 nn = 1848 nn = 1851 nn = 1851 nn = 1860 nn = 1862 nn = 1863 nn = 1871 nn = 1877 nn = 1878 nn = 1879 nn = 1886 nn = 1889 nn = 1897 nn = 1898 nn = 1907 nn = 1910 nn = 1912 nn = 1918 nn = 1919 nn = 1920 nn = 1927 nn = 1936 nn = 1939 nn = 1940 nn = 1940 nn = 1945 nn = 1946 nn = 1947 nn = 1955 nn = 1960 nn = 1964 nn = 1972 nn = 1972 nn = 1979 nn = 1983 nn = 1987 nn = 1993 nn = 1995 nn = 1998 nn = 2005 nn = 2014 nn = 2023 nn = 2029 nn = 2031 nn = 2038 nn = 2042 nn = 2051 nn = 2056 nn = 2062 nn = 2069 nn = 2072 nn = 2077 nn = 2078 nn = 2086 nn = 2094 nn = 2099 nn = 2106 nn = 2111 nn = 2113 nn = 2120 nn = 2122 nn = 2126 nn = 2134 nn = 2143 nn = 2144 nn = 2146 nn = 2148 nn = 2155 nn = 2164 nn = 2167 nn = 2175 nn = 2176 nn = 2184 nn = 2187 nn = 2187 nn = 2188 nn = 2189 nn = 2198 nn = 2202 nn = 2211 nn = 2212 nn = 2214 nn = 2223 nn = 2231 nn = 2234 nn = 2237 nn = 2243 nn = 2250 nn = 2253 nn = 2256 nn = 2262 nn = 2264 nn = 2268 nn = 2272 nn = 2272 nn = 2278 nn = 2283 nn = 2289 nn = 2295 nn = 2299 nn = 2302 nn = 2302 nn = 2310 nn = 2316 nn = 2316 nn = 2318 nn = 2319 nn = 2322 nn = 2331 nn = 2335 nn = 2344 nn = 2348 nn = 2354 nn = 2357 nn = 2366 nn = 2371 nn = 2373 nn = 2375 nn = 2379 nn = 2386 nn = ...

13   Pass
n_str = '1010010101011010101001011010100101101010010100101101010011010100101'; assert(isequal(divisible_by_3(n_str),1))

nn = 1 nn = 1 nn = 2 nn = 2 nn = 2 nn = 3 nn = 3 nn = 4 nn = 4 nn = 5 nn = 5 nn = 6 nn = 7 nn = 7 nn = 8 nn = 8 nn = 9 nn = 9 nn = 10 nn = 10 nn = 10 nn = 11 nn = 11 nn = 12 nn = 13 nn = 13 nn = 14 nn = 14 nn = 15 nn = 15 nn = 15 nn = 16 nn = 16 nn = 17 nn = 18 nn = 18 nn = 19 nn = 19 nn = 20 nn = 20 nn = 20 nn = 21 nn = 21 nn = 22 nn = 22 nn = 22 nn = 23 nn = 23 nn = 24 nn = 25 nn = 25 nn = 26 nn = 26 nn = 27 nn = 27 nn = 27 nn = 28 nn = 29 nn = 29 nn = 30 nn = 30 nn = 31 nn = 31 nn = 31 nn = 32 nn = 32 nn = 33 n = '33' nn = 3 nn = 6 n = '6' tf = logical 1

14   Pass
ind = randi(4); switch ind case 1 n_str = '12'; assert(isequal(divisible_by_3(n_str),1)) case 2 n_str = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901'; assert(isequal(divisible_by_3(n_str),0)) case 3 n_str = '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; assert(isequal(divisible_by_3(n_str),1)) case 4 n_str = '1236127'; assert(isequal(divisible_by_3(n_str),0)) end

nn = 1 nn = 3 nn = 6 nn = 10 nn = 15 nn = 21 nn = 28 nn = 36 nn = 45 nn = 45 nn = 46 nn = 48 nn = 51 nn = 55 nn = 60 nn = 66 nn = 73 nn = 81 nn = 90 nn = 90 nn = 91 nn = 93 nn = 96 nn = 100 nn = 105 nn = 111 nn = 118 nn = 126 nn = 135 nn = 135 nn = 136 nn = 138 nn = 141 nn = 145 nn = 150 nn = 156 nn = 163 nn = 171 nn = 180 nn = 180 nn = 181 nn = 183 nn = 186 nn = 190 nn = 195 nn = 201 nn = 208 nn = 216 nn = 225 nn = 225 nn = 226 nn = 228 nn = 231 nn = 235 nn = 240 nn = 246 nn = 253 nn = 261 nn = 270 nn = 270 nn = 271 nn = 273 nn = 276 nn = 280 nn = 285 nn = 291 nn = 298 nn = 306 nn = 315 nn = 315 nn = 316 nn = 318 nn = 321 nn = 325 nn = 330 nn = 336 nn = 343 nn = 351 nn = 360 nn = 360 nn = 361 nn = 363 nn = 366 nn = 370 nn = 375 nn = 381 nn = 388 nn = 396 nn = 405 nn = 405 nn = 406 nn = 408 nn = 411 nn = 415 nn = 420 nn = 426 nn = 433 nn = 441 nn = 450 nn = 450 nn = 451 nn = 453 nn = 456 nn = 460 nn = 465 nn = 471 nn = 478 nn = 486 nn = 495 nn = 495 nn = 496 nn = 498 nn = 501 nn = 505 nn = 510 nn = 516 nn = 523 nn = 531 nn = 540 nn = 540 nn = 541 nn = 543 nn = 546 nn = 550 nn = 555 nn = 561 nn = 568 nn = 576 nn = 585 nn = 585 nn = 586 nn = 588 nn = 591 nn = 595 nn = 600 nn = 606 nn = 613 nn = 621 nn = 630 nn = 630 nn = 631 nn = 633 nn = 636 nn = 640 nn = 645 nn = 651 nn = 658 nn = 666 nn = 675 nn = 675 nn = 676 nn = 678 nn = 681 nn = 685 nn = 690 nn = 696 nn = 703 nn = 711 nn = 720 nn = 720 nn = 721 nn = 723 nn = 726 nn = 730 nn = 735 nn = 741 nn = 748 nn = 756 nn = 765 nn = 765 nn = 766 nn = 768 nn = 771 nn = 775 nn = 780 nn = 786 nn = 793 nn = 801 nn = 810 nn = 810 n = '810' nn = 8 nn = 9 nn = 9 n = '9' tf = logical 1

15   Pass
ind = randi(4); switch ind case 1 n_str = '1010010101011010101001011010100101101010010100101101010011010100101'; assert(isequal(divisible_by_3(n_str),1)) case 2 n_str = '12'; assert(isequal(divisible_by_3(n_str),1)) case 3 n_str = '123678900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001'; assert(isequal(divisible_by_3(n_str),0)) case 4 n_str = '13'; assert(isequal(divisible_by_3(n_str),0)) end

nn = 1 nn = 3 nn = 6 nn = 12 nn = 19 nn = 27 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 36 nn = 37 n = '37' nn = 3 nn = 10 n = '10' nn = 1 nn = 1 n = '1' tf = logical 0

16   Pass
ind = randi(4); switch ind case 1 n_str = '13'; assert(isequal(divisible_by_3(n_str),0)) case 2 n_str = '123678900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'; assert(isequal(divisible_by_3(n_str),1)) case 3 n_str = '123678900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001'; assert(isequal(divisible_by_3(n_str),0)) case 4 n_str = '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; assert(isequal(divisible_by_3(n_str),1)) end

nn = 1 nn = 3 nn = 6 nn = 10 nn = 15 nn = 21 nn = 28 nn = 36 nn = 45 nn = 45 nn = 46 nn = 48 nn = 51 nn = 55 nn = 60 nn = 66 nn = 73 nn = 81 nn = 90 nn = 90 nn = 91 nn = 93 nn = 96 nn = 100 nn = 105 nn = 111 nn = 118 nn = 126 nn = 135 nn = 135 nn = 136 nn = 138 nn = 141 nn = 145 nn = 150 nn = 156 nn = 163 nn = 171 nn = 180 nn = 180 nn = 181 nn = 183 nn = 186 nn = 190 nn = 195 nn = 201 nn = 208 nn = 216 nn = 225 nn = 225 nn = 226 nn = 228 nn = 231 nn = 235 nn = 240 nn = 246 nn = 253 nn = 261 nn = 270 nn = 270 nn = 271 nn = 273 nn = 276 nn = 280 nn = 285 nn = 291 nn = 298 nn = 306 nn = 315 nn = 315 nn = 316 nn = 318 nn = 321 nn = 325 nn = 330 nn = 336 nn = 343 nn = 351 nn = 360 nn = 360 nn = 361 nn = 363 nn = 366 nn = 370 nn = 375 nn = 381 nn = 388 nn = 396 nn = 405 nn = 405 nn = 406 nn = 408 nn = 411 nn = 415 nn = 420 nn = 426 nn = 433 nn = 441 nn = 450 nn = 450 nn = 451 nn = 453 nn = 456 nn = 460 nn = 465 nn = 471 nn = 478 nn = 486 nn = 495 nn = 495 nn = 496 nn = 498 nn = 501 nn = 505 nn = 510 nn = 516 nn = 523 nn = 531 nn = 540 nn = 540 nn = 541 nn = 543 nn = 546 nn = 550 nn = 555 nn = 561 nn = 568 nn = 576 nn = 585 nn = 585 nn = 586 nn = 588 nn = 591 nn = 595 nn = 600 nn = 606 nn = 613 nn = 621 nn = 630 nn = 630 nn = 631 nn = 633 nn = 636 nn = 640 nn = 645 nn = 651 nn = 658 nn = 666 nn = 675 nn = 675 nn = 676 nn = 678 nn = 681 nn = 685 nn = 690 nn = 696 nn = 703 nn = 711 nn = 720 nn = 720 nn = 721 nn = 723 nn = 726 nn = 730 nn = 735 nn = 741 nn = 748 nn = 756 nn = 765 nn = 765 nn = 766 nn = 768 nn = 771 nn = 775 nn = 780 nn = 786 nn = 793 nn = 801 nn = 810 nn = 810 n = '810' nn = 8 nn = 9 nn = 9 n = '9' tf = logical 1