Home  |  Introduction  |  Newsletters  |  Programs  |  Feedback

 

 

Search:

WWW

DelphiForFun.org

Support DFF

 If you benefit from the website,  in terms of knowledge, entertainment value, or something otherwise useful, consider making a donation via PayPal  to help defray the costs.  (No PayPal account necessary to donate via credit card.)  Transaction is secure.

If you shop at Amazon anyway,  consider using this link. 

     

We receive a few cents from each purchase.  Thanks

 

 

The index page for all Programs on the site?

The DFF Play CD?

Zipped file DFF Play CD.zip contains  executable version of about  75 of the 200+ programs from the site, mostly those I particularly liked or thought would be of widest interest for non-programmers.  The file is rather large, about 20mb..

Anything else?

 

Google
 

 

    

Search WWW

Search DelphiForFun.org

 

Not a programmer (yet)?

 That's OK -  the executable version for any puzzle or  game you find here is available for download.  Just scroll down to the bottom of most any description page and you'll find a "Download executable" link. Downloaded programs are in "zipped" format to reduce size and may require an "unzipper" program unless you are running Win XP or later.  Here's a link to a free one. 

Check  out  the Most Popular  Downloads from DFF   (updated weekly)

First time visitor?

Take a look at the Introduction page to see what this site is about

Notes for Teachers

 

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?

Non-programmers 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 non-abundant 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: July 29, 2017