Check if a Number is Deficient

Given a positive integer n, return true when the sum of its positive proper divisors is less than n. Otherwise, return false. A proper divisor divides n…

Given a positive integer `n`, return `true` when the sum of its positive proper divisors is less than `n`. Otherwise, return `false`. A proper divisor divides `n` exactly and is smaller than `n`. For example, the proper divisors of `8` are `1`, `2`, and `4`; their sum is `7`, so `8` is deficient.

- `1 ≤ n ≤ 10^6` - `n` is always a positive integer.

Example 1: input n = 8; output true. The proper divisors sum to 7, which is less than 8.

Example 2: input n = 1; output true. One has no positive proper divisors, so the sum is zero.

Example 3: input n = 28; output false. The proper divisors sum to exactly 28, not less than 28.

Category: Math. Topic: math. Difficulty: Easy. Patterns: math.