Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started