Question: Problem 4 : Hailstone Sequences In mathematics, a hailstone sequence is a sequence creates as follows: Select a starting value for the sequence. If a
Problem : Hailstone Sequences
In mathematics, a hailstone sequence is a sequence creates as follows:
Select a starting value for the sequence.
If a particular term in the sequence is equal to n then the next term will be equal to n if n is even, and will be
equal to n if n is odd.
The sequence continues until reaching a term that is equal to
For example, the hailstone sequence beginning with is:
It is widely believed that any starting value will result in a sequence that eventually reaches but this has not been proven
to be true.
Use while loops to calculate the hailstone sequences beginning with and storing the sequences in order in
lists named hs hs and hs This will require three separate but nearly identical loops. The elements stored in
the lists should be integers as opposed to floats Print the contents of the three lists.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
