An abundant number or excessive number is a number for which the sum of its proper divisors is greater than the number itself. 

The integer 12 is the first abundant number. Its proper divisors are 1, 2, 3, 4 and 6 for a total of 16 (> 12).

Derive function `abundantNumber(num)/abundant_number(num)` which returns `true/True/.true.` if `num` is abundant, `false/False/.false.` if not.

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Mathematics

Starter code: def abundant_number(num):
	

Solutions:
def abundant_number(num):
	return sum([e for e in range(1, num) if num % e == 0]) > num


def abundant_number(n):
	return sum((m for m in range(1, n) if n % m == 0)) > n


def abundant_number(num):
	return sum((i for i in range(1, num // 2 + 1) if not num % i)) > num


def abundant_number(num):
	sum_divisors = 1
	int_sqrt = int(num ** 0.5)
	for div in range(2, int_sqrt + 1):
		if num % div == 0:
			sum_divisors += div + num // div
	if int_sqrt ** 2 == num:
		sum_divisors -= int_sqrt
	return sum_divisors > num


def abundant_number(num):
	return sum([x for x in range(1, num) if num % x == 0]) > num


def abundant_number(n):
	return sum((n // i + i for i in range(2, int(n ** 0.5) + 1) if n % i == 0)) + 1 > n