#include <stdio.h>
#include <math.h>
// abundant number = sum of proper divisors > number
unsigned SumNumberProperDivisors(const unsigned num) {
unsigned sum = 1;
for (unsigned i = 2, j; i * i <= num; i++)
if (num % i == 0)
sum += i + (i == (j = num / i) ? 0 : j);
return sum;
}
int main()
{
for (unsigned num = 1, i = 0; i < 25; num++) {
if (SumNumberProperDivisors(num) > num) {
printf("%u: %u\n", ++i, num);
}
}
return 0;
}
/*
run:
1: 12
2: 18
3: 20
4: 24
5: 30
6: 36
7: 40
8: 42
9: 48
10: 54
11: 56
12: 60
13: 66
14: 70
15: 72
16: 78
17: 80
18: 84
19: 88
20: 90
21: 96
22: 100
23: 102
24: 104
25: 108
*/