If you take a positive integer, halve it if it is even or triple it and add one if it is odd, and repeat, then the number will eventually become one.
Set up a loop containing a statement to read in a number (input terminated by zero) and to print out the sequence obtained from each input. The number 13 is considered to be very unlucky and if it is obtained as part of the sequence then execution should immediately terminate with an appropriate message.
Demonstrate that your program works by outputting the sequences generated by the following sets of numbers: