Cody

# Problem 46898. Sum of all the divisors of n

Solution 3286098

Submitted on 20 Oct 2020 by William
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=2.^(10:20); y=[2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151]; assert(isequal(sumDivisors(x),y))

2   Pass
x=2^32-1; y=7304603328; assert(isequal(sumDivisors(x),y))

3   Pass
x =[ 53394 10330 42975 46272 28754 18090 49236 55098 23047 4972 59362 63609 2341 2087 25006 44545 16718 16665 54450 3536 8323 62729 55649 18149 50169 42933 33159 53365 38356 34787 59860 31810 61211 3026 52115 10657 45815 15960 36027 51064 41443 52448 44482 6366 12247 7799 58387 60901 60110 61212 6393 9299 49660 53967 32098 32661 62869 22937 18733 8514 18252 27641 48702 45537 29202 62898 35863 12885 49624 37279 35841 60014 25705 20782 42357 22308 9085 16456 49397 30762 62752 51919 42958 62274 46489 38357 9785 40374 24933 781 63235 62882 11219 2258 49460 14668 16877 31018 37213 22094]; y=[ 116640 18612 77376 122936 47088 48960 125664 119418 24280 9576 90576 104832 2342 2088 37512 54720 27048 29376 160797 7812 10080 63300 60720 18150 76480 62496 50560 69048 68992 35640 130536 57276 61212 4860 71520 10658 73872 57600 52052 103320 41444 113400 69696 12744 12616 8520 70400 60902 108216 142856 8528 9864 112896 71960 52560 49920 62870 22938 22176 20592 51240 27984 97416 62304 60672 137376 35864 20640 93060 40680 51520 92568 31752 31176 64576 61488 11520 35910 50496 66690 129276 59344 65952 127008 46490 42294 12480 87516 33248 864 75888 98496 12096 3390 103908 27160 19296 50148 43200 33144]; assert(isequal(sumDivisors(x),y))

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!