Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

An abundant number is a positive integer for which the sum of its proper divisors ( all divisors excluding itself ) is strictly greater than

An abundant number is a positive integer for which the sum of its proper divisors (all divisors excluding itself) is strictly greater than the number itself.
Example: 12 is divisible by 1,2,3,4, and 6
1+2+3+4+6=16, and now 16>12, so 12 is abundant number.
Example: 9 is divisible by 1 and 3
1+3=4, and now 49, so 9 is not an abundant number.
Example: 6 is divisible by 1,2 and 3
1+2+3=6, and now 6=6, so 6 is not an abundant number.
Write a function print_abundant(n) that prints first n abundant numbers, where n is the parameter given by the user.
def print_abundant (n) :
Sample Outputs:
print_abundant(2)-> prints 12,18
print_abundant(6)-> prints 12,18,20,24,28,30
print_abundant(9)-> prints 12,18,20,24,28,30,36,40,42
Note: You do not need to return anything from the function, just have it print directly.
image text in transcribed

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_2

Step: 3

blur-text-image_3

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 3 Lnai 9286

Authors: Albert Bifet ,Michael May ,Bianca Zadrozny ,Ricard Gavalda ,Dino Pedreschi ,Francesco Bonchi ,Jaime Cardoso ,Myra Spiliopoulou

1st Edition

3319234609, 978-3319234601

More Books

Students also viewed these Databases questions

Question

Describe your ideal working day.

Answered: 1 week ago