What follows will form the basis of an algorithm which can be used to construct a program which accepts a complete Hailstone Signature and computes the number which generated it. The Signature used as the input in this example will be OEOEOEEEEEOEEEEO.

We begin with two equal odd numbers called Α (the Greek letter alpha) and Ω (the Greek letter omega). Both will be initialized to the odd number 2n+1 before processing begins. Ω will change its value as processing proceeds, as dictated by the contents of the Signature. The changes to the value of Ω are effected by carefully controlled changes to the value of n. Whatever changes are made to the value of n in Ω will also be made to the value of n in Α. The result of all this will be that at the completion of the algorithm, Α will contain the required number.

          Ω      Α
     Ω     2n+1    2n+1
  O   2n+1   This is odd so Multiply by 3 and add 1.   6n+4    2n+1
     
  E   6n+4   This is even so Divide by 2.   3n+2    2n+1
     
  O   3n+2   For this to be odd, n must be odd, so set n to 2n+1.  6n+5    4n+3
    6n+5 is odd so Multiply by 3 and add 1.   18n+16    4n+3
     
  E   18n+16   This is even so Divide by 2.   9n+8    4n+3
     
  O   9n+8   For this to be odd, n must be odd, so set n to 2n+1.  18n+17    8n+7
    18n+17 is odd so Multiply by 3 and add 1.   54n+52    8n+7
     
  E   54n+52   This is even so Divide by 2.   27n+26    8n+7
     
  E   27n+26   For this to be even, n must be even, so set n to 2n.  54n+26    16n+7
    54n+26 is even so Divide by 2.   27n+13    16n+7
     
  E   27n+13   For this to be even, n must be odd, so set n to 2n+1.  54n+40    32n+23
    54n+40 is even so Divide by 2.   27n+20    32n+23
     
  E   27n+20   For this to be even, n must be even, so set n to 2n.  54n+20    64n+23
    54n+20 is even so Divide by 2.   27n+10    64n+23
     
  E   27n+10   For this to be even, n must be even, so set n to 2n.  54n+10    128n+23
    54n+10 is even so Divide by 2.   27n+5    128n+23
     
  O   27n+5   For this to be odd, n must be even, so set n to 2n.   54n+5    256n+23
    54n+5 is odd so Multiply by 3 and add 1.   162n+16   256n+23
     
  E   162n+16  This is even so Divide by 2.   81n+8    256n+23
     
  E   81n+8   For this to be even, n must be even, so set n to 2n.  162n+8    512n+23
    162n+8 is even so Divide by 2.   81n+4    512n+23
     
  E   81n+4   For this to be even, n must be even, so set n to 2n.  162n+4    1024n+23
    162n+4 is even so Divide by 2.   81n+2    1024n+23
     
  E   81n+2   For this to be even, n must be even, so set n to 2n.  162n+2    2048n+23
    162n+2 is even so Divide by 2.   81n+1    2048n+23
     
  O   81n+1   For this to be odd, n must be even, so set n to 2n.   162n+1    4096n+23   
    162n+1 is odd as required.     

     So, numbers having the given Signature will have the form 4096n+23

     When n=0, the initial number is 23.
     O   E   O   E    O   E    E   E   E   E   O   E   E   E   E   O
     23  70  35  106  53  160  80  40  20  10  5   16  8   4   2   1

     When n=1, the initial number is 4119.
     O    E     O    E     O    E     E     E    E    E    O    E
     4119 12358 6179 18538 9269 27808 13904 6952 3476 1738 869  2608
     E    E     E    O
     1304 652   326  163
Feel free to explore the Signatures which appear when you substitute other values of n. If you do you will find that the first 16 characters of the Signature will correspond exactly to the Signature of 23. Thereafter, all bets are off as to how the Signatures will progress except for the bet that they will all terminate with an O at number 1.