Karl Austin Burkhardt
  • Home
  • Research
  • Courses
  • Downloads
  • Blog

Daily Programmer #243 [easy]

12/2/2015

0 Comments

 

Abundant and Deficient Numbers

The topic of abundant and deficient numbers arises from number theory. There are three types of numbers this code will analyze:
  • A number is deficient if the sum of its divisors is less than twice the number
  • A number is abundant if the sum of its divisors is more than twice the number
  • A number is perfect if the sum of its divisors are equal to twice the number
The first task is to find all divisors of a given number and to sum them. It is then simple to compare this sum to twice the number and determine the type of number we have. The code will then return the number, followed by its classification, followed by the amount by which the number is abundant, if it is abundant.
0 Comments



Leave a Reply.

    About Me:

    Runner, scientist, data enthusiast.

    Archives

    October 2016
    March 2016
    February 2016
    January 2016
    December 2015

    Topics

    All
    Daily Programmer
    Distance Challenge
    Python 3
    Race Report
    Recipes

    RSS Feed

Powered by Create your own unique website with customizable templates.