Question: Programming 2. Generalized hailstone: Recall in class that we discussed the hailstone numbers where 33,, : 3a:n_1 + 1 if 93n_1 is odd and 9:

Programming 2. Generalized hailstone: Recall in class that we discussed the hailstone numbers where 33,, : 3a:n_1 + 1 if 93n_1 is odd and 9:\" = 33n_1 / 2 if 93n_1 is even. The hailstone numbers converge to a sort of holding pattern 4 2 1 4 2 1 4 2 1. We call this kind of pattern a convergence because it repeats. Write a program to test generalized hailstone numbers where 3:.\" = axn_1 + b if $71-1 is odd and 33,, = xn_1/2 if 93711 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 1 8 4 2 1 this is holding pattern. However, if we start with a different number, say 5 we get a different holding pattern 5)20105

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 Mathematics Questions!