Question
For any number, we can find all of its factors and add them up. Some numbers will have a factor sum that is less than
For any number, we can find all of its factors and add them up. Some numbers will have a factor sum that is less than themselves(deficient), some will have a factor sum that is more than themselves(abundant). And some will have a factor sum that is exactly equal to themselves... these are the so-called "perfect" numbers.
Write a program called FactorSum.py that lets the user enter a whole number N, and then computes the percentage of numbers between 2 and N that falls into each of the three above categories.
(Note: When adding up factors, include 1 and all factors less than the number, but do not include the number itself.)
Requirements:
- The output should include the three percents... numbers between 0 and 100, and formatted to be rounded to four decimal places.
- User-friendly, as always.
- Include appropriate comments.
- In Python
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started