Question: 10. A positive integer is called a perfect number if it is equal to the sum of all of its divisors, including 1 but excluding

10. A positive integer is called a perfect number if it is equal to the sum of all of its divisors, including 1 but excluding the number itself. For example, 6=1+2+3. Write a function sum_of_divisors that takes a positive integer n and returns the sum of all its divisors (excluding n ). Hint: if n:d is 0: sum_divs +=d The smallest perfect number is 6 . Write a program that finds and prints out the next perfect number
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
