Question: --- PYTHON PROGRAM --- a) The Collatz conjecture The Collatz conjecture, also known as the 3n+1 conjecture (and other names), deals with the following operation
--- PYTHON PROGRAM ---

a) The Collatz conjecture The Collatz conjecture, also known as the 3n+1 conjecture (and other names), deals with the following operation to produce a sequence of numbers. Given a number, n, if n is even then the next number is n divided by 2. If n is odd, then the next number is 3n+1. The Collatz conjecture is that this sequence of numbers always eventually reaches 1. As simple as this seems, it is unproven (and considered extremely hard to prove) by mathematicians. As an example of a sequence, if you start with the number 6, then the terms of the sequence will be: 6,3, 10, 5, 16, 8, 4, 2,1. Write a program that takes in a positive integer from a user, and computes the Collatz sequence, printing out all the numbers in the sequence, followed by a line stating how many terations it took to reach the value 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
