easy +10 pts

Abundant Number Check

Determine if a positive integer is abundant by comparing its proper divisors to the number itself.

A positive integer n is called an *abundant number* if the sum of its proper divisors (all positive divisors excluding n itself) is greater than n. For example, 12 has proper divisors 1, 2, 3, 4, 6 which sum to 16 > 12, so 12 is abundant. Write a function `is_abundant(n)` that returns `True` if n is abundant and `False` otherwise.

Constraints

1 <= n <= 10^5. The function must run in O(sqrt(n)) time.

Example

>>> is_abundant(12)
True
>>> is_abundant(18)
True
>>> is_abundant(15)
False
10 points ~15 min

Recent Submissions

No submissions yet — hit Run Tests to try!

Hints

Find divisors up to the square root of n.
Remember to exclude n itself when summing proper divisors.
Make sure to handle n=1 correctly (sum of proper divisors is 0).
Python 3
All tests passed!
Test Results
Press Ctrl+Enter or click Run Tests to execute your code.