Write a Swift program to generate a sequence of numbers according to the following scheme :
Begin with any positive integer greater than 1. If the current term is odd then the next term is obtained by tripling the current term and adding 1, but if the current term is even, then the next term is obtained by halving the current term. Repeat this process until you obtain a term equal to 1.
For example, suppose we begin with 7. Then the sequence of terms is:
7 22 11 34 17 52 26 1 3 40 20 10 5 16 8 4 2 1
Of course, your program should prompt the user for the starting term. Run your program with 7 as the input to verify your program. Also, use 97 for an interesting sequence.