Question: We say that a positive integer is weird if the sum of its divisors, including 1 but excluding itself, is larger than that integer, and

We say that a positive integer is weird if the sum of its divisors, including 1 but excluding itself, is larger than that integer, and no subsets of those divisors sums to that integer. Example: 70 is a weird integer because its divisors, including 1 but excluding itself, are 1,2,5, 7, 10, 14, 35. We have 1 + 2 +5+ 7 + 10 + 14 + 35 = 74 > 70, and no subsets of {1,2,5, 7, 10, 14, 35} sums to 70. Non-example: 12 is NOT a weird integer because its divisors, including 1 but excluding itself, are 1, 2, 3, 4,6. Even though 1+2+3+4+6 = 16 > 12, the subset {2,4,6} c{1,2,3,4,6} sums to 2 + 4 + 6 = 12. You can easily verify by hand that there does not exist any single digit weird integer, i.e., all positive integers smaller than 10 are NOT weird. It turns out that 70 is the only possible two digit weird integer but this gets tedious to verify by hand. Computers can help. Write a MATLAB script Yourlastname Yourfirstname HW2p2.m that takes two positive in- tegers nmin, Nmax as inputs where nmin
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
