Question: (a) Write a MATLAB function M-file, call it divsum(n), that takes as input a positive integer N and gives as output the sum of all

(a) Write a MATLAB function M-file, call it divsum(n), that takes as input a positive integer N and gives as output the sum of all of the proper divisors of N. For example, the proper divisors of 10 are 1,2, and 5 so the output of divsum(10) should be 8 (=1 + 2 + 5). Similarly, divsum(12) should equal 16 since the proper divisors of 6 are 1,2,3,4 and 6. Run your program for the following values of N: N = 10, N = 224, N = 1410 (and give the outputs).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!