Question: use python Programming Exercise 1: Experiment with Perfect Numbers A positive integer is called a perfect number if it is equal to the sum of

use pythonuse python Programming Exercise 1: Experiment with Perfect Numbers A positive integeris called a perfect number if it is equal to the sum

Programming Exercise 1: Experiment with Perfect Numbers A positive integer is called a perfect number if it is equal to the sum of all of its positive divisors, excluding itself. For example, 6 is perfect number since 6=1+2+3. The next is 28=1+2+4+7+12. There are four perfect numbers less than 10,000. Write a program that prints all these four numbers. Your program should have a function called is_perfect that takes as input a positive integers and returns True if it is perfect and False otherwise. Modify the divisors(n) function you implemented from the pervious lab. So, it returns a list of divisors of number n. Use this function to do the rest. Programming Exercise 1: Experiment with Perfect Numbers Once you are done. Modify your program so that it looks for all perfect numbers smaller than 35 million. What do you notice? Assuming that you computer can do a billion instructions in a sec, can you figure out how long, roughly, will it take your computer to find 5th perfect number (it is 33,550,336). Is the answer roughly: couple of minutes, couple of hours, couple of days, ... weeks, months, years ? What if you wanted to wait until it prints 6th perfect number, which is 8,589,869,056

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!