The Deficient Number

EasyAcc. 96.8%
+15 XP 5

Minimalist Factors

A Deficient Number is an integer where the sum of its proper divisors is less than the number itself. Most prime numbers are deficient!

The Assignment

Your function receives a parameter num.

  1. Calculate the sum of proper divisors using a loop.
  2. If the sum is less than num, print "true", otherwise "false".

01EXAMPLE 1

Inputnum=8
Outputtrue

Explanation: Divisors: 1, 2, 4 (sum 7). 7 < 8.

Constraints

  • Use a loop to find divisors.
  • Exclude the number itself from the sum.
MathLoops
JavaScript
Loading...
3 Hidden

Input Arguments

num8

Expected Output

true

Click RUN to test your solution