About Hailstone 1.0

Language: Visual C++
Version: 1.0
Size: 396 Kb
(Statically linked)

Introduction
Features
Bug Report
Download


ScreenShots

Screen 1
Screen 2
Screen 3
Screen 4
Screen 5

  Hailstone Numbers

Hailstone 1.0 is a Windows application that generates Hailstone Numbers sequences.
A Hailstone Sequence is generated by a simple algorithm, understandable even by non-mathematicians:
Start with an integer N. If N is even, the next number in the sequence is N / 2. If N is odd, the next number in the sequence is (3 * N) + 1.

Starting with 12 leads to the following sequence:
1263105168 421421...
Starting with 909 gives a different one:
909272613646823411024 5122561286432168 421421

After several iterations, both sequences finally end down to 1 and enter in the endless loop 4, 2, 1. These sequences of numbers are called Hailstone Sequences and the number of these sequences the Hailstone Numbers. In 1937, L. Collatz conjectured that all sequences finally fall back to 1. This problem, called the Collatz Problem, is still, to the best of my knowledge, unresolved.

Features

Hailtone 1.0 could help you in search of the mysteries of the Hailstone Numbers.

1. Sequence Data

Select the menu 'File | View Single Sequence'.

Click here for a better ScreenShot

Click on the 'Compute' Button, enter the Sequence Start Number and watch the results ... The maximum value reached in the sequence and the sequence length are shown on the left of the window. The listbox is populated with the sequence number and the highest value is highlighted.
Selecting the tab 'Sequence Graph' shows the graphical representation of the Hailstone sequence.

Click here for a better ScreenShot

2. Multiple Sequences

Select the menu 'File | View Multiple Sequences'.

Click here for a better ScreenShot

Click on the button 'Compute', enter the Starting Number of the first sequence and the Starting Number of the last sequence. After computation ( that could take a while if a large range is selected), the maximum value of the maximum reached in all the sequences as well as the maximum length found are showed on the left of the window.
The listbox is populated with the sequence attributes:
  • the starting number
  • the maximum reached
  • the length of the sequence
Each column of the listbox can be sorted by clicking the column header. Clicking again will toggle the sort order (ascending and descending).

Clicking the button 'Length Frequency' shows the frequency of the different sequence lengthes. Here again, the sorting order can be toggled using the column header.
To illustrate this point, here are the length frequencies of the sequences starting with 1 to 50.

LengthFrequencyLengthFrequency
01164
11172
21183
31191
41202
52213
61231
73242
83261
92291
102341
1111041
1211061
1321091
1411111
152 

The frequence length that appear most is 16. Four sequences have this length of 16 numbers. Amongst the sequences, no one have a sequence length of 22 numbers. Interestingly enough, four numbers generates a sequence length greater than 100. Also, the distribution is highly asymmetric: one group, almost complete, up to 34 and, after a big gap, a second one between 104 and 111.

Clicking the button 'Max. Frequency' shows the frequency of appearance of the maximum value of the different sequences. Here again, the sorting order can be toggled using the column header.
To illustrate this point, here are the maximum frequencies of the sequences starting with 1 to 50.

Max. ValueFrequencyMax. ValueFrequency
11642
21885
411001
811121
1661361
2011481
2411605
3211961
4033041
48192324
5211 

The highest value in sequences that have the higher frequency is 16. Distribution is spread from 1 to 304 followed by the much more higher value of 9232. Furthermore, this amazingly high value ( compared to the sequence starting value) is obtained four times for the sequences starting with 1 to 50.

Selecting the tab 'Paths Graph' shows the graphical representation of the maximum value and length of the selected sequences.

Click here for a better ScreenShot

3. Sequences Maxima

Select the menu 'File | View Sequences Maxima'.

Click here for a better ScreenShot

Click on the button 'Start', enter the Starting Number of the first sequence and the Starting Number of the last sequence and let the application compute higher and higher maximum values and sequence lengthes. Depending on the start and end starting number, the computation could take seconds, minutes, hours or even days ... Be cool, this part of the application uses the multi-thread feature of Windows and it can be stopped at any time by clickin the 'Stop' button.
Here is what it actually does: the application compute the sequences according to the selected range and stores the maximum value and sequence length as they appear in the scan.
For example, the sequence starting with 27 has a maximum value of 9232. The next sequence start number in the list is 255, as it is the first number since 27 that have a maximum higher than 9232. The following number added to the listbox is 447, as its maximum value (actually 39364) is the first to overcome the preceeding maximum reached (13120 with sequence starting with 255).

Here are the first ones:
Starting NumberMaximum Reached
11
22
316
752
15160
279232
25513120
44739364
63941524
703250504
............

For this part of the application, the sequence starting numbers can be extremely high, up to 10 18. Of course, for such high values, computing time can be very, very, very long .... To give an idead, computing a million sequences takes about 15 seconds on a 900 Mhz machine. This could seems fast but to compute one billion, it takes about 4 hours...
Note that this part of the application is not optimized to perform lengthy calculations. The User Interface is updated whith computation progress and the algorithm have not been optimized specifically for speed.

However, it can compute sequence with huge starting number such as the path record I found on the Web.
Try the following range:  (do not type in the spaces added for clarity)
   - Start Number: 10709 980568 908000
   - End Number: 10709 980568 909000
You will obtain the amazing maximum value of: 
   350 589187 937078 188831 873920 282244
for the stating number 10709 980568 908647
Bug Report

Please report any bug to Thierry.Marneffe@skynet.be


Have Fun !!!



The application Hailstone 1.0 is written according to the standard techniques and recommandations for the development of applications for Windows. The application has been tested extensively to verify its correct behaviour and memory management and to determine its effectiveness on different computers including network-linked computers.

The author makes no warranty of any kind, expressed or implied, with regard to this application and not be liable in any event for any direct, incidental or consequential damages, loss of profit or data, interruption of businees arising out of the performance or use of this program, even if the author has been advised to the possibility of such damages.

Donwload and Use of this software indicates your acceptance of these terms and conditions.

Download