The magazine of the Melbourne PC User Group

A program to consider the behaviour 
of hailstorm numbers

Ian McDowell

The file HAILV16.LZH [30 KB] is available for download. It consists only of the files HAIL.EXE and HAIL.TXT. These enable a student of the behaviour of numbers to consider the sequence of numbers generated by the process:

argument=argument/divisor

if result is an integer, or

argument=argument*multiplier+increment

if it is not.

It is believed that whatever the argument, the sequence oscillates for a while, but finally converges to a minimum value. This means that its behaviour is not chaotic.

The Computer Recreations column of Scientific American discussed the simplest case in its issue of January 1984, and again in passing later in that year. This case iterates 3*n+1 if n is odd, and n/2 if n is even. The sequence converges to a minimum value of unity. The outcome looks trivial, but it is not, and the properties of the resulting sequences are still not fully understood. The second article pointed out the tendency for runs of equal peak values to occur from consecutive starting points.

The program allows the user to select integer values for the argument, divisor, multiplier and increment. A wide variety of choices allows all possible searches to be made. Not more than two path lengths are the same, but many peak values are equal. Finding higher values may take some time.

A user might try as argument 138,367. Its sequence peaks at 2,798,323,360 and it returns to unity after 162 iterations. Or try 230,631. This argument generates a sequence peaking at 76,778,008, but takes 442 iterations to count up then back to unity.


Figure 1 (results as in earlier version of Hail v1.1)

Figure 1 shows the screen which results from a search of peak values up to an argument of 225.

Other sequences cycle down to values other than unity.

Argument=3 
divisor=2 
multiplier=3 
increment=5 


reaches its peak value of 152 in 14 iterations, then cycles down to 38 and up to 152 again in 7 iterations ad infinitum.

It is obvious that the value reached by the sequence decreases rapidly if it encounters a power of the divisor. The simplest initial parameters are 

argument=1 
divisor=2 
multiplier=3
and 
increment=1.


Other values may be examined, but the calculation is restricted by the length of a long integer in the Turbo C language in which the program was written.

The program may be regarded as freeware. Suggestions for improvement will be appreciated. The author would like to know if any reader discovers any sequence which diverges.

Reprinted from the August 1995 issue of PC Update, the magazine of Melbourne PC User Group, Australia

[About Melbourne PC User Group]