Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Information Systems 1 International Baltic Conference Dbandis 2020 Tallinn Estonia June 19 2020 Proceedings

Authors: Tarmo Robal ,Hele-Mai Haav ,Jaan Penjam ,Raimundas Matulevicius

1st Edition

303057671X, 978-3030576714

More Books

Students also viewed these Databases questions