The Music of Hailstones Mike Keith Oct 1998

Introduction

The following number "game" is well-known in math circles. Start with any integer greater than 1 and call it s(0). Then generate additional terms of the sequence s(n) by the following rule:

 s(n+1) = s(n)/2 if s(n) is even 3s(n)+1 if s(n) is odd

Variously known as Hailstone numbers (because of their ups and down), the Collatz Problem, or the 3n+1 problem, the central conjecture that every integer eventually reaches the value 1 in its s(n) sequence has never been proved. We now explore the use of the s(n) sequences to produce music.

Music from Hailstone Sequences

An interesting feature, from a musical point of view, is the tension between the two rules for forming the next number in the sequence: the first rule makes the number half as big, but the second rule makes it three times as large. If we look at the sequence produced by some initial n, we see that it tends to go up and down somewhat erratically before (seemingly always) eventually hitting 1. Such a sequence is somewhat is reminiscent of the shape of musical melodies.

Here is an example. The sequence produced by the starting number 30 is

30 15 46 23 70 35 106 53 160 80 40 20 10 5 16 8 4 2 1

To bring this into the range of a musical melody, we pass each number through the following function:

f(n) = [ (10/3) log10(n) ]

where [ ] is the greatest-integer function, yielding the following sequence:

4 3 5 4 6 5 6 5 7 6 5 4 3 2 4 3 2 1 0

These numbers are interpreted as notes in the 7-tone major scale, with 0=root, 1=next note, etc. Note that the fact that the s(n) sequence always ends with 1 means that the last note of a tune produced in this way will always be 0, thus ending on the traditional root of the major scale.

Here are the notes of our tune, written in the key of G and 3/4 time: where the durations of the notes have been chosen by a human (me). If you are equipped to play General MIDI (.mid) files, here is an arrangement of the above tune as a jazz waltz for sax and piano. The first time through the sax player plays the melody exactly as above; the second time there's a bit of improvisation.

Many other interesting tunes can be produced by using this same technique with a different value of s(0).
{"ft_lang_label":"__label__en","ft_lang_prob":0.9400188,"math_prob":0.98477083,"size":2248,"snap":"2021-31-2021-39","text_gpt3_token_len":590,"char_repetition_ratio":0.122994654,"word_repetition_ratio":0.0,"special_character_ratio":0.26645908,"punctuation_ratio":0.07515658,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97682333,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,null,null,4,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-09-25T00:55:26Z\",\"WARC-Record-ID\":\"<urn:uuid:a3316b6a-d5c9-4dc6-bc34-895ae1dcf478>\",\"Content-Length\":\"6445\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:e3199bc1-259e-4a76-b79d-e206d288d6ca>\",\"WARC-Concurrent-To\":\"<urn:uuid:1fea8116-aac9-4b63-a35f-6892c68c646a>\",\"WARC-IP-Address\":\"107.180.55.16\",\"WARC-Target-URI\":\"http://cadaeic.net/hailmus.htm\",\"WARC-Payload-Digest\":\"sha1:CODHJZFBPEIU7FPIUXG5S2R2RJ2ER3ZH\",\"WARC-Block-Digest\":\"sha1:JGLDR2J4WION3UQPGX246MFXE2VISZUY\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-39/CC-MAIN-2021-39_segments_1631780057584.91_warc_CC-MAIN-20210924231621-20210925021621-00053.warc.gz\"}"}