Problem Description
What is largest integer which cannot be expressed
as the sum of two abundant numbers?
Background & Techniques
A number, the sum of whose proper divisors is equal to the number
itself, is called a perfect number. If the
sum is less than the number, the number is deficient and if the sum
is greater, it is abundant. (Proper divisors are divisors which a
smaller than the number itself.)
It has been proven that every number greater than 83,160 can be expressed as
the sum of two abundant
numbers. This program answers a few questions about the number of
abundant numbers and the sums which they can (and can't) form:
 What is the distribution of number types (deficient, perfect,
abundant) for integers up to 1,000,000?
 What is the smallest odd abundant number?
 Some numbers less than 83,160 cannot be expressed as the sum of two
abundants.. What is the largest number which cannot be expressed as the
sum of two abundant numbers? What is the smallest that can be?
 So, just how many numbers are there which cannot be expressed as the
sum of two abundant numbers?
Nonprogrammers are welcome to read on, but may
want to skip to the bottom of this page to download
executable version of the program.
A few "helper" functions:
 Checktype returns a TNbrType for a passed integer
where TNbrtype is defined as (deficient, perfect, abundant).:
 BuildAbundants returns a sparse table of Boolean
flags up to the passed maximum value Max. The table has "Max"
Boolean entries filled false for nonabundant and True for abundant numbers.
This allows rapid checks of whether a specific number is abundant.
 MakeFactorsString returns a string of form "a
+ b + c +.... = N" where {a,b,c ...} are the proper factors of N.
Two programming notes in case you haven't already
added them to your bag of tricks:
Dynamic arrays passed as parameters can only have
their length reassigned if the type is a predefined array type. In
other words, this works:
type
TBoolArray=array of boolean;
procedure makeAbundants(var a:TBoolArray; const Max:integer);
...
begin
setlength(a,max+1); .....
end;
var a:TBoolArray; ....
Begin
MakeAbundants(a,83160);...
But this does not
procedure makeAbundants(var a: array
of Boolean; const Max:integer);
begin
setlength(a,max+1); ....
end;
var a:array of Boolean; ......
Begin
MakeAbundants(a,83160); ....
Also, there is no formatting string entry which will embed
"thousand separator" for integers, i.e. commas for U.S. The best
solution I have found looks like uses the "%n" format and requires
that the integer be converted to a floating point value like this:
add( format ('Deficient count:
%.0n',[0.0+d]));
Running/Exploring the Program
Suggestions for Further Explorations
Would summing 3 abundant numbers change the
statistics?
Sums for a particular number can often be formed in
more than 1 way. Does number of ways increase with the size of
the number?
????
Original Date: February 10, 2008 
Modified:
February 18, 2016 
