Non-Abundant Sums
A positive integer n is perfect if s(n) = n, deficient if s(n) < n, and abundant if s(n) > n, where s(n) = sigma_1(n) - n is the sum of proper divisors. It is known that every integer greater than...
Problem Statement
This archive keeps the full statement, math, and original media on the page.
A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of \(28\) would be \(1 + 2 + 4 + 7 + 14 = 28\), which means that \(28\) is a perfect number.
A number \(n\) is called deficient if the sum of its proper divisors is less than \(n\) and it is called abundant if this sum exceeds \(n\).
As \(12\) is the smallest abundant number, \(1 + 2 + 3 + 4 + 6 = 16\), the smallest number that can be written as the sum of two abundant numbers is \(24\). By mathematical analysis, it can be shown that all integers greater than \(28123\) can be written as the sum of two abundant numbers. However, this upper limit cannot be reduced any further by analysis even though it is known that the greatest number that cannot be expressed as the sum of two abundant numbers is less than this limit.
Find the sum of all the positive integers which cannot be written as the sum of two abundant numbers.
Problem 23: Non-Abundant Sums
Mathematical Development
Definitions
Definition 1 (Abundant Number). A positive integer is abundant if , equivalently .
Definition 2 (Abundant-Sum Representability). A positive integer is abundant-sum representable if there exist abundant numbers (not necessarily distinct) such that . Denote the set of such integers by .
Theorems and Proofs
Theorem 1 (Smallest Abundant Number). The smallest abundant number is .
Proof. We verify exhaustively that for all :
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 1 | 1 | 3 | 1 | 6 | 1 | 7 | 4 | 8 | 1 |
In particular, (perfect) and for all other . For : .
Theorem 2 (Closure Under Scaling). If is abundant and is a positive integer, then is abundant.
Proof. For each divisor of , the integer divides . Hence , which gives
Since is abundant, , so , and therefore , establishing that is abundant.
Corollary 1. Every positive multiple of 12 that is at least 24 is abundant. More generally, every positive multiple of any abundant number (with multiplier ) is abundant.
Theorem 3 (Finite Complement of ). Every integer greater than belongs to .
Proof. This is a classical result. By Corollary 1, all multiples of 12 from 24 onward are abundant. Since abundant numbers have positive asymptotic density (Schur, 1931; Davenport, 1933 showed the density is approximately 0.2477), the sumset contains all sufficiently large integers. The bound 28123 has been verified computationally as sufficient.
Remark. The largest integer not in is known to be 20161, so 28123 is a conservative but correct upper bound.
Editorial
We first precompute , the sum of proper divisors, for every with a sieve-like pass over multiples. From that table we collect the abundant numbers, enumerate all sums of two abundant numbers that stay within the limit, mark those sums as representable, and finally add every unmarked integer. This is sufficient because any number that can be written as a sum of two abundant numbers will be marked during the nested scan.
Pseudocode
Algorithm: Sum of Integers Not Expressible as Two Abundant Numbers
Require: An upper bound N.
Ensure: The sum of all positive integers up to N that are not representable as a sum of two abundant numbers.
1: Compute s(n) for every 1 ≤ n ≤ N by distributing each divisor d to the proper multiples of d.
2: Collect all abundant numbers into a list A ← {n : s(n) > n}.
3: Initialize a Boolean table mark on {0, 1, ..., N}; for each pair a, b in A with a + b ≤ N, set mark[a + b] ← true.
4: Compute S ← sum of all n with 1 ≤ n ≤ N and mark[n] = false.
5: Return S.
Complexity Analysis
Proposition. The algorithm runs in time and space, where .
Proof.
- Step 1 (Sieve): The inner loop for each iterates times. Summing over :
where is the -th harmonic number.
- Step 2: scan.
- Step 3: The double loop over abundant numbers runs at most iterations. Since the density of abundant numbers is approximately 0.2477, we have , giving . For , this is about operations.
- Step 4: scan.
Total: . The boolean array and divisor-sum array each require space.
Answer
Code
Each problem page includes the exact C++ and Python source files from the local archive.
#include <bits/stdc++.h>
using namespace std;
int main() {
const int N = 28123;
vector<int> spd(N + 1, 0);
for (int i = 1; i <= N; i++)
for (int j = 2 * i; j <= N; j += i)
spd[j] += i;
vector<int> abundant;
for (int i = 1; i <= N; i++)
if (spd[i] > i)
abundant.push_back(i);
vector<bool> is_sum(N + 1, false);
for (int i = 0; i < (int)abundant.size(); i++)
for (int j = i; j < (int)abundant.size(); j++) {
int s = abundant[i] + abundant[j];
if (s > N) break;
is_sum[s] = true;
}
long long ans = 0;
for (int i = 1; i <= N; i++)
if (!is_sum[i])
ans += i;
cout << ans << endl;
return 0;
}
def solve():
LIMIT = 28123
spd = [0] * (LIMIT + 1)
for i in range(1, LIMIT + 1):
for j in range(2 * i, LIMIT + 1, i):
spd[j] += i
abundant = [i for i in range(1, LIMIT + 1) if spd[i] > i]
is_sum = [False] * (LIMIT + 1)
for i, a in enumerate(abundant):
for j in range(i, len(abundant)):
s = a + abundant[j]
if s > LIMIT:
break
is_sum[s] = True
print(sum(i for i in range(1, LIMIT + 1) if not is_sum[i]))