Question: Given the current term of a sequence. n. we generate the subsequent term of the sequence as follows: If n is even dividen by 2.

Given the current term of a sequence. n. we generate the subsequent term of the sequence as follows: If n is even dividen by 2. or ifnis odd, multiplyn by 3 and add 1 to it. For example, if the current term in a sequence was 7, the subsequent term would be 22. If the current term in a sequence was 6, the subsequent term would be 3. A sequence ends when it generates the term 1. For example, the sequence starting with 3 is 3. 10.5. 16, 8,4, 2 and 1. Complete the program below so that it asks the user to enter the starting integer for the sequence and prints out each term in the corresponding sequence Ninclude
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
