Hahn Number Research Information
*Earl M. Rodd*
*erodd@alumni.rice.edu*
*earl.rodd.us*

The name *Hahn number* is attributed to a suggestion by Dr. David
Hahn of the Malone University Mathematics Department when he noted that
his licence plate number, 5120, is unusual in that the digits, 5, 1, 2 and
0 are also the digits which come from the factors (5, and 2 to the 10th)
and the powers they are raised to. Thus the factors and powers are:

5 2^{10}which includes the digits 5, 2, 1, and 0, the same as 5120

The question was raised "how many such numbers are there?"

A query was made to investigate if such numbers had been the subject
of research. It was discovered that the sequence is known as
described at:
https://oeis.org/search?q=25+121+1255+2349+5120&sort=&language=english&go=Search

However, this entry lists only a small number of such numbers and
does not assign them a name.

Earl Rodd of the Malone University Computer Science Department developed programs to find such numbers with reasonable efficiency. For lack of any other name, for now we call them "Hahn Numbers."

The Java code used and the raw data files listing Hahn numbers and their factors are available from Earl Rodd at erodd@alumni.rice.edu.

Data below cover some simple analysis of the numbers up to 1 trillion. All numbers up to 7 trillion have been found and similar (and further) analysis performed.

Information on Hahn numbers from 1 to 1000000000000
Total Hahn numbers from 1 to 1000000000000 is: 878192 (Largest = 999999961375 )

Number which are product of 2 primes: 623973 Of those both primes > 9 363652

Number which have a factor squared or higher: 205789

Largest prime seen as factor: 99999989741

Largest prime squared or more: 10159

Largest prime cubed or more: 149

Largest prime raised to 4th or more: 23

Largest prime raised to 5th or more: 11

Largest prime raised to 6th or more: 7

Largest prime raised to 7th or more: 5

Click here to see a list of primes which were at least squared in 11 or more Hahn numbers.

Total number of different primes seen: 797201

Click here to see a list of primes which occur in more than 100 Hahn numbers.

Click here to see
Primes never seen up to 1000000 (sqrt of 1000000000000 )

Of 78498 primes in range 2 to 1000000 , 50078 were used and 28420 were not.

Click here to see how many Hahn numbers are in each range of one million numbers.

Million range with the most Hahn numbers is 1000001 - 2000000 with 81

Click here to see how many Hahn numbers are in each range of 25 million numbers.

Click here to see how many Hahn numbers are in each range of 100 million numbers.

Click here to see how many Hahn numbers are in each range of 1000 million (billion) numbers.

Distribution of Hahn numbers by 100 billion range. The number in the "Range" column is the 100 billion digit i.e. Range 1 means from 100-200 billion.

Range Hahn-nums %-of-total %-of-range ----- --------- ---------- ---------- 0 145203 16.5% 0.000145% 1 327703 37.3% 0.000328% 2 103000 11.7% 0.000103% 3 122221 13.9% 0.000122% 4 79833 9.1% 0.000080% 5 32714 3.7% 0.000033% 6 24478 2.8% 0.000024% 7 20617 2.3% 0.000021% 8 12759 1.5% 0.000013% 9 9664 1.1% 0.000010%

The most unique factors in any number is 6 for 12843429375

The factors are: 3 5 5 5 5 7 29 41 823
Histogram of number of unique factors:

Occurrance of digits in Hahn numbers.

Factors of length n digits. Counts all unique factors in each number, but if factor squared or higher, only counts once.

Largest prime which was the smallest factor in a Hahn number:

995381 for number 991935986359

Incidences of small numbers (<300)being the largest factor in a Hahn number

An analysis was performed on the gaps between Hahn numbers. Instances were found of consecutive numbers being Hahn numbers. The summary of gap information is:

Maximum gap between Hahn numbers: 661169227 for 671998990261 to 672660159488

Minimum gap between Hahn numbers: 1 for 13946687727 to 13946687728

Average gap between Hahn numbers: 1138703.10

Click here to see detailed list of Cases where the gap between Hahn numbers is less than 20.

An analysis was performed to find Hahn numbers which are themselves sums of two other Hahn numbers.

Click here to see a detailed list of all such numbers.

A total of 198321 Hahn numbers were found which are themselves
sums of two other Hahn numbers.

The table below shows how many times one of the terms (itself a
Hahn number) which add to a Hahn number start with a certain digit and
how many times both terms, the sum, and both terms *and* the sum
start with that digit.

The second table shows how many times both or one term and the sum are a certain length.

Finding Hahn numbers is an interesting computational problem because it requires combining purely mathematical computation (finding factors) with string processing (determining if the factors and powers have the same digits as a number). The initial attempts to find Hahn numbers were programmed in REXX and then in PHP. However, both languages, being interpreted, took so much time that finding a siginificant number of Hahn numbers was not practical.

The Hahn numbers found for this study were found using a Java program. Some optimizations were performed as follows:

- The program reads a files of primes into an array. These are used as a possible factors. This is much faster than finding the list of primes each time.
- When a factor is found, the search for the next factor starts with that one (not 2).
- As each factor is found, a check is made to see if it has a digit not in the number. If so, the number cannot be a Hahn number. This optimization provided a slight (10%) improvement.
- All arithmetic is one using the Java type "long". This allows a search of numbers much larger than the practical limit on compute time!
- Boolean logic was used to determine that numbers are even rather than dividing by 2. This makes very little difference in compute time.

Finding the Hahn numbers in the range of 1 to 200 billion required approximately 60 days of compute time on a quad core 2GHz machine.

A version of the Java program was written with instrumentation to measure how much time is spent in factoring versus finding out if the number is a Hahn number. Finding factors is the overwhelming dominant CPU time use of the program. Therefore, further optimizations of comparing digits was not fruitful.

Click here for details of timing experiments

Experiements were run to compare the time required to check for Hahn numbers on different ranges of numbers, knowing that factoring large numbers takes longer, and on different machines.

Click here for details of those experiments.