Question: 2. if is odd, multiply it by 3 and add 1 3. repeat until n is1 For example, if you start with 10, the sequence

 2. if is odd, multiply it by 3 and add 1

2. if is odd, multiply it by 3 and add 1 3. repeat until n is1 For example, if you start with 10, the sequence you build is 10, 5, 16, 8, 4, 2, 1 Or if you start with 100, the sequence is: 100,50,25,76,38,19,58,29,88,44,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1 The amazing property of this sequence is that it always seems to converge to 1, no matter what n you start with. But noone has been able to prove it: do so and you will be famous. If you get time at the end of the lab, try to figure out why it converges to 1. The sequence seems to know that 1 is its home, and eventually wends its way back home You will write a function to explore this sequence. It will be a good test of recent Python syntax that we have developed, such as while loops and functions. Only the first function will be graded. The rest are for fun and to satisfy your curiosity. Please do try them out. You will learn a lot that will be useful in future. And you only get better at coding by coding

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!