Question: I need this question Solution in Python. 2. Generalized hailstone: Recall in class that we discussed the hailstone numbers where xn=3xn1+1 if xn1 is odd
I need this question Solution in Python.

2. Generalized hailstone: Recall in class that we discussed the hailstone numbers where xn=3xn1+1 if xn1 is odd and xn=xn1/2 if xn1 is even. The hailstone numbers converge to a sort of holding pattern 421421 421. We call this kind of pattern a convergence because it repeats. Write a program to test generalized hailstone numbers where xn=axn1+b if xn1 is odd and xn=xn1/2 if xn1 is even where a and b are positive integers. For each of the a,b pairs less than or equal to 10 , find whether or not the sequence seems to converge. Once you can do that, tell me how many different holding patterns the sequence converges to. For instance, when a=3 and b=5 then 18421 this is holding pattern. However, if we start with a different number, say 5 we get a different holding pattern 520105
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
