[Home] [Puzzles & Projects] [Delphi Techniques] [Math topics] [Library] [Utilities]


Problem Description
The second in the "TShirt" series: Front of TShirt: "The smallest 3 digit number equal to the sum of its digits cubed" Back: __ __ __ ?
This is the XXL version (as in extra, extra large) of the previously
posted TShirts #2 problem. Background & TechniquesThis page is an extension of the discussion started in the page describing the initial version of the TShirts2 problem to generate numbers with this characteristic , called Armstrong numbers or Pluperfect Digital invariants (PPDIs). I suggest that you visit the TShirts #2 page first. The XXL refers to complexity rather than code size. I've added the multiset search technique proposed previously. In addition, the program now uses the Big Integers unit in an optimized search for Armstrong numbers larger than 19 digits long. I have found out that , in base 10, there are 88 of these Armstrong numbers. In fact here's a link to a site that that lists them. There are two new buttons on the form; a "Multisets" button that generates and tests all subsets of length N from the digits 0 through 9 with duplication allowed. And a "Big Numbers" button that implements an large integer version of the multiset search technique.
The Multiset button procedure operates on 64 bit integers and therefore can only find numbers through 19 or 20 digits (I've limited it to 19 digits, just to be safe). As a refresher, the sum of the powers of the digits of a number is independent of the order. So if we generate the multisets of size N, calculate the sum of powers and check to see if the digits in the sum are a 1to1 match with the digits summed, we have a faster way to detect Armstrong numbers. The "Big Numbers" button started out as a copy of the above procedure, but using the Big Integers unit previously introduced. Because calculations using big integers are about 10 times slower than Int64 calculations, I added some additional optimizations.
I just added a fifth button to generate all 88 numbers but haven't run it to completion yet. Addendum January 15, 2001 : Program just completed, it took 36 hours on my 800mmhz Celeron! Now I know I'm going to have to improve on that time. Here's a page with my program's output listing all 88 base10 PPDIs. Addendum April 13, 2005: The UBigIntsV2 containing the TInteger big integer class has moved the DFF Library. If you want to recompile the program you will nee a one time download of the DFF Library source. Running/Exploring the Program
Suggestions for Further Explorations

[Feedback] [Newsletters (subscribe/view)] [About me]Copyright © 20002017, Gary Darby All rights reserved. 