about | help | code help+videos | done | prefs |
numberType
The "proper factors" of integer n are all the factors of n that are less than n. So, the factors of 10 are 1, 2, 5, and 10, but the proper factors of 10 are just 1, 2, and 5. A number n is "abundant" if its proper factors add up to more than n. n is "deficient" if its proper factors add up to less than n. n is "perfect" if its proper factors add up to exactly n. Given a positive integer, return whether the number is abundant, deficient, or perfect. numberType(4) → "deficient" numberType(6) → "perfect" numberType(12) → "abundant" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 200
Copyright Nick Parlante 2017 - privacy