Write a program that gets a starting value from the user


The Syracuse (also called Collatz or Hailstone) sequence is generated by starting with a natural number and repeatedly applying the following function until reaching 1:

937_4e57088c-8470-4881-bb2c-cf5c3072e762.png

For example, the Syracuse sequence starting with 5 is: 5, 16, 8, 4, 2, 1. It is an open question in mathematics whether this sequence will always go to 1 for every possible starting value. Write a program that gets a starting value from the user and then prints the Syracuse sequence for that starting value.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Write a program that gets a starting value from the user
Reference No:- TGS01707795

Expected delivery within 24 Hours